取得市場深度
HTTP 請求
GET /futures/depth
請求參數
| 參數名 | 是否必須 | 類型 | 說明 | 
|---|---|---|---|
| market | true | string | 市場名稱 | 
| limit | true | int | 深度資料條數。 [5, 10, 20, 50]中的其中一個 | 
| interval | true | string | 合併粒度。 ["0", "0.00000000001", "0.000000000001", "0.0000000001", "0.000000001", "0.00000001", "0.000000001", "0.00000001", "0.00000001", "0.00000001", "0.0010 ", "0.001", "0.01" , "0.1", "1", "10", "100", "1000"]中的一個 | 
請求回應
| 參數名 | 類型 | 說明 | 
|---|---|---|
| market | string | 市場名 | 
| is_full | bool | true為全量推送,false為增量推送 | 
| depth | object | 深層數據 | 
| depth.asks | array | 賣方數據 | 
| asks[n][0] | string | 賣方價格 | 
| asks[n][1] | string | 賣方數量,在增量推送時,該值為0表示需要刪除該價格的深度 | 
| depth.bids | array | 買方數據 | 
| bids[n][0] | string | 買方價格 | 
| bids[n][1] | string | 買方數量,在增量推送時,該值為0表示需要刪除該價格的深度 | 
| depth.last | string | 最新價格 | 
| depth.updated_at | int | 時間戳,毫秒 | 
| depth.checksum | string | 資料校驗和 | 
提示
關於深度校驗和(checksum):
- checksum 校驗和是全深度資料的有符號的32位元整數,用於驗證深度資料的正確性。
- 構造校驗和字串:bid1_price:bid1_amount:bid2_price:bid2_amount:ask1_price:ask1_amout:…(如果沒有出價,則校驗和字串是ask1_price:ask1_amount:ask2_price:ask2_amount:…)
- 將校驗和字串使用crc32演算法編碼
如何結合全量及增量推送在api客戶端恢復完整深度資料及進行深度資料校驗,請參考程式碼範例
請求範例
GET /futures/depth?market=BTCUSDT&limit=5&interval=0.01
回應範例
{
    "code": 0,
    "data": {
        "market": "BTCUSDT",
        "is_full": true,
        "depth": {
            "asks": [
                [
                    "30740.00",
                    "0.31763545"
                ],
                [
                    "30769.00",
                    "1.45155000"
                
            ],
            "bids
                    : [
                [
                    "30736.00",
                "
                    "
                    "0.84696320"
                ],
                [
                    "30725.00",
                    "0.12563353"
                ],
                [
            30422.00",
                    "0"
                ] 32, 30422.00", 30 "0"
            ]
            : 33346" 1689152421692,
            "checksum": 2578768879
        }
    },
    "message": "OK"
}