加密貨幣市場數據卡片
GET/api/v1.0/quote/crypto/market-data-card獲取加密貨幣市場數據卡片(市值 / 成交額 / 市值佔比)。 傳 symbol(如 CC.BTC)查單個幣;不傳則按 aggregation(ALL / STABLE / OTHER)彙總。
請求參數
| 參數 | 類型 | 位置 | 必填 | 說明 |
|---|---|---|---|---|
scene | string | 查詢 | 是 | 場景:市值 / 成交額 / 市值佔比 |
time_range | string | 查詢 | 否 | 時間範圍,默認 24H |
code | string | 查詢 | 否 | 標的,如 CC.BTC;與 aggregation 二選一,優先 symbol |
aggregation | string | 查詢 | 否 | 未傳 symbol 時的彙總類型,默認 ALL |
請求示例
bash
curl -X GET 'https://webapi.moomoo.com/api/v1.0/quote/crypto/market-data-card?scene=MARKET_CAP' \
-H 'Authorization: Bearer <AccessToken>' | jq響應參數
| 參數 | 類型 | 說明 |
|---|---|---|
data.items | object[] | |
data.items[].timestamp | int | 行情時間,Unix 微秒 |
data.items[].market_cap | number | 市值,美元,不放大 |
data.items[].turnover_24h | number | 24 小時成交額,美元 |
data.items[].market_cap_pct | number | 市值佔比(百分數) |
data.items[].aggregation_type | int | 彙總類型,1=ALL / 2=STABLE / 3=OTHER;按 symbol 查詢時為 0 |
錯誤碼
| ret_code | error.code | 說明 |
|---|---|---|
| 0 | — | 成功 |
| -3 | invalid_parameter | 參數不合法 |
| -8 | unsupported | 不支持 |
| -10 | no_data | 沒有數據 |
響應示例
json
{
"ret_code": 0,
"ret_msg": "success",
"data": {
"items": [
{
"timestamp": 1710000000000000,
"market_cap": 1.2,
"turnover_24h": 1.2,
"market_cap_pct": 1.2,
"aggregation_type": 0
}
]
}
}