基本面

宏观经济历史数据

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"
    }
  ]
}

错误码

参见错误码文档。