Tokens API
Price candles for one token priced in another token
OHLCV for BASE priced in a caller QUOTE token, not USD: what A is worth in B, over time. SOL, ETH, BNB, BASE confirmed; RHC unconfirmed; same chain only.
/api/external/token-analysis/cross-rate-ohlcv/{chain}/{mint}What it returns
Price candles for the BASE token (mint), denominated in the QUOTE token (?quote=) — what has A been worth in terms of B, over time. The token/token sibling of ohlcv's token/USD series: open/high/low/close are the price of one BASE unit in QUOTE units, never the reverse — swapping which address is mint and which is quote answers a DIFFERENT question, not the same one inverted for convenience. Both tokens must live on the same chain; there is no cross-chain form of this question. SOL, ETH, BNB and BASE have a confirmed source; RHC is declared by the same underlying source for other questions but is unconfirmed for this one and returns 400; STABLE and ARC are not covered by any source for this question at all. A pair with no market for the requested window answers an empty series rather than a 400 — this surface cannot tell "wrong address" from "a real pair nobody has traded in this window" and does not guess which one it is.
Chains
- Solana SOL
- BNB Chain BNB
- Ethereum ETH
- Base BASE
Request
Send your key in the x-dex-data-key header. Replace each <placeholder> with a real value.
curl -H "x-dex-data-key: $DEXDATA_API_KEY" \ "https://api.dexdata.io/api/external/token-analysis/cross-rate-ohlcv/SOL/<mint>?quote=<quote>&interval=1m&from=<from>&to=<to>"
| Parameter | Description |
|---|---|
quotequery · string · required | The QUOTE token: the mint address (Solana) or contract address (EVM) the price is DENOMINATED IN. Must be a different address from mint and must live on the same chain. This is the one field that turns ohlcv's USD series into a token/token series — omitting it is not possible; there is no implied "primary quote" for this question the way /pair's ?pool= has a primary pool. |
intervalquery · string · required | Candle width. The same set the token/USD ohlcv offers — confirmed live to be a subset of what this question also accepts, so no caller-visible width needs its own map.1m5m15m1h4h1d |
fromquery · integer · required | Window start, Unix SECONDS. A candle is returned when its OPEN is at or after this time. Align from to a bucket open (a multiple of the interval in seconds, UTC) to get the bucket you are standing in. |
toquery · integer · required | Window end, Unix SECONDS. Inclusive. At most 1000 candles fit in one request — a wider window returns 400 rather than a silently truncated series. A window of ≤ 150 candles keeps the answer under 32 KB. |
chainpath · string · required | The chain the token lives on. SOL, ETH, BNB and BASE are served; STABLE, RHC and ARC all return 400. CELO, ARB, OP and SCROLL return 400 here. |
mintpath · string · required | The token mint address (Solana) or contract address (EVM). |
Response fields
A JSON response. Every field is always present; null means the value could not be established, never zero.
| Field | Type |
|---|---|
interval | string |
candles | object[] |
candles[].at | number |
candles[].open | number | null |
candles[].high | number | null |
candles[].low | number | null |
candles[].close | number | null |
candles[].volumeBase | number | null |
candles[].volumeQuote | number | null |
candles[].complete | boolean |
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