Order Book
Get order book data.
info
The response is in the snapshot format.
HTTP Request
GET /derivatives/v3/public/order-book/L2
Request Parameters
Parameter | Required | Type | Comments |
---|---|---|---|
category | false | string | Product type. linear ,inverse ,option . Default: linear , but in the response category shows "" |
symbol | true | string | Symbol name. category is required when query an option symbol |
limit | false | integer | Limit for data size per page. [1 , 500 ]. Default: 25 . option has 25 only |
Response Parameters
Parameter | Type | Comments |
---|---|---|
s | string | Symbol name |
b | string | Bid. Order by price asc |
a | string | Ask. Order by price asc |
ts | integer | The timestamp(ms) that system generates the data |
u | integer | Update id, is always in sequence |
Request Example
- linear
- option
GET /derivatives/v3/public/order-book/L2?category=linear&symbol=BTCPERP&limit=2 HTTP/1.1
Host: api.bybit.com
GET /derivatives/v3/public/order-book/L2?category=option&symbol=BTC-30DEC22-19000-C&limit=25 HTTP/1.1
Host: api.bybit.com
Response Example
- linear
- option
{
"retCode": 0,
"retMsg": "OK",
"result": {
"s": "BTCPERP",
"b": [
[
"16818", // price
"0.156" // qty
],
[
"16818.5",
"0.183"
]
],
"a": [
[
"16819",
"0.454"
],
[
"16819.5",
"0.054"
]
],
"ts": 1671969122791,
"u": 6404345
},
"retExtInfo": {},
"time": 1671969122869
}
{
"retCode": 0,
"retMsg": "OK",
"result": {
"s": "BTC-24FEB23-21000-P",
"b": [
[
"3295", //price
"42.6" //qty
],
[
"4050",
"42.6"
],
[
"4060",
"42.6"
],
[
"4090",
"38.8"
]
],
"a": [
[
"4300",
"0.5"
],
[
"4320",
"0.5"
],
[
"4340",
"4.2"
],
[
"5100",
"4.3"
]
],
"u": 1421001809,
"ts": 1673076117208
},
"retExtInfo": {},
"time": 1673076197247
}