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.

GET/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>"
Parameters
ParameterDescription
interval

query · string · optional

Spacing between snapshots. Defaults to one day.1m3m5m15m30m1h4h6h8h12h1d1w
range

query · number · optional

The band, in percent either side of the price, whose resting orders are summed. Defaults to 1.0.250.50.75123510
limit

query · 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.
venue

query · 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
quote

query · 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).
symbol

path · 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.

Response fields of One coin's spot bid and ask depth near the price, across exchanges, over time
FieldTypeDescription
symbolstringThe coin, spelled as it is listed (e.g. "BTC" for "btc").
venuestringOnly with venue asked: the exchange. Absent from the cross-exchange answer.
quotestringOnly with venue asked: the quote currency of the pair, e.g. "USDT". The figures stay in US dollars and coin units.
pairstringOnly with venue asked: the pair, BASE/QUOTE, as spot-coin-venues prints it.
intervalstringThe spacing between snapshots.
rangePctnumberThe band, in percent either side of the price.
snapshotsobject[]Oldest first.
snapshots[].atnumberWhen the book was recorded, unix seconds.
snapshots[].bidsUsdnumber | nullResting bids within the band, summed across exchanges (or on the one pair, with venue), US dollars. null when not stated.
snapshots[].bidsQuantitynumber | nullResting bids within the band, summed across exchanges (or on the one pair, with venue), in units of the coin. null when not stated.
snapshots[].asksUsdnumber | nullResting asks within the band, summed across exchanges (or on the one pair, with venue), US dollars. null when not stated.
snapshots[].asksQuantitynumber | nullResting asks within the band, summed across exchanges (or on the one pair, with venue), in units of the coin. null when not stated.
snapshots[].completebooleanWhether 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