Skip to main content

Get Orderbook

Query for orderbook depth data.

Covers: Spot / USDT contract / USDC contract / Inverse contract / Option

  • Contract: 1000-level of orderbook data
  • Spot: 1000-level of orderbook data
  • Option: 25-level of orderbook data
info
  • The response is in the snapshot format.
  • Retail Price Improvement (RPI) orders will not be included in the response message and will not be visible over API.

HTTP Request

GET /v5/market/orderbook

Request Parameters

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

Response Parameters

ParameterTypeComments
sstringSymbol name
barrayBid, buyer. Sorted by price in descending order
> b[0]stringBid price
> b[1]stringBid size
aarrayAsk, seller. Sorted by price in ascending order
> a[0]stringAsk price
> a[1]stringAsk size
tsintegerThe timestamp (ms) that the system generates the data
uintegerUpdate ID, is always in sequence
seqintegerCross sequence
  • You can use this field to compare different levels orderbook data, and for the smaller seq, then it means the data is generated earlier.
ctsintegerThe timestamp from the matching engine when this orderbook data is produced. It can be correlated with T from public trade channel

Request Example

GET /v5/market/orderbook?category=spot&symbol=BTCUSDT HTTP/1.1
Host: api-testnet.bybit.com

Response Example

{
"retCode": 0,
"retMsg": "OK",
"result": {
"s": "BTCUSDT",
"a": [
[
"65557.7",
"16.606555"
]
],
"b": [
[
"65485.47",
"47.081829"
]
],
"ts": 1716863719031,
"u": 230704,
"seq": 1432604333,
"cts": 1716863718905
},
"retExtInfo": {},
"time": 1716863719382
}