Order Book Depth
Get the buy/sell order book depth data for a specified trading pair.
Interface Information
- Method:
GET - Path:
/api/v1/stock/open-api/depth
Request Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| symbol | string | Yes | Trading pair, e.g., XSM |
| limit | int | No | Number of levels to return, default 20, max 400 |
| with_id | bool | No | Whether to return the sequence ID for incremental sync validation, default false |
Request Example
GET /api/v1/stock/open-api/depth?symbol=XSM&limit=20&with_id=true
Response Fields
| Field | Type | Description |
|---|---|---|
| code | int | Status code |
| msg | string | Status message |
| data.symbol | string | Trading pair |
| data.bids | array | Bids, [[price, quantity], ...] |
| data.asks | array | Asks, [[price, quantity], ...] |
| data.timestamp | int64 | Timestamp |
| data.id | int64 | Sequence ID, only returned when with_id=true |
Note
bidsare sorted from highest to lowest priceasksare sorted from lowest to highest priceidcan be used for incremental depth WebSocket sync validation
Response Example
{
"code": 0,
"msg": "success",
"data": {
"symbol": "XSM",
"bids": [
["185.50", "1000"],
["185.40", "500"]
],
"asks": [
["185.60", "800"],
["185.70", "1200"]
],
"timestamp": 1705737600000,
"id": 123456789
}
}