Skip to main content

Order Book

Returns a live order book snapshot — bids and asks for a symbol.

MethodGET
Path/v5/market/orderbook
AuthAuthenticated.

For real-time updates without polling, use the Depth WebSocket.

Query parameters

ParameterTypeRequiredDescription
categorystringYeslinear.
symbolstringYesSymbol (e.g. BTCUSDT).
limitintegerNoNumber of levels per side.

Request

from reference_client import sign_request, BASE_URL
import requests

headers, path = sign_request(
"GET",
"/v5/market/orderbook",
{"category": "linear", "symbol": "BTCUSDT", "limit": 10},
)
r = requests.get(BASE_URL + path, headers=headers)
print(r.json())

Response

{
"retCode": 0,
"retMsg": "OK",
"result": {
"s": "BTCUSDT",
"b": [
["109739.9", "8.007"],
["109739.8", "0.824"],
["109739.7", "0.12"]
],
"a": [
["109740", "0.355"],
["109740.5", "0.001"],
["109742.6", "0.001"]
],
"ts": 1756460692358,
"u": 368327,
"seq": 448248061021
}
}

Response parameters

FieldTypeDescription
sstringSymbol.
barrayBids — sorted descending. Each entry is [price, quantity], both strings.
aarrayAsks — sorted ascending. Each entry is [price, quantity].
tsintegerSnapshot timestamp (Unix ms).
uintegerUpdate ID. Increments with each book change.
seqintegerSequence number — use to detect missed updates between snapshots.