Depth
Order book snapshot for a symbol.
Endpoint
GET /v1/market/depth
Weight:
limit | Weight |
|---|---|
| ≤ 100 | 2 |
| 500 | 5 |
| 1000 | 10 |
Authentication: Public (optional signing).
Query parameters
| Name | Type | Mandatory | Description |
|---|---|---|---|
symbol | string | Yes | Trading pair, uppercase, e.g. BTCUSDT. |
limit | enum | No | Number of price levels per side. One of 5, 10, 20, 50, 100, 500, 1000. Default 100. |
Response
{
"lastUpdateId": 9823412115,
"bids": [
["67431.90", "0.4221"],
["67431.80", "1.0312"],
["67431.50", "0.8800"],
["67431.10", "2.5410"],
["67430.90", "0.0500"]
],
"asks": [
["67432.40", "0.3110"],
["67432.60", "0.7821"],
["67432.90", "1.4422"],
["67433.20", "0.2200"],
["67433.80", "3.1100"]
]
}
Response fields
| Field | Type | Description |
|---|---|---|
lastUpdateId | integer | Monotonic update id of the snapshot. Use this to align a REST snapshot with the WebSocket stream. |
bids | array | Array of [price, qty] pairs (both strings). Sorted descending by price (best bid first). |
asks | array | Array of [price, qty] pairs (both strings). Sorted ascending by price (best ask first). |
A qty of "0" is never returned in a snapshot — empty levels are omitted.
Errors
| HTTP | Code | Meaning |
|---|---|---|
| 400 | INVALID_PARAMETER | Missing symbol, or limit not in the allowed enum. |
| 400 | UNKNOWN_SYMBOL | Symbol does not exist. |
| 429 | RATE_LIMITED | Per-key request weight exceeded. |
Example
curl -s "https://api.pipai.io/v1/market/depth?symbol=BTCUSDT&limit=20"