OrderbookService
Get Order Book
Retrieve a spot order book depth snapshot for a symbol. Bids are ordered best price first (descending), asks are ordered best price first (ascending), and each level is returned as a [price, quantity] tuple of decimal strings.
Request
curl --request GET \ \ --url 'https://api.testnet.polyester.com/v1/orderbook/BTC-USDT?depth=1' \ --header 'Accept: */*'
Responses
{
"asks": [
[
"61000.25",
"0.001"
]
],
"available": true,
"bids": [
[
"61000.25",
"0.001"
]
],
"bookSeq": "984321",
"symbol": "BTC-USDT",
"ts": 1735689600000
}Trading pair symbol, e.g. BTC-USDT.
Number of price levels per side. Defaults to 50 when omitted.
Best ask first; ascending price. When available is true, empty means no current liquidity; when it is false, always empty.
[["61000.25","0.001"]]True when the book is current and empty sides mean no liquidity. False while the book is being built or after it was invalidated: its levels are unknown, not empty. Request the snapshot again later.
trueBest bid first; descending price. When available is true, empty means no current liquidity; when it is false, always empty.
[["61000.25","0.001"]]Monotonic book sequence for this symbol.
984321Trading pair symbol, e.g. BTC-USDT.
BTC-USDTSnapshot timestamp as Unix epoch milliseconds; 0 while available is false.
1735689600000| Key | HTTP status | Connect code | Error | When |
|---|---|---|---|---|
| unauthenticated | 401 | unauthenticated | Unauthenticated | Authentication required. |
| permission-denied | 403 | permission_denied | Permission Denied | Permission denied. |
| invalid-argument | 400 | invalid_argument | Invalid Argument | Invalid argument. |
| not-found | 404 | not_found | Not Found | Not found. |
| unavailable | 503 | unavailable | Unavailable | Service unavailable. |