Skip to main content

Depth

Order book snapshot for a symbol.

Endpoint

GET /v1/market/depth

Weight:

limitWeight
≤ 1002
5005
100010

Authentication: Public (optional signing).

Query parameters

NameTypeMandatoryDescription
symbolstringYesTrading pair, uppercase, e.g. BTCUSDT.
limitenumNoNumber 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

FieldTypeDescription
lastUpdateIdintegerMonotonic update id of the snapshot. Use this to align a REST snapshot with the WebSocket stream.
bidsarrayArray of [price, qty] pairs (both strings). Sorted descending by price (best bid first).
asksarrayArray 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

HTTPCodeMeaning
400INVALID_PARAMETERMissing symbol, or limit not in the allowed enum.
400UNKNOWN_SYMBOLSymbol does not exist.
429RATE_LIMITEDPer-key request weight exceeded.

Example

curl -s "https://api.pipai.io/v1/market/depth?symbol=BTCUSDT&limit=20"