基本面

宏觀經濟歷史數據

GEThttps://openapi.longbridge.com/v2/quote/macrodata

鑑權

簽名方式:每個請求用 App Key / Secret 簽名。請求頭如下:

名稱類型必填說明
Authorizationstring · header必填OpenAPI 後台 上的賬戶 Access Token,作為原始 token 傳入(不帶 Bearer 前綴),並參與簽名計算。
X-Api-Keystring · header必填你的 App Key。
X-Timestampstring · header必填請求時間戳,單位秒(Unix 時間)。
X-Api-Signaturestring · header必填HMAC-SHA256 簽名。格式:HMAC-SHA256 SignedHeaders=authorization;x-api-key;x-timestamp, Signature=。

獲取指定宏觀經濟指標的歷史發布數據,包括實際值、預測值、前值和下次發布時間。

>_ CLI
# Historical data for Non-Farm Payroll
longbridge macrodata 61744
# Date range filter
longbridge macrodata 61744 --start 2024-01-01 --end 2024-12-31

請求

查詢參數

名稱類型必填說明
indicator_codestring必填來自 `macroeconomic_indicators` 的指標代碼
start_datestring可選開始日期,`YYYY-MM-DD` 格式
end_datestring可選結束日期,`YYYY-MM-DD` 格式
offsetinteger可選分頁偏移量。默認:0
limitinteger可選最大記錄數。默認:100,最大:100

響應

響應欄位

名稱類型必填說明
infoMacroeconomicIndicator必填指標元數據
dataMacroeconomic[]必填歷史數據點
countint必填數據點總數
periodstring必填統計週期(如 `2024-12-01`、`2024-Q4`)
release_atint可選發佈時間的 Unix 時間戳
actual_valuestring必填實際公佈值
previous_valuestring必填上一週期值
forecast_valuestring必填市場一致預期

響應 JSON 示例

{
  "count": 24,
  "info": {
    "indicator_code": "61744",
    "country": "US",
    "name": "Non-Farm Payroll",
    "periodicity": "Monthly",
    "describe": "...",
    "importance": 3
  },
  "data": [
    {
      "period": "2024-12-01",
      "release_at": 1735900200,
      "actual_value": "256000",
      "previous_value": "212000",
      "forecast_value": "165000"
    }
  ]
}

錯誤碼

參見錯誤碼文檔。