Get Portfolio Chart
Get historical performance data to visualize your portfolio’s growth over time
You will get
You will get
- Total portfolio value at different time points
- Performance metrics for various time ranges
- Historical Profit/Loss (PnL) data
Required
Required
- type: Specify the time range for the chart data (e.g., “24h”, “1w”, “1m”, “1y”)
Optional
Optional
- shareToken OR portfolioId: Provide one of these to identify the portfolio.
- shareToken: Get this from your CoinStats portfolio page by clicking “Share”
- portfolioId: Use a portfolio connected via POST /portfolio/wallet or POST /portfolio/exchange
- If neither is provided, returns aggregated chart for all API-connected portfolios
- passcode: Passcode for accessing protected portfolio data (can be passed in header or query parameter)
- currency: Display currency (defaults to USD).
Authorizations
API key required to access the endpoints. Generate one from your dashboard at https://openapi.coinstats.app and pass it in the X-API-KEY request header. Never expose your key in client-side code.
Headers
Passcode for accessing protected portfolio data
"123456"
Query Parameters
One of time periods.
24h, 1w, 1m, 3m, 6m, 1y, all "24h"
Portfolio ID for accessing a specific API-connected portfolio. Required if shareToken is not provided.
"abc123def456"
Currency for chart values. Default is USD.
"USD"
Response
Portfolio Chart
Array of historical price data points. Each data point is an array containing:
- TIMESTAMP - Unix timestamp in seconds
- USD - Price in USD
- BTC - Price in Bitcoin
- ETH - Price in Ethereum