Portfolio Performance Chart
Get historical data to visualize your portfolio’s performance over various time periods. This endpoint provides time-series data showing how your portfolio value has changed, perfect for creating charts and analyzing trends.Key Features
- Multiple Time Ranges: View data from 24 hours to all-time history
- Time-Series Data: Arrays of timestamps and corresponding values
- Performance Tracking: Track portfolio growth and declines over time
- Historical Profit/Loss: See how your PnL has evolved
- Trend Analysis: Identify patterns and market cycles in your portfolio
You’ll need a share token to access portfolio data. Share tokens are available to all CoinStats users — generate one from the Share button on your portfolio. Learn more about Share Token Authentication.
Get Portfolio Chart Data
Retrieve historical portfolio performance data:8 credits per request
Headers
Query Parameters
Time Range Options
With Passcode
For passcode-protected portfolios, add thepasscode header:
Example Response
The response is an array of arrays, where each sub-array contains[timestamp, value]:
Data Format
- First element: Unix timestamp in milliseconds
- Second element: Portfolio value in USD at that timestamp
Visualization Examples
JavaScript Chart Example
Using Chart.js to visualize portfolio performance:Python Visualization
Using matplotlib to plot portfolio data:Use Cases
Performance Dashboard
Build interactive dashboards showing portfolio growth over time
Trend Analysis
Identify bull and bear market cycles in your portfolio
Goal Tracking
Monitor progress toward investment goals with visual charts
Historical Reports
Generate historical performance reports for any time period
Calculate Performance Metrics
Use chart data to calculate custom metrics:Comparing Time Periods
Compare performance across different time ranges:Error Handling
Invalid Type Parameter (400)
Invalid Type Parameter (400)
Portfolio Not Found (404)
Portfolio Not Found (404)
Passcode Required (409)
Passcode Required (409)
Best Practices
Optimize API Calls
Optimize API Calls
- Cache chart data and refresh periodically rather than on every page load
- Use appropriate time ranges for your use case (24h for real-time, 1m for recent trends)
Handle Missing Data
Handle Missing Data
- Check for empty arrays or null values in responses
- Implement fallbacks for portfolios with limited history
Visualization Tips
Visualization Tips
- Use line charts for continuous data
- Add annotations for significant events (large deposits/withdrawals)
- Include percentage changes in chart titles for context
Related Endpoints
Portfolio Value
Get current portfolio value and overall metrics
Portfolio Coins
View detailed holdings and coin-level performance
Portfolio Transactions
Access complete transaction history
Portfolio Snapshots
Get historical portfolio snapshot data