Skip to main content

Get Order Book

Query the full order book snapshot (bid/ask depth) for prediction outcome tokens. Useful for estimating price impact before placing a large order.

info
  • Maximum 20 token IDs per request
  • Returns all price levels with available quantity
  • For current best price only, use Get Token Price instead

HTTP Request

POST/v5/alpha/prediction/order-book

Request Parameters

ParameterRequiredTypeComments
tokenIdstruearrayList of outcome token IDs. Maximum 20

Response Parameters

ParameterTypeComments
tokenIdstringOutcome token ID
bidsarrayBuy orders sorted by price descending
> pricestringBid price
> sizestringAvailable quantity (shares)
asksarraySell orders sorted by price ascending
> pricestringAsk price
> sizestringAvailable quantity (shares)

Request Example

POST /v5/alpha/prediction/order-book HTTP/1.1
Host: api.bybit.com
X-BAPI-SIGN: XXXXXX
X-BAPI-API-KEY: xxxxxxxxxxxxxxxxxx
X-BAPI-TIMESTAMP: 1704067200000
X-BAPI-RECV-WINDOW: 5000
Content-Type: application/json

{
"tokenIds": ["token_yes_123"]
}

Response Example

{
"retCode": 0,
"retMsg": "OK",
"result": [
{
"tokenId": "token_yes_123",
"bids": [
{"price": "0.64", "size": "1000"},
{"price": "0.63", "size": "2500"}
],
"asks": [
{"price": "0.66", "size": "800"},
{"price": "0.67", "size": "1500"}
]
}
],
"retExtInfo": {},
"time": 1704067200000
}