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.
| Time | Status | User Agent | |
|---|---|---|---|
Retrieving recent requests… | |||
Available on these API plans: Standard Professional Enterprise
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 ResponsePass
start_timeandend_timeas timestamps in milliseconds; the returned snapshot timedata[].0is 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 PairsThis 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-USDTon OKX andBTC_USDTon Gate, and on Kraken BTC is written asXBT/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.
| Field | Type | Always Returned | Description |
|---|---|---|---|
code | string | Yes | Business status code; "0" means success |
msg | string | No | Result message |
data | array of array | Yes | Array of order book snapshots; each snapshot is a positional array [time, bid levels, ask levels] |
data[].0 | integer | Yes | Position 0: snapshot time, Unix timestamp in seconds (UTC), not milliseconds |
data[].1 | array of array | Yes | Position 1: list of bid price levels (bids); each price level is [price, quantity] |
data[].1[].0 | number | Yes | Bid price level, position 0: price, in the quote currency (e.g., USDT) |
data[].1[].1 | number | Yes | Bid 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[].2 | array of array | Yes | Position 2: list of ask price levels (asks); each price level is [price, quantity] |
data[].2[].0 | number | Yes | Ask price level, position 0: price, in the quote currency (e.g., USDT) |
data[].2[].1 | number | Yes | Ask 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 Plan | Access |
|---|---|
| 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.
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
| Scenario | Description |
|---|---|
| Draw a Spot Order Book Heatmap | Plot 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 Walls | Find single prices with an especially large number of orders as a reference for potential support or resistance. |
| Watch Orders Being Pulled and Replaced | Compare adjacent snapshots to spot large orders that suddenly appear or are pulled, and judge whether there are spoof orders. |
| Custom Price Ranges | Use 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
| Endpoint | How 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 Book | Large 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 Pairs | Look 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.
