單個宏觀指標的歷史公佈值
GET/api/v1.0/quote/macro/indicator-history獲取單個宏觀指標的歷史公佈值(按數據日期降序)。 返回 data_time / release_time / value / predict_value / previous_value / unit_type。 indicator_id 來自 quote.macro_indicator_list;time 為截止日(yyyy-MM-dd),不傳則從當前時間往前拉。 宏觀列表請用 quote.macro_indicator_list。
請求參數
| 參數 | 類型 | 位置 | 必填 | 說明 |
|---|---|---|---|---|
indicator_id | int | 查詢 | 是 | 宏觀指標 ID,來自 quote.macro_indicator_list 的 indicator_id |
time | string | 查詢 | 否 | 截止日期 yyyy-MM-dd,從該日往前拉;不傳默認當前時間。日期格式 YYYY-MM-DD,時區隨標的市場 |
max_count | int | 查詢 | 否 | 條數,默認 100,最大 1000 |
請求示例
bash
curl -X GET 'https://webapi.moomoo.com/api/v1.0/quote/macro/indicator-history?indicator_id=1' \
-H 'Authorization: Bearer <AccessToken>' | jq響應參數
| 參數 | 類型 | 說明 |
|---|---|---|
data.data_time | string | 數據日期,格式 yyyy-MM-dd(北京/香港時區) |
data.release_time | string | 公佈時間(北京/香港時區) |
data.value | string | 公佈值(已按 pow 還原) |
data.predict_value | string | 預測值(已按 pow 還原);無預測時為 null |
data.previous_value | string | 前值(已按 pow 還原) |
data.unit_type | int | 單位:PERCENT 百分比 / VALUE 數值 / INDEX 指數 |
錯誤碼
| ret_code | error.code | 說明 |
|---|---|---|
| 0 | — | 成功 |
| -3 | invalid_parameter | 參數不合法 |
| -8 | unsupported | 不支持 |
| -10 | no_data | 沒有數據 |
響應示例
json
{
"ret_code": 0,
"ret_msg": "success",
"data": {
"data_time": "example",
"release_time": "example",
"value": "example",
"predict_value": "example",
"previous_value": "example",
"unit_type": 0
}
}