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.
/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>"
| Parameter | Description |
|---|---|
marketquery · string · optional | futures (the perpetual futures book) or spot. Defaults to futures.futuresspot |
venuequery · string · optional | The exchange, spelled as listed: Binance, OKX or Hyperliquid for futures; Binance or Coinbase for spot. Defaults to Binance.BinanceOKXHyperliquidCoinbase |
intervalquery · string · optional | Spacing between snapshots. Defaults to one hour.1m15m1h4h1d |
rangequery · number · optional | The band kept, in percent either side of each snapshot's mid price. Defaults to 2.0.5125102550 |
limitquery · integer · optional | How many of the most recent snapshots to return, the live one included, 1 to 100. Defaults to 24. |
instrumentquery · 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. |
symbolpath · 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.
| Field | Type | Description |
|---|---|---|
symbol | string | The coin ticker, upper-cased. |
market | string | The book: futures or spot. |
venue | string | The exchange. |
instrument | string | The exchange's instrument id the book is of. |
interval | string | The spacing between snapshots. |
rangePct | number | The band kept, in percent either side of each snapshot's mid price. |
prices | number[] | The price axis, lowest first, in the instrument's quote currency; a cell's priceIndex points into it. |
snapshots | object[] | The time axis, oldest first; a cell's snapshotIndex points into it. |
snapshots[].at | number | When the book was recorded, unix seconds. |
snapshots[].bestBid | number | null | The highest bid in the recorded book; null when it had none. |
snapshots[].bestAsk | number | null | The lowest ask in the recorded book; null when it had none. |
snapshots[].complete | boolean | Whether the snapshot is final. false only on the newest, the live book when the figures were read. |
bids | number[][] | [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. |
asks | number[][] | [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. |
cellCount | number | Non-zero cells within the band, both sides, before any were dropped. |
capped | boolean | true when the map had more cells than one response carries and only the largest by US dollar value are listed. |
maxQuantity | number | null | The 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