Read a crypto order book heatmap
curl --request GET \
--url https://api.darvas.app/v1/crypto/order-book/heatmap \
--header 'X-API-KEY: <api-key>'import requests
url = "https://api.darvas.app/v1/crypto/order-book/heatmap"
headers = {"X-API-KEY": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'X-API-KEY': '<api-key>'}};
fetch('https://api.darvas.app/v1/crypto/order-book/heatmap', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"ticker": "BTC-USDT-SWAP",
"exchange": "okx",
"market_type": "swap",
"interval": "15m",
"start_time": "2026-11-27T00:00:00.000Z",
"end_time": "2026-11-28T12:00:00.000Z",
"low": 95210.4,
"high": 99120.8,
"row_size": 10,
"limited": false,
"bid_walls": [
{
"price": 97500,
"average_size": 18.9
}
],
"ask_walls": [
{
"price": 98500,
"average_size": 15.2
}
],
"cells": [
{
"time": "2026-11-28T11:45:00.000Z",
"time_milliseconds": 1795866300000,
"price": 97500,
"bid_size": 21.4,
"ask_size": 0,
"bid_max": 44.8,
"ask_max": 0
}
]
}{
"error": "VALIDATION_ERROR",
"message": "Send ticker or cik"
}{
"error": "UNAUTHORIZED",
"message": "The API key is not valid"
}{
"error": "PLAN_REQUIRED",
"message": "The account of this key has no active data API plan"
}{
"error": "NOT_FOUND",
"message": "No company has this ticker or CIK"
}{
"error": "RATE_LIMITED",
"message": "Too many requests"
}{
"error": "INTERNAL_ERROR",
"message": "Something went wrong"
}{
"error": "UNAVAILABLE",
"message": "The data service is unavailable"
}Crypto Order Flow
Crypto Order Book Liquidity Heatmap Data API
Retrieve historical resting limit-order liquidity per price level and time bar to detect spoofing, resting walls and liquidity sweeps on crypto pairs.
Read a crypto order book heatmap
curl --request GET \
--url https://api.darvas.app/v1/crypto/order-book/heatmap \
--header 'X-API-KEY: <api-key>'import requests
url = "https://api.darvas.app/v1/crypto/order-book/heatmap"
headers = {"X-API-KEY": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'X-API-KEY': '<api-key>'}};
fetch('https://api.darvas.app/v1/crypto/order-book/heatmap', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"ticker": "BTC-USDT-SWAP",
"exchange": "okx",
"market_type": "swap",
"interval": "15m",
"start_time": "2026-11-27T00:00:00.000Z",
"end_time": "2026-11-28T12:00:00.000Z",
"low": 95210.4,
"high": 99120.8,
"row_size": 10,
"limited": false,
"bid_walls": [
{
"price": 97500,
"average_size": 18.9
}
],
"ask_walls": [
{
"price": 98500,
"average_size": 15.2
}
],
"cells": [
{
"time": "2026-11-28T11:45:00.000Z",
"time_milliseconds": 1795866300000,
"price": 97500,
"bid_size": 21.4,
"ask_size": 0,
"bid_max": 44.8,
"ask_max": 0
}
]
}{
"error": "VALIDATION_ERROR",
"message": "Send ticker or cik"
}{
"error": "UNAUTHORIZED",
"message": "The API key is not valid"
}{
"error": "PLAN_REQUIRED",
"message": "The account of this key has no active data API plan"
}{
"error": "NOT_FOUND",
"message": "No company has this ticker or CIK"
}{
"error": "RATE_LIMITED",
"message": "Too many requests"
}{
"error": "INTERNAL_ERROR",
"message": "Something went wrong"
}{
"error": "UNAVAILABLE",
"message": "The data service is unavailable"
}Overview
This endpoint returns the order book over time for one exchange’s spot or perpetual swap market. For each bar and price row,bid_size and ask_size are the time-weighted average size resting on the bid and the ask, and bid_max and ask_max are the largest size a single sample of the bar saw. The values come from the one-second samples of the OKX, Binance and Bybit books Darvas records.
| Coverage | Details |
|---|---|
| Exchanges | okx (default), binance and bybit, one exchange per request |
| Markets | Spot and perpetual swap; other market types return 400 |
| Bar sizes | interval: 1m, 5m, 15m (default), 30m, 1H, 2H, 4H, 1D and 1W |
| Window | 120 bars ending at the open bar by default; at most 600 bars |
| Price rows | At most 400 rows; at least the stored band of 1 basis point for 1m and 5m, 5 for 15m and 30m, 10 above |
| Cell cap | 120,000 cells; when capped, limited is true and the newest whole bars are kept |
| MCP tool | get_crypto_order_book_heatmap on the data API MCP server |
Window, price range and rows
- Time window. Pass
start_timeandend_timeas ISO 8601 timestamps (2026-11-27T00:00:00Z), UTC dates (2026-11-27) or Unix milliseconds. Withoutend_time, the window ends at the end of the open bar; withoutstart_time, it starts 120 bars beforeend_time. A window over 600 bars, or anend_timethat is not afterstart_time, returns400. - Price range.
lowandhighbound the rows. Without them, the range is the window’s lowest candle low less half a percent and its highest candle high plus half a percent; send one and the other comes from the candles.lowmust be belowhigh, and a window without candles returns404unless both are sent. - Row height.
row_sizesets the smallest row height in price, such asrow_size=25for 25-dollar rows on BTC. Rows still grow until the range fits 400 of them, and the answer’srow_sizeis the height used (0when the window holds no book). - Cells. Each entry in
cellsgivestimeandtime_milliseconds(the bar’s start),price(the row’s low price, spanningrow_sizeabove it),bid_size,ask_size,bid_maxandask_max. Cells are sorted newest bar first, then lowest row first. - Persistent walls.
bid_wallsandask_wallsrank the five rows with the most size on average across every bar of the window (price,average_size). They show liquidity that stayed rather than one bar’s spike.
/crypto/order-book. For estimated liquidation clusters, see /crypto/liquidations/heatmap. For taker volume per price, see /crypto/footprint.
Examples
import os
from collections import defaultdict
import requests
headers = {"X-API-KEY": os.environ["DARVAS_API_KEY"]}
heatmap = requests.get(
"https://api.darvas.app/v1/crypto/order-book/heatmap",
headers=headers,
params={
"ticker": "BTC-USDT-SWAP",
"exchange": "okx",
"interval": "1H",
"start_time": "2026-11-27T00:00:00Z",
"end_time": "2026-11-28T00:00:00Z",
"row_size": 25,
},
).json()
print("Row size:", heatmap["row_size"], "Limited:", heatmap["limited"])
for wall in heatmap["bid_walls"]:
print("Persistent bid wall:", wall["price"], "average size:", wall["average_size"])
bid_by_bar = defaultdict(float)
for cell in heatmap["cells"]:
bid_by_bar[cell["time"]] += cell["bid_size"]
for time, size in sorted(bid_by_bar.items())[-5:]:
print(time, "resting bid size in range:", round(size, 2))
# Bybit spot BTCUSDT, 5-minute bars, last 120 bars between 95,000 and 100,000
curl -H "X-API-KEY: $DARVAS_API_KEY" \
"https://api.darvas.app/v1/crypto/order-book/heatmap?ticker=spot:BTCUSDT&exchange=bybit&interval=5m&low=95000&high=100000"
Authorizations
apiKeybearerKey
Query Parameters
The instrument id: BTC-USDT or BTC-USDT-SWAP on OKX, ETH-USDC-SWAP on Hyperliquid, BTC-USD on Coinbase, spot:BTCUSDT or perpetual:BTCUSDT on Binance and Bybit. A Binance or Bybit symbol such as BTCUSDT also works with market_type, spot without it. A Darvas aggregated pair is BASE-QUOTE or BASE-QUOTE-SWAP, such as BTC-USDT-SWAP, or BTC-ALLUSD for one combining its USD, USDT and USDC markets.
Maximum string length:
64Pattern:
^[A-Za-z0-9][A-Za-z0-9._:/-]{0,63}$Response
Read a crypto order book heatmap: one page.
The answer of GET /crypto/order-book/heatmap.