加密货币市场数据卡片
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
}
]
}
}