Spot Order Book History (Heatmap)

Get historical order book snapshots for a spot trading pair; each snapshot lists the order quantity at every bid and ask price level. Useful for drawing a spot order book heatmap and watching where order walls are and how they change.

Recent Requests
Log in to see full request history
TimeStatusUser Agent
Retrieving recent requests…
LoadingLoading…

Available on these API plans: Standard Professional Enterprise

Update frequencyReal-time

Response Data

data is an array; each element is an order book snapshot at one point in time. A snapshot is a positional array without field names, read by position: [0] is the snapshot time (Unix seconds), [1] is the list of bid price levels, and [2] is the list of ask price levels; each price level is in turn [price, quantity]. In the table below, data[].0 means the first position of the snapshot, data[].1[].0 means the price of a bid price level, and so on.

⚠️

Time Units: Milliseconds in the Request, Seconds in the Response

Pass start_time and end_time as timestamps in milliseconds; the returned snapshot time data[].0 is a Unix timestamp in seconds, e.g., 1792458000. In languages such as JavaScript that handle time in milliseconds, multiply it by 1000 before converting it to a date.

📘

Supported Exchanges and Pairs

This endpoint supports only spot trading pairs quoted in USDT or USD. Binance supports all available coins; Gate, Bitget, OKX, Coinbase, Bitfinex and Kraken support only BTC and ETH. Exchanges write trading pairs differently, e.g., BTC-USDT on OKX and BTC_USDT on Gate, and on Kraken BTC is written as XBT/USD. Even for pairs in the list, data is not guaranteed at every historical point in time.

200 · application/json · See the response example in the right panel.

FieldTypeAlways ReturnedDescription
codestringYesBusiness status code; "0" means success
msgstringNoResult message
dataarray of arrayYesArray of order book snapshots; each snapshot is a positional array [time, bid levels, ask levels]
data[].0integerYesPosition 0: snapshot time, Unix timestamp in seconds (UTC), not milliseconds
data[].1array of arrayYesPosition 1: list of bid price levels (bids); each price level is [price, quantity]
data[].1[].0numberYesBid price level, position 0: price, in the quote currency (e.g., USDT)
data[].1[].1numberYesBid price level, position 1: order quantity at that price, the raw quantity from the exchange (for spot, the number of coins, e.g., BTC), not a dollar amount
data[].2array of arrayYesPosition 2: list of ask price levels (asks); each price level is [price, quantity]
data[].2[].0numberYesAsk price level, position 0: price, in the quote currency (e.g., USDT)
data[].2[].1numberYesAsk price level, position 1: order quantity at that price, the raw quantity from the exchange (for spot, the number of coins, e.g., BTC), not a dollar amount

The data volume is large: for Binance BTCUSDT, each snapshot has about 415–756 price levels on each of the bid and ask sides, and a response with 3 snapshots is about 57 KB. Control limit and the time range as needed.

Price levels are not guaranteed to be returned in price order. In the example on the right (which keeps only 2 price levels per side), both the bids and the asks are listed starting from the lowest price: the bids start at 40600 and the asks at 81730. When you need to find the best bid and best ask or analyze by price, sort them by price yourself first.

API Plans

Only the API plans marked Yes in the table below can call this endpoint. For the price of each plan, see API Plans.

API PlanAccess
Hobbyist❌ No
Startup❌ No
Standard✅ Yes
Professional✅ Yes
Enterprise✅ Yes

Use This Endpoint with AI

Pick a task and click Open in ChatGPT or Open in Claude: the AI reads this page first and then gives you the result. You can also click Copy and paste the full prompt into the AI tool you use.

Plot a heatmap in Python
Have AI write code that turns spot order book snapshots into an order book heatmap.
Find order walls
Have AI write code that finds the price levels with the most orders in the latest snapshot.
Understand this endpoint
Have AI explain the positional arrays and parameters in plain language.

This endpoint provides data through the REST API. Use the prompts above to have AI write the request code. For the tools available through MCP, see CoinGlass MCP.

Use Cases

ScenarioDescription
Draw a Spot Order Book HeatmapPlot order quantity as color intensity by time and price to see at a glance where order walls are and how long they last.
Identify Order WallsFind single prices with an especially large number of orders as a reference for potential support or resistance.
Watch Orders Being Pulled and ReplacedCompare adjacent snapshots to spot large orders that suddenly appear or are pulled, and judge whether there are spoof orders.
Custom Price RangesUse the price-level details to view the order distribution within whatever price range you need, without being limited to the range values of “Spot Pair Order Book Depth History (±Range)”.

Related Endpoints

EndpointHow It Differs
Spot Pair Order Book Depth History (±Range)Spot bid and ask orders summed by price range, with a small data volume
Spot Large Order BookLarge limit orders currently in the spot order book
Order Book History (Heatmap)Futures version of the same data, with different supported exchanges
Spot Supported Exchanges and PairsLook up valid values for exchange and symbol

FAQ

Why is the returned time 10 digits long?

The snapshot time data[].0 is a Unix timestamp in seconds, while the request parameters start_time and end_time use milliseconds. When handling time in milliseconds, multiply it by 1000 first.

Which exchanges and pairs can I query?

Only spot trading pairs quoted in USDT or USD are supported: Binance supports all available coins, while Gate, Bitget, OKX, Coinbase, Bitfinex and Kraken support only BTC and ETH. When you query an unsupported exchange, the endpoint returns the error message Exchange not supported.

What is the most I can query at once?

The maximum limit is 100, and larger values are treated as 100. When both start_time and end_time are passed, the number returned is determined by the time range: with limit=2 and a 3-hour time range (interval=1h), 3 snapshots were returned. Longest history you can query: 3 days for 1m, 15 days for 5m, and 150 days for the other intervals. Each snapshot contains hundreds of price levels, so the data volume is large; narrow the range as needed.

What units are the price and quantity in?

The price is in the quote currency (e.g., USDT); the quantity is the number of coins in orders at that price (e.g., BTC), not a dollar amount. If you need an amount, you can estimate it by multiplying the price by the quantity.

Learn More: Spot Order Book Heatmap

How Do I Read an Order Book Heatmap?

The horizontal axis is time and the vertical axis is price; a brighter color means more orders at that price. A bright band that persists is usually a large order wall, and price may meet support or resistance as it approaches.

Do Order Walls Always Work?

Not necessarily. Orders can be canceled at any time, and some large orders are placed only to influence market sentiment and are pulled as price approaches. Watching whether an order wall persists and whether it gets filled as price approaches is more reliable than looking at a single snapshot.

How Is the Spot Heatmap Different from the Futures Heatmap?

The spot heatmap shows orders to buy and sell the coin itself, while the futures heatmap (see Order Book History (Heatmap)) shows orders for futures contracts; the two also support different exchanges. Comparing the two shows whether an order wall appears on spot, on futures or on both.

Query Params
string
required
Defaults to Binance

Spot exchange name; required, e.g., Binance, OKX. This endpoint supports only some exchanges; see the “Supported Exchanges and Pairs” note on this page.

string
required
Defaults to BTCUSDT

Spot trading pair symbol; required, e.g., BTCUSDT. Exchanges write it differently, e.g., BTC-USDT on OKX and BTC-USD on Coinbase; for the pairs you can query, see the Spot Supported Exchanges and Pairs endpoint.

string
required
Defaults to 1d

Snapshot interval; required, e.g., 1h. Options: 1m, 3m, 5m, 15m, 30m, 1h, 2h, 4h, 6h, 8h, 12h, 1d.

int32
≤ 100
Defaults to 100

Number of snapshots to return; default 100, maximum 100; values above 100 are treated as 100. When both start_time and end_time are passed, the number returned is determined by the time range and does not necessarily equal limit. Longest history you can query: 3 days for 1m, 15 days for 5m, and 150 days for the other intervals.

int64

Start time, timestamp in milliseconds (UTC), e.g., 1792458000000. Note that the returned snapshot times are timestamps in seconds.

int64

End time, timestamp in milliseconds (UTC), e.g., 1792468800000. If omitted, the current time is used as the end point and the range is calculated backward from interval and limit.

Response

Language
Credentials
Header
LoadingLoading…
Response
Click Try It! to start a request and see the response here! Or choose an example:
application/json