訂單簿深度歷史
某幣種在單一價格區間內的彙總買盤與賣盤深度時間序列,可取全部已覆蓋的交易所或單一交易所。每個資料點都會註明包含多少個合約。
/api/sd/liquidity/history請求
查詢參數
| 名稱 | 型別 | 必填 | 預設值 | 可用值 | 說明 |
|---|---|---|---|---|---|
| coin | string | 必填 | — | — | 幣種代號,不分大小寫(例如 `BTC`)。缺少或格式錯誤時回傳 400。 範例: BTC |
| market | string | 選填 | perp | perp, spot | 市場類型。永續合約與現貨的訂單簿絕不相加。 |
| band | string | 選填 | 1 | 0.5, 1, 2 | 距中間價的百分比距離。 |
| range | string | 選填 | 24h | 24h, 7d, 30d | 回溯範圍:24h(每 30 分鐘一點)、7d(每 2 小時一點)或 30d(每 6 小時一點)。 |
| exchange | string | 選填 | — | — | 此市場涵蓋的單一交易所 ID(例如 `gate`)。預設:所有交易所。未涵蓋的交易所會回傳 400。 |
請求範例
curl -s "https://www.coinboss.com/api/sd/liquidity/history?coin=BTC"回應欄位
欄位表由真實回應產生,因此列出的正是端點實際回傳的內容。路徑中的 a[] 代表陣列元素,{*} 代表以動態名稱(例如幣種或交易所)為鍵的物件。
| 欄位 | 型別 | 單位 | 說明 |
|---|---|---|---|
| success | boolean | — | 請求成功時為 true。失敗時回應內容為 `{ success: false, code, error, request_id }`。 |
| schema | string | — | 此回應的結構描述 ID。只有在既有欄位的意義或型別改變時才會變更。 |
| now | number | ms | 建立回應時的伺服器時間。 |
| coin | string | — | 幣種代號(大寫)。 |
| market | string | — | `perp` 或 `spot`。 |
| band_pct | number | % | 所選的價格區間:距中間價的距離。 |
| range | string | — | 實際套用的回溯範圍。 |
| exchange | string|null | — | 交易所 ID(小寫)。 |
| interval_s | number | s | 資料點的間隔。 |
| points | array | — | 序列資料點,由舊到新排列。 |
| points[] | object | — | 序列資料點,由舊到新排列。 |
| points[].t | number | ms | 時間區間的起始時間。 |
| points[].bid_depth_usd | number | USD | 中間價與價格區間下緣之間的買盤掛單名義價值。`complete` 為 false 時為下限。 |
| points[].ask_depth_usd | number | USD | 中間價與價格區間上緣之間的賣盤掛單名義價值。`complete` 為 false 時為下限。 |
| points[].n_included | number | — | 計入深度加總的資料列數:須為新鮮且在該價格區間內完整。請與深度值一併解讀。 |
| points[].n_rows | number | — | 找到的資料列數,包含過期者。 |
| points[].mid | number | USD | (best bid + best ask) ÷ 2,一枚幣的價格。 |
| points[].uses_aggregated_buckets | boolean | — | 有任一納入的資料列使用了價格合併區間時為 true,此時加總值為下限。 |
| points_expected | number | — | 範圍完整時應有的資料點數量。 |
| first_t | number | ms | 回傳的第一個資料點的時間。 |
| last_t | number | ms | 回傳的最後一個資料點的時間。 |
| exchange_points | object | — | 各交易所出現的資料點數量(鍵為交易所 ID)。 動態鍵: deribit,aster,backpack,bitfinex,bitget,bitunix |
| exchange_points.{*} | number | — | 各交易所出現的資料點數量(鍵為交易所 ID)。 |
| coverage | object | — | 數字中納入與未納入的內容。與其他來源比較合計值之前,請先比對這一項。 |
| coverage.included_exchanges | array | — | 新鮮資料已被納入的來源。 |
| coverage.included_exchanges[] | string | — | 新鮮資料已被納入的來源。 |
| coverage.unavailable | array | — | 無法納入的來源,各附原因。它們絕不會以 0 計入。 在產生此表所用的樣本中為空 |
| coverage.stale_excluded | array | — | 因最近一次更新超出新鮮視窗而被排除的資料列。 在產生此表所用的樣本中為空 |
| method | object | — | 此回應所用公式的純文字說明,每個欄位一項。 |
| method.bid_depth_usd | string | — | `bid_depth_usd` 的公式說明,純文字。 |
| method.ask_depth_usd | string | — | `ask_depth_usd` 的公式說明,純文字。 |
| method.complete | string | — | `complete` 的公式說明,純文字。 |
| method.history | string | — | `history` 的公式說明,純文字。 |
| method.exchange_points | string | — | `exchange_points` 的公式說明,純文字。 |
| meta | object | — | 此回應的資料歷程與新鮮度。 |
| meta.schema | string | — | 此回應的結構描述 ID。只有在既有欄位的意義或型別改變時才會變更。 |
| meta.source | array | — | 資料採集所用的上游公開端點。 |
| meta.source[] | object | — | 資料採集所用的上游公開端點。 |
| meta.source[].exchange | string | — | 交易所 ID(小寫)。 |
| meta.source[].market | string | — | `perp` 或 `spot`。 |
| meta.source[].endpoint | string | — | 採集器讀取的來源公開端點(僅供說明資料歷程;用戶端不會直接呼叫它)。 |
| meta.observed_at | null | — | 來源為該資料提供的時間戳記。 |
| meta.received_at | number | ms | CoinBoss 採集器收到資料的時間。 |
| meta.fetched_at | number | ms | 此回應組裝完成的時間。 |
| meta.window | string | — | 數字涵蓋的時間視窗。 |
| meta.quality | string | — | FRESH、PARTIAL、STALE、BROKEN 或 UNAVAILABLE,依資料時間戳記與覆蓋範圍判定。 |
| meta.is_stale | boolean | — | 資料已超出其新鮮視窗時為 true。 |
| meta.cache_ttl_s | number | s | 此回應的快取存活時間。 |
| meta.fallback | string | — | 採集器或來源發生故障時,此端點回傳的內容。 |
| meta.collector_heartbeat_age_s | number | s | 距採集器上次回報仍在運作的秒數。 |
產生於 2026-11-11 23:00 UTC,依據 3 筆真實回應。
回應範例
/api/sd/liquidity/history?coin=BTC · 真實回應,擷取於 2026-11-13 04:02:45 UTC。 較長的陣列與對應表已截短顯示:points 原有 48 個項目; meta.source 原有 19 個項目; exchange_points 原有 19 個項目; coverage.included_exchanges 原有 19 個項目。
- "success"true
- "schema""coinboss.sd.liquidity/1"
- "now"1794542565889
- "coin""BTC"
- "market""perp"
- "band_pct"1
- "range""24h"
- "exchange"null
- "interval_s"1800
- "points"
- "points_expected"48
- "first_t"1794457800000
- "last_t"1794542400000
- "exchange_points"
- "deribit"96
- "aster"48
- "coverage"
- "included_exchanges"
- "unavailable"
- "stale_excluded"
- "method"
- "bid_depth_usd""sum of resting bid notional with price >= mid * (1 - band%), in USD; notional = price * size * contract_value (inverse contracts: size * contract_value); USDT /…"
- "ask_depth_usd""sum of resting ask notional with price <= mid * (1 + band%), in USD; same notional rule as bid_depth_usd"
- "complete""true when BOTH sides of the snapshot reach the band edge (reach_pct >= band) or the whole side of the book was returned; when false the depth values are lower b…"
- "history""sd_book_hist keeps the first snapshot of every 15-minute bucket per contract; each returned point takes, per contract, the first stored snapshot inside the poin…"
- "exchange_points""number of returned points in which each exchange had a row that was complete for the band; a changing venue set moves the aggregate, so compare n_included acros…"
- "meta"
- "schema""coinboss.sd.liquidity/1"
- "source"
- "observed_at"null
- "received_at"1794542400000
- "fetched_at"1794542565889
- "window""24h"
- "quality""FRESH"
- "is_stale"false
- "cache_ttl_s"120
- "fallback""history is append-only (first snapshot of each 15-minute bucket per contract, 30-day retention); buckets the collector missed are simply absent, never interpola…"
- "collector_heartbeat_age_s"3
已驗證的樣本
除了上方的範例之外,探針還會以下列參數呼叫此端點,並在每次呼叫時檢查結構描述。
| 參數 | HTTP | 延遲 | 結果 |
|---|---|---|---|
| band=2&coin=ETH&market=spot | 200 | 6 ms | 通過 FRESH |
| coin=SOL&exchange=gate | 200 | 2 ms | 通過 FRESH |
| band=3&coin=BTC | 400 | 1 ms | 通過 回傳預期的錯誤 |
檢查於 2026-11-13 03:58:06 UTC
詳細資訊
- 身分驗證
- 無。公開端點。
- 速率限制
- 每個 IP 每分鐘 1200 次請求
- 伺服器快取
- 2m
- 邊緣微快取
- 10s
- 更新頻率
- 每個合約每 15 分鐘儲存一次快照;每個資料點採用其區間內最早的快照(時點值,而非平均值)。
- 時間視窗
- 24h / 7d / 30d.
- 資料來源
- 24 家交易所(永續合約與現貨市場)的公開 REST 訂單簿快照,由 CoinBoss 採集並儲存(sd_book_latest、sd_book_hist)。深度與滑點由 CoinBoss 依原始價格檔位自行計算。
- 交易所覆蓋範圍
- 24 家交易所,38 條「交易所 × 市場」通道。若公開快照未能涵蓋距中間價 ±0.5 / 1 / 2 % 的範圍(受交易所的檔位數上限所限),該價格區間會標記為 `complete: false`,其數值為下限,且不計入彙總值;`n_included` / `n_fresh` 提供分母,`excluded_incomplete` 則列出被排除的項目。
- 分頁
- 不分頁;資料點數量由 `range` 決定(48 / 84 / 120)。
- 排序
- 時間升冪。
- 單位
- Depth in USD notional, bid and ask side reported separately and never added. Spread and slippage in basis points (1 bp = 0.01 %). USDT / USDC / USD quotes are counted 1:1 as USD.
- 時間戳記
- Unix epoch 毫秒(UTC),除非欄位說明另有註明
- 回應格式
- json
- 穩定性
- 穩定版
- 上線時間
- 2026-11-11
即時狀態
採集始於 2026-11-11,因此較長的範圍會逐步補齊。缺少的區間會直接留空,不做內插;兩個資料點之間的 `n_included` 若有變化,表示納入計算的合約組合已改變。
近 30 天可用率
408 次檢查中有 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 狀態碼。 | 視訊息而定;請當作失敗的請求處理。 |
試用
/api/sd/liquidity/history部分可用string — Coin symbol, case-insensitive (for example `BTC`). Missing or malformed values return 400.
string · 預設 perp — Market type. Perpetual and spot books are never added together.
string · 預設 1 — Distance from mid price in percent.
string · 預設 24h — Look-back range: 24h (30-minute points), 7d (2-hour points) or 30d (6-hour points).
string — One exchange id covered for this market (for example `gate`). Default: all exchanges. An exchange that is not covered returns 400.
https://www.coinboss.com/api/sd/liquidity/history?coin=BTC此分類的其他端點
- 訂單簿深度與滑點 /api/sd/liquidity
- 訂單簿深度歷史 /api/sd/liquidity/history
- 依訂單簿深度排行的幣種 /api/sd/liquidity/rank
- 大額掛單監控 /api/indicators/large-orderbook