GET可用
单个币种的多空比
自采数据层:单个币种的多空比
GET
/api/sd/ls请求
查询参数
| 名称 | 类型 | 必填 | 默认值 | 可选值 | 说明 |
|---|---|---|---|---|---|
| coin | string | 必填 | — | — | 币种代码;缺失时返回 400。别名:`base`。 示例: BTC |
请求示例
curl -s "https://www.coinboss.com/api/sd/ls?coin=BTC"响应字段
字段表根据真实响应生成,因此所列内容与端点实际返回的完全一致。路径中 a[] 表示数组元素,{*} 表示以动态名称(如币种或交易所)为键的对象。
| 字段 | 类型 | 单位 | 说明 |
|---|---|---|---|
| success | boolean | — | 请求成功时为 true。失败时响应体为 `{ success: false, code, error, request_id }`。 |
| coin | string | — | 币种代码,大写(例如 BTC)。 |
| now | number | ms | 响应生成时的服务器时间。 |
| account | object | — | 净多头账户与净空头账户各占全部账户的比例。 |
| account.long_pct | number | % | 多头占比。 |
| account.short_pct | number | % | 空头占比。 |
| account.ratio | number | — | 多头占比除以空头占比(1 = 多空均衡)。 |
| account.n_exchanges | number | — | 参与计算的交易所数量。 |
| account.by_exchange | array | — | 各交易所明细。 |
| account.by_exchange[] | object | — | 各交易所明细。 |
| account.by_exchange[].exchange | string | — | 交易所 ID,小写(例如 `binance`)。 |
| account.by_exchange[].symbol | string | — | 经 CoinBoss 归一化的合约代码(例如 BTCUSDT)。 |
| account.by_exchange[].long_pct | number | % | 多头占比。 |
| account.by_exchange[].short_pct | number | % | 空头占比。 |
| account.by_exchange[].ratio | number | — | 多头占比除以空头占比(1 = 多空均衡)。 |
| account.by_exchange[].updated_at | number | ms | 该行最近一次更新的时间。 |
| account.by_exchange[].age_s | number | s | 该行距上次更新的秒数。 |
| account.by_exchange[].is_stale | boolean | — | 该行超出新鲜窗口时为 true;过期的行不计入合计。 |
| account.by_exchange[].source | string | — | 该行来自交易所的哪一项统计。 |
| account.by_exchange[].period | string | — | 交易所该项统计的采样周期(例如 `5m`)。 |
| top_account | object | — | 同上,但仅限交易所定义的大户。 |
| top_account.long_pct | number|null | % | 多头占比。 |
| top_account.short_pct | number|null | % | 空头占比。 |
| top_account.ratio | number|null | — | 多头占比除以空头占比(1 = 多空均衡)。 |
| top_account.n_exchanges | number | — | 参与计算的交易所数量。 |
| top_account.by_exchange | array | — | 各交易所明细。 |
| top_account.by_exchange[] | object | — | 各交易所明细。 |
| top_account.by_exchange[].exchange | string | — | 交易所 ID,小写(例如 `binance`)。 |
| top_account.by_exchange[].symbol | string | — | 经 CoinBoss 归一化的合约代码(例如 BTCUSDT)。 |
| top_account.by_exchange[].long_pct | number | % | 多头占比。 |
| top_account.by_exchange[].short_pct | number | % | 空头占比。 |
| top_account.by_exchange[].ratio | number | — | 多头占比除以空头占比(1 = 多空均衡)。 |
| top_account.by_exchange[].updated_at | number | ms | 该行最近一次更新的时间。 |
| top_account.by_exchange[].age_s | number | s | 该行距上次更新的秒数。 |
| top_account.by_exchange[].is_stale | boolean | — | 该行超出新鲜窗口时为 true;过期的行不计入合计。 |
| top_account.by_exchange[].source | string | — | 该行来自交易所的哪一项统计。 |
| top_account.by_exchange[].period | string | — | 交易所该项统计的采样周期(例如 `5m`)。 |
| top_position | object | — | 大户所持仓位中多头与空头的占比。 |
| top_position.long_pct | number|null | % | 多头占比。 |
| top_position.short_pct | number|null | % | 空头占比。 |
| top_position.ratio | number|null | — | 多头占比除以空头占比(1 = 多空均衡)。 |
| top_position.n_exchanges | number | — | 参与计算的交易所数量。 |
| top_position.by_exchange | array | — | 各交易所明细。 |
| top_position.by_exchange[] | object | — | 各交易所明细。 |
| top_position.by_exchange[].exchange | string | — | 交易所 ID,小写(例如 `binance`)。 |
| top_position.by_exchange[].symbol | string | — | 经 CoinBoss 归一化的合约代码(例如 BTCUSDT)。 |
| top_position.by_exchange[].long_pct | number | % | 多头占比。 |
| top_position.by_exchange[].short_pct | number | % | 空头占比。 |
| top_position.by_exchange[].ratio | number | — | 多头占比除以空头占比(1 = 多空均衡)。 |
| top_position.by_exchange[].updated_at | number | ms | 该行最近一次更新的时间。 |
| top_position.by_exchange[].age_s | number | s | 该行距上次更新的秒数。 |
| top_position.by_exchange[].is_stale | boolean | — | 该行超出新鲜窗口时为 true;过期的行不计入合计。 |
| top_position.by_exchange[].source | string | — | 该行来自交易所的哪一项统计。 |
| top_position.by_exchange[].period | string | — | 交易所该项统计的采样周期(例如 `5m`)。 |
| position_all | object | — | 全部仓位中多头与空头的占比(限公布该数据的交易所)。 |
| position_all.long_pct | number|null | % | 多头占比。 |
| position_all.short_pct | number|null | % | 空头占比。 |
| position_all.ratio | number|null | — | 多头占比除以空头占比(1 = 多空均衡)。 |
| position_all.n_exchanges | number | — | 参与计算的交易所数量。 |
| position_all.by_exchange | array | — | 各交易所明细。 |
| position_all.by_exchange[] | object | — | 各交易所明细。 |
| position_all.by_exchange[].exchange | string | — | 交易所 ID,小写(例如 `binance`)。 |
| position_all.by_exchange[].symbol | string | — | 经 CoinBoss 归一化的合约代码(例如 BTCUSDT)。 |
| position_all.by_exchange[].long_pct | number | % | 多头占比。 |
| position_all.by_exchange[].short_pct | number | % | 空头占比。 |
| position_all.by_exchange[].ratio | number | — | 多头占比除以空头占比(1 = 多空均衡)。 |
| position_all.by_exchange[].updated_at | number | ms | 该行最近一次更新的时间。 |
| position_all.by_exchange[].age_s | number | s | 该行距上次更新的秒数。 |
| position_all.by_exchange[].is_stale | boolean | — | 该行超出新鲜窗口时为 true;过期的行不计入合计。 |
| position_all.by_exchange[].source | string | — | 该行来自交易所的哪一项统计。 |
| position_all.by_exchange[].period | string | — | 交易所该项统计的采样周期(例如 `5m`)。 |
| taker | object | — | 主动买入与主动卖出成交量的占比。 |
| taker.long_pct | number|null | % | 多头占比。 |
| taker.short_pct | number|null | % | 空头占比。 |
| taker.ratio | number|null | — | 多头占比除以空头占比(1 = 多空均衡)。 |
| taker.n_exchanges | number | — | 参与计算的交易所数量。 |
| taker.by_exchange | array | — | 各交易所明细。 |
| taker.by_exchange[] | object | — | 各交易所明细。 |
| taker.by_exchange[].exchange | string | — | 交易所 ID,小写(例如 `binance`)。 |
| taker.by_exchange[].symbol | string | — | 经 CoinBoss 归一化的合约代码(例如 BTCUSDT)。 |
| taker.by_exchange[].long_pct | number | % | 多头占比。 |
| taker.by_exchange[].short_pct | number | % | 空头占比。 |
| taker.by_exchange[].ratio | number | — | 多头占比除以空头占比(1 = 多空均衡)。 |
| taker.by_exchange[].updated_at | number | ms | 该行最近一次更新的时间。 |
| taker.by_exchange[].age_s | number | s | 该行距上次更新的秒数。 |
| taker.by_exchange[].is_stale | boolean | — | 该行超出新鲜窗口时为 true;过期的行不计入合计。 |
| taker.by_exchange[].source | string | — | 该行来自交易所的哪一项统计。 |
| taker.by_exchange[].period | string | — | 交易所该项统计的采样周期(例如 `5m`)。 |
| definitions | object | — | 各项指标的定义。五项指标回答的是不同的问题,绝不混合。 |
| definitions.account | string | — | 账户数口径指标。 |
| definitions.top_account | string | — | 大户账户数口径指标。 |
| definitions.top_position | string | — | 大户持仓量口径指标。 |
| definitions.position_all | string | — | 全部持仓量口径指标。 |
| definitions.taker | string | — | 主动买入 / 卖出口径指标。 |
| method | object | — | 以纯文本说明本响应所用的公式。 |
| method.normalize | string | — | 关于归一化的纯文本说明:每家交易所的数值都按比例缩放,使多头 % + 空头 % = 100,比值 = 多头 % ÷ 空头 %。 |
| method.aggregate | string | — | 跨交易所聚合值。 |
| method.freshness | string | — | 纯文本新鲜度规则:显示 24 小时内更新过的行,`is_stale` 标记超过 2 小时未更新的行。 |
生成于 2026-11-11 23:00 UTC,基于 4 个真实响应。
响应示例
/api/sd/ls?coin=BTC · 真实响应,采集于 2026-11-13 03:57:48 UTC。 为便于展示,较长的数组和映射已被截短:taker.by_exchange 原有 4 项; account.by_exchange 原有 6 项; top_position.by_exchange 原有 4 项。
- "success"true
- "coin""BTC"
- "now"1794542268813
- "account"
- "long_pct"73.52
- "short_pct"26.48
- "ratio"2.7764
- "n_exchanges"6
- "by_exchange"
- "top_account"
- "long_pct"66.89
- "short_pct"33.11
- "ratio"2.0198
- "n_exchanges"2
- "by_exchange"
- "top_position"
- "long_pct"49.7
- "short_pct"50.3
- "ratio"0.9881
- "n_exchanges"4
- "by_exchange"
- "position_all"
- "long_pct"49.43
- "short_pct"50.57
- "ratio"0.9775
- "n_exchanges"1
- "by_exchange"
- "taker"
- "long_pct"43.47
- "short_pct"56.54
- "ratio"0.7688
- "n_exchanges"4
- "by_exchange"
- "definitions"
- "account""all accounts: share of accounts that are net long vs net short (headcount, not size)"
- "top_account""top traders only: share of top-trader accounts net long vs net short"
- "top_position""top traders only: long position size vs short position size"
- "position_all""all traders: long position size vs short position size (Bitget only; kept separate from top-trader figures)"
- "taker""taker buy volume vs taker sell volume in the period (aggressor flow; not positions)"
- "method"
- "normalize""each exchange value converted to long% + short% = 100; ratio = long% / short%"
- "aggregate""simple mean of long% across exchanges within the same definition; different definitions are never mixed"
- "freshness""rows updated within 24h are shown; is_stale marks rows older than 2h"
已验证的样本
除上面的示例外,探针还会使用以下参数调用该端点,并在每次调用时校验结构。
| 参数 | HTTP | 延迟 | 结果 |
|---|---|---|---|
| coin=ETH | 200 | 5 ms | 通过 |
| coin=SOL | 200 | 5 ms | 通过 |
| coin=ARKM | 200 | 4 ms | 通过 |
| — | 400 | 1 ms | 通过 返回预期的错误 |
检查于 2026-11-13 03:27:48 UTC
详细信息
- 身份验证
- 无。公开端点。
- 速率限制
- 每个 IP 每分钟 1200 次请求
- 服务端缓存
- 30s
- 边缘微缓存
- 10s
- 更新频率
- 每 5 分钟(binance 大户账户数多空比以及 okx 主动买卖比 / 大户持仓量多空比每小时;长尾交易对每 30 分钟)
- 时间窗口
- 最新快照(24 小时内的行;超过 2 小时后置 is_stale 标志)
- 数据来源
- 多空比由自有采集器轮询 7 家交易所(binance、okx、bybit、bitget、gate、htx、kraken)的公开统计端点获得。
- 交易所覆盖范围
- 账户数多空比:binance、okx、bybit、bitget、gate、kraken;大户账户数多空比:binance、htx;持仓量多空比:binance、okx、gate、htx、bitget;主动买卖比:binance、okx、bitget、gate;上游采样周期各不相同(5 分钟至 1 小时);交易对覆盖范围为按成交量排名的滚动列表(binance 账户数多空比约 280 个币种,其他交易所 / 类型约 20-60 个币种);响应中列出了每个上游端点及其采样周期
- 单位
- long / short as percentages of 100; ratio = long / short
- 计算方法
- per group (account, top_account, top_position, position_all, taker): simple mean of long% across exchanges; groups are never mixed
- 时间戳
- 除非字段说明另有注明,均为 Unix 纪元毫秒(UTC)
- 响应格式
- json
- 稳定性
- 稳定
- 上线时间
- 2026-11-11
实时状态
可用检查于 2026-11-13 03:52:39 UTCHTTP 2005 ms结构一致最新数据点距今 83s
近 30 天可用性
410 次检查中 100% 通过
错误
所有端点的失败响应格式一致。完整列表见错误页面。 错误与速率限制 →
| 错误码 | HTTP | 含义 | 处理方式 |
|---|---|---|---|
| INVALID_PARAM | 400 | 缺少必填参数,或某个取值不被接受。已知是哪个参数时,`param` 会给出其名称。 | 请勿原样重试;请修正请求。 |
| UNAUTHORIZED | 401 | 已发送 `CB-API-KEY` 请求头,但该密钥未知或已被吊销。公开数据无需密钥,请去掉该请求头或使用有效密钥。 | 请勿原样重试。 |
| FORBIDDEN | 403 | 该路由不属于公开 API(内部或仅限账户使用)。 | 请勿重试。 |
| NOT_FOUND | 404 | 未知路由,或所请求的币种 / 交易所 / 基金不存在。 | 请勿重试;请对照目录检查路径和标识符。 |
| RATE_LIMITED | 429 | 请求数超过每分钟限额。`Retry-After` 给出需要等待的秒数。 | 等待 `Retry-After` 指定的时间后,再以退避方式重试。 |
| INTERNAL | 500 | 意外的服务器错误。错误信息有意保持通用;报告问题时请附上 `request_id`。 | 几秒后重试一次;若问题持续,请附上请求 ID 报告。 |
| UPSTREAM_FAILED | 503 | 该端点背后的数据源未及时响应。不会返回过期数据或替代数值来顶替。 | 以退避方式重试;并查看状态页。 |
| UNAVAILABLE | 501 / 503 | 数据集暂时未就绪(缓存预热中),或该端点尚无合法的公开数据源。 | 请稍后重试;目录会标出因设计原因而不可用的端点。 |
| REQUEST_FAILED | 200 | 部分较旧的端点会以 HTTP 200 返回 `success: false`。请务必检查 `success`,而不只是 HTTP 状态码。 | 取决于具体信息;按请求失败处理。 |
试一试
GET
/api/sd/ls可用参数
string — Coin symbol; 400 when missing. Alias: `base`.
请求 URL
https://www.coinboss.com/api/sd/ls?coin=BTC选择一个端点,然后点击“发送请求”。响应、响应头和耗时将显示在这里。
同分类的其他端点
- 单个币种的多空比 /api/sd/ls
- 币种页多空比卡片 /api/currency/ls-cards
- 某币种在单个交易所的多空比历史 /api/exchanges/ls-history
- 单个币种的各交易所多空比卡片 /api/ls/cards
- 单个币种的多空比图表序列 /api/ls/chart
- 单个币种在各交易所、各口径下的多空比 /api/ls/coin
- 单个币种在单个交易所的多空比历史 /api/ls/history
- 多空比矩阵 /api/ls/matrix
- 多空比列表 v2 /api/market/long-short-v2
- 多空比列表 /api/market/long-short