Discovery and markets API

Order book heatmap for one coin on one exchange: resting orders by price

A coin's resting bids and asks at each price level on one exchange's futures or spot book, one snapshot per interval from one minute to one day, in coin units. Keyed by coin ticker.

GET/api/external/discovery/orderbook-heatmap/{symbol}

What it returns

An order book heatmap: the resting bids (buy orders) and asks (sell orders) at each price level of one coin's order book on one exchange, one snapshot per interval, oldest first — the book's walls and gaps over time. market picks the perpetual futures book (Binance, OKX, Hyperliquid) or the spot book (Binance, Coinbase); instrument names the exchange's instrument, else the main USD-margined perpetual or USD/USDT pair for the coin. Each snapshot keeps the levels within range percent of its own mid price. prices is the price axis (lowest first), snapshots the time axis with the best bid and ask of each, and each cell [snapshotIndex, priceIndex, quantity] in bids or asks is the resting quantity at that price, in units of the coin; only non-zero cells are listed. How deep a book is recorded depends on the exchange: OKX futures only about 1% either side. The newest snapshot is normally the live book (complete: false). Large maps keep only the largest 30000 cells by US dollar value: cellCount says how many there were and capped whether some were dropped. An answer may be served from a cache up to a few minutes old. An instrument that is not recorded 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/orderbook-heatmap/<symbol>"
Parameters
ParameterDescription
market

query · string · optional

futures (the perpetual futures book) or spot. Defaults to futures.futuresspot
venue

query · string · optional

The exchange, spelled as listed: Binance, OKX or Hyperliquid for futures; Binance or Coinbase for spot. Defaults to Binance.BinanceOKXHyperliquidCoinbase
interval

query · string · optional

Spacing between snapshots. Defaults to one hour.1m15m1h4h1d
range

query · number · optional

The band kept, in percent either side of each snapshot's mid price. Defaults to 2.0.5125102550
limit

query · integer · optional

How many of the most recent snapshots to return, the live one included, 1 to 100. Defaults to 24.
instrument

query · string · optional

The exchange's instrument id, e.g. "BTCUSDT" on Binance, "BTC-USDT-SWAP" on OKX, "BTC-USD" on Hyperliquid or Coinbase. Sent as given. Omitted: the main USD-margined perpetual (futures) or USDT pair (USD on Coinbase) for the coin.
symbol

path · string · required

The coin (base asset) ticker, e.g. "BTC" or "ETH" — not a venue instrument id such as "BTCUSDT" (that goes in instrument), 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 Order book heatmap for one coin on one exchange: resting orders by price
FieldTypeDescription
symbolstringThe coin ticker, upper-cased.
marketstringThe book: futures or spot.
venuestringThe exchange.
instrumentstringThe exchange's instrument id the book is of.
intervalstringThe spacing between snapshots.
rangePctnumberThe band kept, in percent either side of each snapshot's mid price.
pricesnumber[]The price axis, lowest first, in the instrument's quote currency; a cell's priceIndex points into it.
snapshotsobject[]The time axis, oldest first; a cell's snapshotIndex points into it.
snapshots[].atnumberWhen the book was recorded, unix seconds.
snapshots[].bestBidnumber | nullThe highest bid in the recorded book; null when it had none.
snapshots[].bestAsknumber | nullThe lowest ask in the recorded book; null when it had none.
snapshots[].completebooleanWhether the snapshot is final. false only on the newest, the live book when the figures were read.
bidsnumber[][][snapshotIndex, priceIndex, quantity]: resting buy orders at prices[priceIndex] in snapshots[snapshotIndex], in units of the coin. Non-zero cells only, by snapshot then price.
asksnumber[][][snapshotIndex, priceIndex, quantity]: resting sell orders at prices[priceIndex] in snapshots[snapshotIndex], in units of the coin. Non-zero cells only, by snapshot then price.
cellCountnumberNon-zero cells within the band, both sides, before any were dropped.
cappedbooleantrue when the map had more cells than one response carries and only the largest by US dollar value are listed.
maxQuantitynumber | nullThe largest listed cell, in units of the coin — the top of the colour scale; null when there is no cell.

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