主买/主卖成交量
接口描述
获取各个交易对的主买/主卖成交量。
HTTP请求
GET /futures/data/takerbuySellVol
请求权重
1
请求参数
| 名称 | 类型 | 是否必需 | 描述 |
|---|---|---|---|
| symbol | STRING | YES | 交易对 |
| period | ENUM | YES | "5m","15m","30m","1h","2h","4h","6h","12h","1d" |
| limit | INT | NO | 默认 30; 最大 500 |
| startTime | LONG | NO | 起始时间 |
| endTime | LONG | NO | 结束时间 |
响应示例
[
{
"buySellRatio": "0.1979", // 主买/主卖比例
"sellVol": "848.243", // 主卖成交量
"buyVol": "167.854", // 主买成交量
"timestamp": 1583127600000 // 时间戳
}
]
代码示例
cURL
curl -s "https://api-sepolia.ztdx.io/futures/data/takerlongshortRatio?symbol=BTCUSDT&period=1h&limit=5"
Python
import requests
base_url = "https://api.ztdx.io"
params = {"symbol": "BTCUSDT", "period": "1h", "limit": 5}
response = requests.get(f"{base_url}/futures/data/takerlongshortRatio", params=params)
for record in response.json():
print(f"Ratio={record['buySellRatio']} Buy={record['buyVol']} Sell={record['sellVol']}")