Discovery and markets API
One coin's spot bid and ask depth near the price, across exchanges, over time
A coin's resting spot bids and asks within 0.25% to 10% of price, summed across six exchanges or on one pair, in USD and coin units, 1m to 1w per interval.
/api/external/discovery/spot-orderbook-depth-history/{symbol}What it returns
One coin's spot order book depth over time: the resting bids (buy orders) and asks (sell orders) within a band of range percent either side of the price, in US dollars and in units of the coin, on the coin's spot pairs, summed across six major centralized exchanges (Binance, OKX, Bybit, Coinbase, Bitfinex, Kraken), one snapshot per interval, oldest first. Spot only: not perpetuals or dated futures. Each snapshot is the book as recorded at its time; the newest is normally the live book when the figures were read (complete: false, still moving) and counts toward limit. An answer may be served from a cache up to a few minutes old. symbol is the coin ticker (e.g. "BTC"), matched case-insensitively — not a pair, not a token mint or contract address, and not scoped to any of this API's chains. An unknown ticker, or a coin whose book is not recorded, answers 404. With venue (optionally quote), the same series for the coin's one pair on that exchange instead of the sum across exchanges, and the answer also names venue, quote and pair; without quote, the exchange's USDT pair is used, else its USD pair, else its USDC pair, else the first other quote the exchange lists (alphabetically). A coin the exchange lists no pair for, or none in the quote asked, answers 404.
Chains
This endpoint is not tied to a chain: it takes no chain in its request.
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/discovery/spot-orderbook-depth-history/<symbol>"
| Parameter | Description |
|---|---|
intervalquery · string · optional | Spacing between snapshots. Defaults to one day.1m3m5m15m30m1h4h6h8h12h1d1w |
rangequery · number · optional | The band, in percent either side of the price, whose resting orders are summed. Defaults to 1.0.250.50.75123510 |
limitquery · integer · optional | How many of the most recent snapshots to return, the live one included, 1 to 1000. Defaults to 100. Fewer come back when the coin's recorded history is shorter. limit ≤ 200 keeps the answer under 32 KB. |
venuequery · string · optional | Optional: one exchange, spelled exactly as listed (case-sensitive), as spot-coin-venues names it. With it, the series is the book of the coin's one pair on that exchange rather than the sum across exchanges.BinanceBitfinexBybitCoinbaseKrakenOKX |
quotequery · string · optional | Optional, and only with venue: the quote currency of the pair, e.g. "USDT" or "USD". Case-insensitive. Without it, USDT, then USD, then USDC, else the first other quote the exchange lists (alphabetically). |
symbolpath · string · required | The coin (base asset) ticker, e.g. "BTC" or "PEPE" — not a pair such as "BTCUSDT" or "BTC/USDT", and not a token mint or contract address. Case-insensitive. |
Response fields
A JSON response. Every field is always present; null means the value could not be established, never zero.
| Field | Type | Description |
|---|---|---|
symbol | string | The coin, spelled as it is listed (e.g. "BTC" for "btc"). |
venue | string | Only with venue asked: the exchange. Absent from the cross-exchange answer. |
quote | string | Only with venue asked: the quote currency of the pair, e.g. "USDT". The figures stay in US dollars and coin units. |
pair | string | Only with venue asked: the pair, BASE/QUOTE, as spot-coin-venues prints it. |
interval | string | The spacing between snapshots. |
rangePct | number | The band, in percent either side of the price. |
snapshots | object[] | Oldest first. |
snapshots[].at | number | When the book was recorded, unix seconds. |
snapshots[].bidsUsd | number | null | Resting bids within the band, summed across exchanges (or on the one pair, with venue), US dollars. null when not stated. |
snapshots[].bidsQuantity | number | null | Resting bids within the band, summed across exchanges (or on the one pair, with venue), in units of the coin. null when not stated. |
snapshots[].asksUsd | number | null | Resting asks within the band, summed across exchanges (or on the one pair, with venue), US dollars. null when not stated. |
snapshots[].asksQuantity | number | null | Resting asks within the band, summed across exchanges (or on the one pair, with venue), in units of the coin. null when not stated. |
snapshots[].complete | boolean | Whether the snapshot is final. false only on the newest, the live book when the figures were read. |
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