Skip to main content
Read order book imbalance history

Overview

This endpoint returns, per bar, the resting bid and ask depth within each range of the book’s mid, its imbalance from -1 to 1, and the slippage a market order of each dollar size would have paid. It reads the books Darvas records every second on OKX, Binance and Bybit spot and perpetual markets, oldest bar first. A range is complete only where the stored book reached it on both sides; summary gives each range’s mean and newest imbalance over the complete bars.

Example

Authorizations

X-API-KEY
string
header
required

A Darvas data API key: dvk_ and 43 characters.

Query Parameters

ticker
string
required

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: 64
Pattern: ^[A-Za-z0-9][A-Za-z0-9._:/-]{0,63}$
exchange
enum<string>
default:okx

The exchange of the stored book: okx, binance or bybit; okx without it.

Available options:
okx,
binance,
bybit
market_type
enum<string>

spot or swap; without it, the market the ticker implies.

Available options:
spot,
swap
Maximum string length: 8
interval
enum<string>
default:1H

The bar: 1m, 5m, 15m, 30m, 1H, 2H, 4H, 1D or 1W; 1H without it.

Available options:
1m,
5m,
15m,
30m,
1H,
2H,
4H,
1D,
1W
start_time
string

The first bar: ISO 8601, a date or Unix milliseconds; 168 bars before end_time without it.

Maximum string length: 40
Pattern: ^[0-9TZ:.+-]{8,40}$
end_time
string

The end of the last bar, in the same forms; now without it.

Maximum string length: 40
Pattern: ^[0-9TZ:.+-]{8,40}$
ranges_pct
string

Up to 6 comma-separated ranges around the mid, in percent, from 0.05 to 10; 0.5,1,2,5 without it.

Maximum string length: 60
Pattern: ^[0-9.]+(,[0-9.]+){0,5}$
order_sizes_usd
string

Up to 4 comma-separated market order sizes, in US dollars, from 100 to 1,000,000,000; 100000,1000000 without it.

Maximum string length: 60
Pattern: ^[0-9.]+(,[0-9.]+){0,3}$

Response

Read order book imbalance history: one page.

The answer of GET /crypto/order-book/imbalance-history.

ticker
string
required

The book's instrument.

Maximum string length: 64
Pattern: ^[^\x00-\x08\x0b\x0c\x0e-\x1f]*$
Example:

"BTC-USDT"

exchange
enum<string>
required

The book's exchange.

Available options:
okx,
binance,
bybit
Example:

"okx"

market_type
enum<string>
required

The book's market.

Available options:
spot,
swap
Example:

"spot"

interval
enum<string>
required

The book bars.

Available options:
1m,
5m,
15m,
30m,
1H,
2H,
4H,
1D,
1W
Example:

"1H"

band_tier
enum<string>
required

The stored band tier the bars read.

Available options:
1m,
15m,
1h
Example:

"1h"

start_time
string<date-time>
required

The first book bar's open.

Maximum string length: 40
Example:

"2026-11-23T12:00:00.000Z"

end_time
string<date-time>
required

The last book bar's close.

Maximum string length: 40
Example:

"2026-11-30T12:00:00.000Z"

as_of
string<date-time>
required

When Darvas built the imbalance answer.

Maximum string length: 40
Example:

"2026-11-30T12:00:00.000Z"

size_unit
enum<string>
required

The unit of the _base sizes.

Available options:
base
Example:

"base"

ranges_pct
number<double>[]
required

The ranges around the mid, ascending.

Maximum array length: 6
Example:
order_sizes_usd
number<double>[]
required

The market order sizes, ascending.

Maximum array length: 4
Example:
summary
object[]
required

Each range's imbalance over the bars.

Maximum array length: 6
bars
object[]
required

The book bars, oldest first.

Maximum array length: 1000
methodology
object
required

How depth, imbalance and slippage are read from the stored book.

Example: