Tokens API
Seven-day price sparklines for many tokens
The last seven days of USD prices for up to 25 tokens on one chain, one point per 4-hour bucket, in one request — the small chart beside each row of a watch list or a token table.
/api/external/token-analysis/price-sparklines/{chain}What it returns
A compact price series for many tokens on one chain in one request: the last seven days, one USD price per 4-hour bucket, oldest first — enough to draw a sparkline next to every row of a watch list. Buckets in which a token did not trade are left out rather than filled, so two consecutive points can be 8 hours or more apart, and a token younger than seven days starts at its first bucket. The newest point is normally the bucket still in progress, and its price is the current one. POST, because the list is the subject: it can run past what a URL comfortably holds, and a body keeps a watch list out of every proxy log between the caller and this service.
Chains
- Solana SOL
- BNB Chain BNB
- Ethereum ETH
- Stable STABLE
- Base BASE
- Robinhood Chain RHC
- Arc ARC
Request
Send your key in the x-dex-data-key header. Replace each <placeholder> with a real value.
curl -X POST -H "x-dex-data-key: $DEXDATA_API_KEY" \
-H "content-type: application/json" \
-d '{"subjects":["<subjects>"]}' \
"https://api.dexdata.io/api/external/token-analysis/price-sparklines/SOL"| Parameter | Description |
|---|---|
chainpath · string · required | The chain every token in the batch lives on. All seven trading chains are served. CELO, ARB, OP and SCROLL return 400 here. |
subjectsbody · string[] · optional | Token mint addresses (Solana) or contract addresses (EVM). Between 1 and 25, each sent once. |
Response fields
A JSON response. Every field is always present; null means the value could not be established, never zero.
| Field | Type | Description |
|---|---|---|
results | object[] | One entry per requested subject, in the order they were sent. |
results[].subject | string | The subject exactly as it was sent. |
results[].result | object | null | What the single-subject endpoint answers for this subject. null only when error is set. |
results[].result.points | object[] | The series, oldest first. Empty when no series is kept for the token — an unknown address, but also some tokens that do trade — so an empty list does not mean the token had no trades. |
results[].result.points[].at | number | The start of the 4-hour bucket, Unix seconds (a multiple of 14,400). |
results[].result.points[].usd | number | The price of one token in USD in that bucket. |
results[].result.points[].complete | boolean | Whether the bucket had ended when the request was answered. false on the bucket in progress, whose price is the latest one. |
results[].error | string | null | null, or unavailable when no source could be reached for this subject — retry it. A subject nobody has data for is NOT an error: its result says so. |
Start building with DexData today
Sign in, create a key and make your first call in a minute. Free credits every month, and you only pay for calls that succeed.
Get a free API key