Order Book Depth
Provides order book depth data query for trading pairs, supports price precision aggregation and level limits.
Get Order Book Depth
Get order book depth data for a specified trading pair, supports price precision aggregation and level limits.
API Information
- Method:
GET - Path:
/api/v1/depth
Request Parameters
| Parameter | Location | Type | Required | Description |
|---|---|---|---|---|
| symbol | query | string | Yes | Trading pair, e.g. BTC_USDT |
| precision | query | integer | No | Price precision (decimal places), returns original precision if not specified |
| limit | query | integer | No | Number of levels, default 100, max 5000 |
| with_id | query | boolean | No | Whether to return sequence number |
Request Example
GET /api/v1/depth?symbol=BTC_USDT&limit=100&with_id=true
Response Fields
| Field | Type | Description |
|---|---|---|
| code | integer | Error code, 0 indicates success |
| message | string | Error message |
| data | object | Depth data |
| data.symbol | string | Trading pair |
| data.asks | array | Ask levels, format [[price, qty], ...] |
| data.bids | array | Bid levels, format [[price, qty], ...] |
| data.id | integer | Sequence number (returned when with_id=true) |
| data.timestamp | integer | Timestamp (milliseconds) |
Response Example
{
"code": 0,
"message": "success",
"data": {
"symbol": "BTC_USDT",
"asks": [
["42166.00", "0.125"],
["42167.00", "0.250"]
],
"bids": [
["42165.00", "0.310"],
["42164.00", "0.500"]
],
"id": 12345,
"timestamp": 1768051394008
}
}
Error Response
| Status Code | code | Description |
|---|---|---|
| 400 | 4000 | Parameter error, e.g. symbol is required |
| 503 | - | Service unavailable |
{
"code": 4000,
"data": null,
"message": "symbol is required"
}
Get Sync Status
Get depth synchronization status for all trading pairs.
API Information
- Method:
GET - Path:
/api/v1/depth/status
Response Fields
| Field | Type | Description |
|---|---|---|
| code | integer | Error code, 0 indicates success |
| message | string | Error message |
| data | object | Sync status data |
| data.symbols | object | Trading pair sync status mapping (key is trading pair, value is status string) |
Response Example
{
"code": 0,
"message": "success",
"data": {
"symbols": {
"BTC_USDT": "synced",
"ETH_USDT": "syncing"
}
}
}