Chart History API
Real-time historical chart data service that provides candlestick data for tokens.
Endpoint
GET /api/chart-historyParameters
| Parameter | Required | Description | Default |
|---|---|---|---|
| base | Yes | Base token address | - |
| from | No | Start timestamp (Unix) | 24 hours ago |
| to | No | End timestamp (Unix) | Current time |
| intervalSecs | No | Candle interval in seconds | 60 |
| countBack | No | Number of candles to return | All available |
Response Format
{
"candles": [
{
"time": "2025-04-30T15:00:00.000Z",
"timestamp": 1746025200000,
"open": 0.00000485699221784118,
"high": 0.00000485699221784118,
"low": 0.00000429969409742093,
"close": 0.00000429969409742093,
"volume": 319.271581866465
}
]
}Candle Fields
-
time: ISO datetime of the candle -
timestamp: Unix timestamp in milliseconds -
open: Opening price -
high: Highest price
-
low: Lowest price -
close: Closing price -
volume: Trading volume
Usage Examples
1 Basic usage (just base token):
curl "https://api.solapi.live/api/chart-history?base=TOKEN_ADDRESS"2 1-second candles:
curl "https://api.solapi.live/api/chart-history?base=TOKEN_ADDRESS&intervalSecs=1"3 Custom time range:
curl "https://api.solapi.live/api/chart-history?base=TOKEN_ADDRESS&from=1746027341&to=1746027941"4 Full history (omit countBack):
curl "https://api.solapi.live/api/chart-history?base=TOKEN_ADDRESS&intervalSecs=300"Error Handling
{
"error": "Missing required parameter",
"message": "A base token address is required. Use ?base=tokenAddress"
}Common errors:
- Missing base token address
- Invalid timestamp format
- Invalid interval value
- Invalid countBack value
Notes
- The API supports intervals from 1 second up to any larger value
- To get full history, omit the
countBackparameter - The
fromandtoparameters should be Unix timestamps in seconds - All prices are in the quote token's denomination (e.g., SOL)
- Volume is in the base token's denomination
- For large time ranges or small intervals, consider using
countBackto limit the response size