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 min(binance 大戶帳戶數多空比與 okx 主動買賣比/大戶持倉量多空比為每小時;長尾交易對每 30 min)
- 時間視窗
- 最新快照(24 h 內的資料列;超過 2 h 即標記 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 min 至 1 h);涵蓋的幣種為依成交量排名滾動更新的清單(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 epoch 毫秒(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