GET /v1/orderbook
Returns real-time L2 orderbook data for a specific symbol on a specific exchange. Includes computed spread and mid-price.Query Parameters
Trading pair. Base assets (e.g.,
BTC, ETH, DOGE, AVAX) are auto-appended with USDT. Full pair names also accepted (BTCUSDT, BTC-USDT-SWAP, BTC_USDT).Exchange ID. Must be a registered exchange with orderbook support. See V2 Exchanges for the full list.
Number of price levels per side (bids/asks).
Example
Response Fields
Exchange that provided the data.
Full symbol as sent to the exchange.
Buy orders sorted by price descending (best bid first).
Sell orders sorted by price ascending (best ask first). Same structure as bids.
Bid-ask spread as a percentage of mid price:
(best_ask - best_bid) / mid_price × 100. Returns 0 if mid price is 0.Midpoint price:
(best_bid + best_ask) / 2. Returns 0 if either side is empty.Error Responses
| Status | Condition |
|---|---|
| 404 | Exchange not found in registry |
| 400 | Exchange doesn’t support orderbook data |
| 502 | Upstream exchange API error |
Symbol Auto-Detection
The endpoint intelligently appendsUSDT when the input looks like a base asset:
| Input | Resolved | Rule |
|---|---|---|
BTC | BTCUSDT | No pair suffix detected |
DOGE | DOGEUSDT | Works for any length |
BTCUSDT | BTCUSDT | Already has USDT |
BTCUSD | BTCUSD | Has USD suffix |
BTC-USDT-SWAP | BTC-USDT-SWAP | OKX format preserved |
BTC_USDT | BTC_USDT | Gate format preserved |
Field Reference
| Field | Type | Description | Granularity | Example |
|---|---|---|---|---|
exchange | string | Exchange that provided the orderbook snapshot | — | "binance" |
symbol | string | Full symbol as sent to the exchange | — | "BTCUSDT" |
bids[].price | number | Bid price level in USD (descending order) | Real-time snapshot | 71000.00 |
bids[].quantity | number | Order quantity at this bid level (base asset) | Real-time snapshot | 1.500 |
asks[].price | number | Ask price level in USD (ascending order) | Real-time snapshot | 71001.00 |
asks[].quantity | number | Order quantity at this ask level (base asset) | Real-time snapshot | 1.200 |
spread_pct | number | Bid-ask spread as % of mid price | Computed per request | 0.0014 |
mid_price | number | Midpoint: (best_bid + best_ask) / 2 | Computed per request | 71000.50 |

