Usage Guidelines
- Pass an array of token
idsin the formattokenAddress:networkIdto fetch sparklines for multiple tokens in one request resolutionspecifies the candle size:1S,5S,15S,30S,1(1 min),5,15,30,60(1 hour),240,720,1D,7D- Alternatively, use
pointCountto specify the desired number of data points — the resolver will automatically choose the best resolution based on token age - Use
fromandto(unix timestamps) to specify a custom time range — defaults to the last 7 days - Set
fillMissingBars: trueto include empty bars with the previous bar’s value, ensuring consistent data density - The response includes
{timestamp, value}pairs ideal for rendering lightweight price charts or sparkline visualizations
Troubleshooting Tips
When should I use tokenSparklines vs getBars?
When should I use tokenSparklines vs getBars?
Use
tokenSparklines for lightweight, display-ready chart data — it returns simple {timestamp, value} pairs optimized for sparkline visualizations. Use getBars when you need full OHLCV candlestick data with volume, trade counts, and other detailed metrics.Should I use resolution or pointCount?
Should I use resolution or pointCount?
Use
pointCount for adaptive charts that automatically adjust resolution based on the token’s age and your desired data density. Use resolution when you need a specific candle size (e.g., hourly or daily). If both are provided, pointCount takes precedence.Why are there gaps in my sparkline data?
Why are there gaps in my sparkline data?
By default, bars are only returned when there was trading activity. Set
fillMissingBars: true to fill gaps with the previous bar’s value, which is useful for continuous chart displays.Can I fetch sparklines for multiple tokens at once?
Can I fetch sparklines for multiple tokens at once?
Yes. Pass multiple token IDs in the
ids array to batch-fetch sparklines for several tokens in a single request. Each token’s sparkline is returned as a separate object in the response array.