Order Book Depth
Description
Returns a price-aggregated snapshot of the live in-memory order book. Use last_update_id to sequence diffs received over a future WebSocket depth channel.
HTTP Request
GET /spot/depth (public — no auth required)
Weight
0 — public market-data endpoints have no per-IP weight limit today (MVP).
Request Parameters
| Name | Type | Required | Description |
|---|---|---|---|
symbol | STRING | YES | Market id (e.g. DFUSDT). Case-sensitive. See GET /spot/markets. |
limit | NUMBER | NO | Number of price levels per side. Default 50, range 1–1000. Clamped server-side; no error on out-of-range values. |
Response Example
200 OK
{
"symbol": "DFUSDT",
"last_update_id": 12345,
"bids": [
["0.5000", "100"],
["0.4999", "200"]
],
"asks": [
["0.5001", "150"],
["0.5002", "180"]
]
}
| Field | Notes |
|---|---|
last_update_id | Monotonic engine counter, bumped on every book mutation (place / cancel / fill). Use this to detect gaps when stitching WebSocket depth diffs. |
bids | Descending by price (best bid first). Each entry is [price, total_qty_at_level] — both strings. |
asks | Ascending by price (best ask first). Same [price, qty] format. |
Quantity at each level is the sum of all resting orders at that price — individual order ids are not exposed.
Error Responses
| HTTP | error |
|---|---|
503 | spot trading disabled (server has SPOT_TRADING_ENABLED=false) |
503 | ENGINE_BUSY |
503 | ENGINE_RESTARTING |
Full list: Error Codes.
Code Examples
cURL
curl -s "https://api-sepolia.p99.world/api/v1/spot/depth?symbol=DFUSDT&limit=10"
Python
import requests
BASE = "https://api-sepolia.p99.world/api/v1"
book = requests.get(f"{BASE}/spot/depth", params={"symbol": "DFUSDT", "limit": 10}).json()
print("update_id:", book["last_update_id"])
print("best bid:", book["bids"][0] if book["bids"] else "empty")
print("best ask:", book["asks"][0] if book["asks"] else "empty")