宏观经济历史数据
获取指定宏观经济指标的历史发布数据,包括实际值、预测值、前值和下次发布时间。
SDK Links
Python | longport.openapi.FundamentalContext.macroeconomic |
Rust | longport::fundamental::FundamentalContext#macroeconomic |
Go | FundamentalContext.Macroeconomic |
Node.js | FundamentalContext#macroeconomic |
参数
SDK 方法参数。
| 名称 | 类型 | 必填 | 描述 |
|---|---|---|---|
| indicator_code | string | 是 | 指标代码,来自 macroeconomic_indicators |
| start_date | string | 否 | 开始日期,格式 YYYY-MM-DD |
| end_date | string | 否 | 结束日期,格式 YYYY-MM-DD |
| limit | int | 否 | 最大返回条数,默认 100,最大 100 |
请求示例
响应
响应示例
json
{
"count": 24,
"info": {
"indicator_code": "62267",
"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"
}
]
}数据结构
MacroeconomicResponse
| 字段 | 类型 | 必填 | 描述 |
|---|---|---|---|
| info | MacroeconomicIndicator | 是 | 指标元数据 |
| data | Macroeconomic[] | 是 | 历史数据点列表 |
| count | int | 是 | 数据总条数 |
Macroeconomic
| 字段 | 类型 | 必填 | 描述 |
|---|---|---|---|
| period | string | 是 | 统计周期(如 2024-12-01、2024-Q4) |
| release_at | int | 否 | 发布时间 Unix 时间戳 |
| actual_value | string | 是 | 实际值 |
| previous_value | string | 是 | 前值 |
| forecast_value | string | 是 | 市场预期值 |