Skip to main content

Get Orderbook

Query for orderbook depth data.

Covers: Spot / USDT perpetual / Inverse contract

  • future: 500-level of orderbook data
  • Spot: 200-level of orderbook data
tip

The response is in the snapshot format.

HTTP Request

GET /cloud/trade/v3/market/orderbook

Request Parameters

ParameterRequiredTypeComments
categorytruestringProduct type. spot, linear, inverse
symboltruestringSymbol name
limitfalseintegerLimit size for each bid and ask
  • spot: [1, 200]. Default: 1.
  • linear&inverse: [1, 500]. Default: 25.

Response Parameters

ParameterTypeComments
sstringSymbol name
barrayBid, buyer. Sort by price desc
> b[0]stringBid price
> b[1]stringBid size
aarrayAsk, seller. Order by price asc
> a[0]stringAsk price
> a[1]stringAsk size
tsintegerThe timestamp (ms) that the system generates the data
uintegerUpdate ID, is always in sequence
  • For future, it is corresponding to u in the wss 500-level orderbook
  • For spot, it is corresponding to u in the wss 200-level orderbook

Request Example

GET /cloud/trade/v3/market/orderbook?category=linear&symbol=BTCUSDT HTTP/1.1
Host: openapi-testnet.zoomex.com

Response Example

{
"retCode": 0,
"retMsg": "OK",
"result": {
"s": "BTCUSDT",
"a": [
[
"16638.64",
"0.008479"
]
],
"b": [
[
"16638.27",
"0.305749"
]
],
"ts": 1672765737733,
"u": 5277055
},
"retExtInfo": {},
"time": 1672765737734
}