多空比
大户多空比。本页合并四个端点。
| 端点 | 来源 | 说明 |
|---|---|---|
GET /topLongShortPositionRatio | /futures/data/topLongShortPositionRatio | 按持仓量加权;symbol 通过查询参数传入。 |
GET /topLongShortAccountRatio | /futures/data/topLongShortAccountRatio | 按账户数加权;symbol 通过查询参数传入。 |
GET /long-short/position-ratio/{symbol} | platform Binance client | 按持仓量加权;symbol 通过路径参数传入。 |
GET /long-short/account-ratio/{symbol} | platform Binance client | 按账户数加权;symbol 通过路径参数传入。 |
除 symbol 的位置之外,四个端点的参数集合与响应结构完全相同。
通用参数
| 参数 | 位置 | 类型 | 必填 | 默认值 | 说明 |
|---|---|---|---|---|---|
symbol | query(top-… 系列)/ path(long-short/… 系列) | string | 是 | — | 大写永续合约符号。 |
period | query | string | 否 | 5m | 5m, 15m, 30m, 1h, 2h, 4h, 6h, 12h, 1d 之一。 |
limit | query | integer | 否 | 10 | Binance 最大 500。 |
响应 — 200 OK
数组(Binance 结构):
[
{
"symbol": "BTCUSDT",
"longShortRatio": "1.4321",
"longAccount": "0.5876",
"shortAccount": "0.4124",
"timestamp": 1745920800000
}
]
(longAccount/shortAccount 字段适用于 account-ratio 端点;position-ratio 端点返回 longPosition/shortPosition。)
错误
| HTTP | 触发原因 |
|---|---|
422 | 缺少 symbol(仅 /topLongShort* 变体)。 |
502 | 上游 Binance 请求失败。 |
示例
# 按持仓量加权,symbol 走查询参数
curl -s "https://api.pipai.org/topLongShortPositionRatio?symbol=BTCUSDT&period=1h&limit=24"
# 按账户数加权,symbol 走路径参数
curl -s "https://api.pipai.org/long-short/account-ratio/BTCUSDT?period=1h&limit=24"