Skip to main content

Get Orderbook

Query for orderbook depth data.

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

  • Contract: 500-level of orderbook data
  • Spot: 200-level of orderbook data
  • Option: 25-level of orderbook data
info

The response is in the snapshot format.

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. 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 contract, it is corresponding to u in the wss 500-level orderbook
  • For spot, it is corresponding to u in the wss 200-level orderbook
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.
  • Option does not have this field currently
  • ctsintegerThe timestamp from the match engine when this orderbook data is produced. It can be correlated with T from public trade channel. linear, inverse, spot have this field

    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
    }