Skip to main content
Read a live crypto order book

Overview

Query the live Level 2 order book of any supported crypto spot or perpetual swap market. By default (exchange=darvas), Darvas reads every constituent exchange of a Darvas pair simultaneously and merges resting bids and asks price level by price level. Every quantity is normalized to the base asset, including OKX perpetual contracts converted from contract counts into coins.

Parameters

Pass ticker for every call and refine aggregation, depth, price grouping or payload size with optional query parameters.

Response fields

Top-of-book and spread

Top-of-book fields summarize execution cost at the touch across the chosen venue or merged book:
  • best_bid and best_ask: highest bid price and lowest ask price in the active book.
  • mid_price: arithmetic midpoint between best_bid and best_ask.
  • spread and spread_percent: best_ask - best_bid and the spread as a percentage of mid_price. On a merged darvas book, spread can turn negative when one exchange’s best bid sits above another exchange’s best ask.

Depth bands and liquidity walls

Depth summaries measure resting liquidity away from the mid price without scanning raw level arrays on the client:
  1. Percentage depth bands (depth). Four buckets covering 0.25%, 0.5%, 1% and 2% from mid_price. Each bucket reports bid_size and ask_size in base coins, bid_notional and ask_notional in quote currency and bid_share (null if both sides are empty). Raise the depth query parameter when wide bands need deeper exchange coverage.
  2. Resting liquidity walls (bid_walls, ask_walls). Lists up to the five largest price levels on each side with price and size, sorted by resting size so large support and resistance clusters stand out immediately.

Price level grouping and summary mode

  • Price bucketing (grouping). Bids round down and asks round up onto the requested step so grouped levels never cross each other. When omitted, native exchange ticks remain intact and the payload echoes grouping: null.
  • Lightweight polling (include_levels=false). Returns empty bids: [] and asks: [] arrays while preserving best_bid, best_ask, depth, bid_walls, ask_walls, bid_levels, ask_levels and sources.

Exchange sources and error handling

Source status codes

Every element in sources reports how each constituent exchange contributed to the response:
  • ok: Darvas read the live exchange order book and merged its levels into the output.
  • unavailable: the exchange request failed at query time, so the merged book excludes that venue without failing the entire call.
  • unsupported: the instrument trades on that exchange, but Darvas does not collect live L2 books from that venue.

HTTP status responses

  1. 400 Bad Request: invalid ticker, unsupported market type (such as dated futures or options), a venues filter on a non-darvas exchange, or a Darvas pair whose venues have no readable order books.
  2. 404 Not Found: a single-exchange book returned an empty bid or ask side at the moment of the request.
  3. 503 Service Unavailable: the requested single exchange failed, or every readable constituent exchange of a merged darvas pair failed simultaneously.

Examples

Merged book with price grouping

Read a 200-level aggregated BTC-USDT-SWAP book grouped onto 10-dollar ticks and inspect depth imbalance, venue status and resting walls.

Single-exchange summary without raw levels

Poll spread, depth bands and top walls across 400 levels of Binance BTCUSDT perpetual while omitting the raw level lists for minimal payload size.

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:darvas

okx, binance, bybit or hyperliquid, or darvas for every exchange the pair combines merged; darvas without it.

Available options:
darvas,
okx,
binance,
bybit,
hyperliquid
Maximum string length: 16
market_type
enum<string>

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

Available options:
spot,
swap
Maximum string length: 8
venues
string

With exchange darvas: combine only these of the pair's exchanges, comma-separated. Any other exchange refuses it.

Maximum string length: 528
Pattern: ^[a-z0-9][a-z0-9-]{0,31}(,[a-z0-9][a-z0-9-]{0,31}){0,15}$
depth
integer<int32>
default:50

Levels a side to read from each exchange and to answer (1 to 400; default 50).

Required range: 1 <= x <= 400
include_levels
enum<string>
default:true

false to answer the summary alone, without the bids and asks lists; true without it.

Available options:
true,
false
Maximum string length: 5
grouping
number<double>

A price step to merge levels onto, such as 10 for 10-dollar levels of BTC; each exchange's own prices without it.

Required range: x <= 1000000000000

Response

Read a live crypto order book: one page.

The answer of GET /crypto/order-book.

ticker
string
required

The instrument id of the book.

Maximum string length: 64
Pattern: ^[A-Za-z0-9][A-Za-z0-9._:/-]{0,63}$
Example:

"BTC-USDT-SWAP"

exchange
enum<string>
required

The exchange of the book, or darvas for the merged books.

Available options:
darvas,
okx,
binance,
bybit,
hyperliquid
Example:

"darvas"

market_type
enum<string>
required

The market of the book.

Available options:
spot,
swap
Example:

"swap"

as_of
string<date-time>
required

When the newest book read was built, in UTC.

Maximum string length: 30
Example:

"2026-11-28T12:00:00.180Z"

size_unit
enum<string>
required

The unit of every size: the base asset.

Available options:
base
Example:

"base"

grouping
number<double> | null
required

The price step levels were merged onto; null for each exchange's own prices.

Example:

null

best_bid
number<double> | null
required

The highest bid.

Example:

97810.4

best_ask
number<double> | null
required

The lowest ask.

Example:

97810.5

mid_price
number<double> | null
required

The middle of the best bid and ask.

Example:

97810.45

spread
number<double> | null
required

best_ask less best_bid; negative when merged exchanges cross.

Example:

0.1

spread_percent
number<double> | null
required

The spread as a percent of the mid; null at a zero mid.

Example:

0.000102

depth
object[]
required

Size resting within 0.25, 0.5, 1 and 2 percent of the mid.

Maximum array length: 4
bid_walls
object[]
required

The five largest bid levels.

Maximum array length: 5
ask_walls
object[]
required

The five largest ask levels.

Maximum array length: 5
bid_levels
integer<int64>
required

Bid levels in the answer's book.

Required range: 0 <= x <= 400
Example:

50

ask_levels
integer<int64>
required

Ask levels in the answer's book.

Required range: 0 <= x <= 400
Example:

50

sources
object[]
required

Each exchange read, with its status.

Maximum array length: 16
bids
object[]
required

The bids, best first; empty with include_levels=false.

Maximum array length: 400
asks
object[]
required

The asks, best first; empty with include_levels=false.

Maximum array length: 400
constituents
string[]

With exchange darvas: every exchange the pair's book combines. Absent for one exchange.

Maximum array length: 16
Maximum string length: 32
Pattern: ^[a-z0-9][a-z0-9-]{0,31}$
Example:
venues
string[] | null

With exchange darvas: the exchanges the book kept when venues narrowed them, null when all are. Absent for one exchange.

Maximum array length: 16
Maximum string length: 32
Pattern: ^[a-z0-9][a-z0-9-]{0,31}$
Example: