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
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

  • 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",
    "b": [
    [
    "62710.2",
    "5.52"
    ]
    ],
    "a": [
    [
    "62710.3",
    "0.01"
    ]
    ],
    "ts": 1709199771584,
    "u": 243781,
    "seq": 3887177875
    },
    "retExtInfo": {},
    "time": 1709199771643
    }