orderbook.v1.OrderbookService
GetOrderBook
Retrieve a spot order book depth snapshot for a symbol. Supports selectable depth per side and returns best bid/ask levels.
Request
curl --request POST \ \
--url 'https://api.testnet.polyester.com/orderbook.v1.OrderbookService/GetOrderBook' \
--header 'Content-Type: application/json' \
--header 'Connect-Protocol-Version: 1' \
--data '{
"depth": "DEPTH_1",
"symbolId": 1
}'Responses
{
"asks": [
{
"priceTicks": "61000250000000",
"qtyScaled": "100000"
}
],
"available": true,
"bids": [
{
"priceTicks": "61000250000000",
"qtyScaled": "100000"
}
],
"bookSeq": "984321",
"symbolId": 1,
"ts": "2025-01-01T00:00:00Z"
}orderbook.v1.GetOrderBookRequestorderbook.v1.GetOrderBookResponseStable numeric pair ID from GetSpotConfig.
Requested depth per side (number of price levels). Default is 50.
Numeric symbol identifier (client resolves to symbol string).
Monotonic book sequence for this symbol.
Price in quote units scaled by 1e9.
Quantity scaled by the pair's base_quantity_scale from GetSpotConfig.
Price in quote units scaled by 1e9.
Quantity scaled by the pair's base_quantity_scale from GetSpotConfig.
Timestamp associated with this snapshot (best-effort).
True when the book is current: bids and asks are its levels, and empty sides mean no liquidity. False while the book is being built or after it was invalidated: its levels are unknown, not empty, and the response carries none. Request the snapshot again later.
| Key | HTTP status | Connect code | Error | When |
|---|---|---|---|---|
| internal-error | 500 | internal | Internal Error | An internal error occurred. |
| invalid-depth | 400 | invalid_argument | Invalid Depth | Depth must be one of: 1, 5, 10, 20, 50, 100, 200, 500, 1000. |
| unavailable | 503 | unavailable | Service Unavailable | The orderbook service is temporarily unavailable. |
| unknown-symbol | 404 | not_found | Unknown Symbol | The requested trading pair symbol was not found. |
| validation-error | 400 | invalid_argument | Validation Error | Request validation failed. |