订单簿深度
获取指定交易对的买卖盘深度数据。
接口信息
- 方法:
GET - 路径:
/api/v1/stock/open-api/depth
请求参数
| 参数 | 类型 | 必填 | 说明 |
|---|---|---|---|
| symbol | string | 是 | 交易对,如XSM |
| limit | int | 否 | 返回档位数量,默认20,最大400 |
请求示例
GET /api/v1/stock/open-api/depth?symbol=XSM&limit=20
响应字段
| 字段 | 类型 | 说明 |
|---|---|---|
| code | int | 状态码 |
| msg | string | 返回消息 |
| data.symbol | string | 交易对 |
| data.bids | array | 买盘,[[价格, 数量], ...] |
| data.asks | array | 卖盘,[[价格, 数量], ...] |
| data.timestamp | int64 | 时间戳 |
说明
bids买盘按价格从高到低排序asks卖盘按价格从低到高排序
响应示例
{
"code": 0,
"msg": "success",
"data": {
"symbol": "XSM",
"bids": [
["185.50", "1000"],
["185.40", "500"]
],
"asks": [
["185.60", "800"],
["185.70", "1200"]
],
"timestamp": 1705737600000
}
}