Sparkline price-ratio time series
POST/v1/data/sparklines
Returns price-ratio time series for the cross product of currencies × quotes over a configurable lookback window (default 24h).
Request body: { currencies: string[], quotes: string[], windowHours?: number } where each ID is either a shorthand ("usd", "eth") or "{chainId}-{address}". See the SparklineRequest schema.
Response: { windowHours, count, result }. Each result[i] has { currency, quote, data } where data is an array of { time, value } points and value = price(currency) / price(quote). Pairs with no data are omitted from result (so count ≤ currencies.length × quotes.length).
Useful for rendering small inline charts (token cards, asset selectors) without hitting the heavier snapshot endpoints.
Plain-text reference — POST /v1/data/sparklines
Request body
| Field | Type | Required | Description |
|---|---|---|---|
currencies | string[] | yes | Currency identifiers. Use shorthand ("usd", "eth") or "{chainId}-{address}" format. |
quotes | string[] | yes | Quote identifiers (same format as currencies) |
windowHours | number | no | Lookback window in hours |
Response 200
| Field | Type | Description |
|---|---|---|
success | True | |
data | object | |
data.windowHours | number | |
data.count | integer | Number of non-empty sparkline pairs |
data.result | object[] | |
data.result[].currency | string | |
data.result[].quote | string | |
data.result[].data | object[] | Informational payload. null when the endpoint only builds calldata. |
data.result[].data[].value | number | Price ratio (currency / quote) |
data.result[].data[].time | string | |
actions | null |
Example response
{
"success": true,
"data": {
"windowHours": 1.0,
"count": 1,
"result": [
{
"currency": "string",
"quote": "string",
"data": [
{
"value": 1.0,
"time": "2026-01-01T00:00:00Z"
}
]
}
]
}
}
Request
Responses
- 200
- 429
- 500
- 502
Sparkline data
Rate limited. Unauthenticated callers share a per-IP budget; send an x-api-key header to lift it. Retry with exponential backoff.
Unexpected server error. Safe to retry with backoff.
An upstream data source or protocol origin failed (error.code is ORIGIN_FAILED). error.details carries the per-origin status. This is also what a missing or malformed required parameter currently returns, rather than a 400.