调和通胀历史数据 API
获取一个国家的月度调和通胀(HICP)历史,最早的在前。
economics_ 可通过 REST 和 economics_ MCP 工具调用。两者返回相同的数据结构,并使用同一额度。
端点与请求
GET /v1/economics/{country}/harmonised-inflation/observationscurl --request GET \
--url "https://api.narwhalapi.com/v1/economics/FRA/harmonised-inflation/observations?start=2026-01&limit=2" \
--header "Authorization: Bearer $NARWHAL_API_KEY"MCP 使用工具 economics_ ,并传入下方对应的参数。
参数
此操作接受的期间格式是 YYYY-MM。
| 名称 | 必填 | 类型 | 含义 |
|---|---|---|---|
country | 是 | 路径·ISO alpha-3 | 一个受支持的大写国家代码;请参阅此操作的覆盖列表。 |
start | 否 | 查询·YYYY-MM | 起始观测期(包含该期)。 |
end | 否 | 查询·YYYY-MM | 结束观测期(包含该期)。 |
limit | 否 | 查询·整数,1–1000 | 返回的最大期间数。默认值为 100。页面可能包含更少的期间;请继续使用 next_cursor。 |
cursor | 否 | 查询·不透明字符串 | 上一页返回的next_cursor。 |
series_ | 否 | 查询·UUID | 可选。省略则为年率,即默认序列。传入指数水平的 `series_id` 则读取指数。可通过 `GET /v1/economics/{country}/series?family=harmonised-inflation` 查找:它是 `unit` 为 `index` 的序列。 |
响应
{
"source": {
"publisher": "Eurostat",
"distributor": "Eurostat"
},
"measure": "year_over_year",
"seasonal_adjustment": "not_seasonally_adjusted",
"classification": "COICOP 2018, all items (HICP total)",
"country": "FRA",
"series_id": "1b1f2448-2ba6-4523-a6ce-55c488ca15d1",
"unit": "percent",
"observations": [
{
"period": "2026-01",
"value": "0.4"
},
{
"period": "2026-02",
"value": "1.1"
}
],
"next_cursor": "eyJhZnRlciI6IjIwMjYtMDIi…"
}历史示例请求 limit=2,所以有两行。这里的 next_ 已缩短,真实的是更长的不透明字符串。
| 字段 | 类型 | 必填 | 含义 |
|---|---|---|---|
source | 对象 | 是 | 该数值的发布方。publisher 是该数值所属的统计机构,distributor 是 Narwhal 读取数据的机构。每个序列只有一个来源,适用于其全部历史。没有 released_。 |
measure | 字符串 | 是 | year_ 是年变化率,以百分比计。level 是指数水平。 |
seasonal_ | 字符串 | 是 | Always not_. |
classification | 字符串 | 是 | 该数值涵盖的价格总项:全部项目,COICOP 2018。 |
base_ | 字符串 | 否 | 指数等于 100 的年份。Present for the index level only. |
base_ | 十进制字符串 | 否 | 基准年的指数值。仅指数水平提供。 |
country | 字符串 | 是 | 所请求的大写 ISO 三字母国家代码。 |
series_ | 字符串 | 是 | 该数值来自的序列。将其作为 series_ 传入,可再次读取同一序列。 |
unit | 字符串 | 是 | 年率为 percent,指数水平为 index。 |
observations | 数组 | 是 | 按最早在前排列的观测值,每个期间一条。一页的观测值可能少于 limit。请沿 next_ 继续读取,直到它为 null。 |
observations[].period | 字符串 | 是 | 观测值所代表的官方月份、季度或年份。 |
observations[].value | 十进制字符串 | 是 | unit 中的数值:年率(百分比,可以为负),或指数水平。 |
observations[].status | 字符串 | 否 | 仅当发布机构标注该数值时才提供:estimated、break_、definition_ 或 break_。否则省略。 |
observations[].release_ | 字符串 | 否 | 发布机构将该数值标为临时值时为 preliminary。否则省略。 |
next_ | 字符串或 null | 是 | 将其原样作为 cursor 传入,即可读取下一页。最后一页为 null。 |
API 错误码与额度
400 invalid_: A query parameter is unknown or repeated,query countryis not three uppercase letters,series_is not a UUID,id startorendis not a month inYYYY-MMformat,startandenddiffer in format orstartis afterend, orlimitis outside 1 to 1000.version_,id versionandas_are not accepted on this route.of 400 invalid_: 游标格式错误,或是为其他筛选条件签发的。cursor 409 snapshot_: 游标已超过 24 小时,已过期。请不带unavailable cursor重新开始。401 invalid_: Bearer 密钥缺失或被拒绝。api_ key 402 insufficient_: 你的余额不足以支付此次调用。credits 404 series_: 该国家不在本页的覆盖列表中,not_ found series_不是该国的序列,或该范围内没有观测值。列表之外的国家会得到一条说明该系列不适用于它的详情。404 不收费。id 429 rate_: 达到了网络或账户的短窗口限制。请在limit_ exceeded Retry-After之后重试。503 economics_: Narwhal 无法安全地提供已存储的序列。unavailable
Only a successful data response costs credit. 查看 所有错误、响应头和重试规则。
数据时效性
该路由返回 Narwhal 当前存储的序列,最早的在前。不带 start 时从最早存储的期间开始,因此要读取近期期间,请传入 start。它不接受 as_ 或 version,所以无法读取更早的版本。Narwhal 会省略缺失的观测值,而不是补全。
当前公开测试覆盖范围
10 国家
DNK, ESP, FIN, FRA, IRL, LVA, NLD, PRT, SVN, SWE
月度调和消费者价格指数(HICP),全部项目,来自 Eurostat,未经季节性调整。它不是国家的 inflation 路由,同一国家的两个数值并不相同。默认序列是年变化率,以百分比计,可以为负。指数水平的基期为 2025=100。期间是 YYYY-MM 格式的月份。其他任何国家返回 404 series_,且不收费。要读取指数水平,请先列出该国家的序列:GET / 会返回每个序列的 series_、name、unit(percent 或 index)和 is_,带有 limit 和 cursor 的请求可逐页浏览。将 unit 为 index 的 series_ 传给最新值或历史路由。
List the 个系列
curl --request GET \
--url "https://api.narwhalapi.com/v1/economics/FRA/series?family=harmonised-inflation" \
--header "Authorization: Bearer $NARWHAL_API_KEY"{
"series": [
{
"country": "FRA",
"series_id": "11bc022a-cd6e-4847-8ff8-11dae4e93451",
"unit": "index",
"name": "Harmonised index of consumer prices",
"frequency": "monthly",
"first_period": "2000-01",
"last_period": "2026-10",
"family": "harmonised-inflation",
"definition": {
"base_period": "2025",
"base_value": "100",
"seasonal_adjustment": "not_seasonally_adjusted",
"measure": "level",
"classification": "COICOP 2018, all items (HICP total)"
}
},
{
"country": "FRA",
"series_id": "1b1f2448-2ba6-4523-a6ce-55c488ca15d1",
"unit": "percent",
"name": "Harmonised inflation, annual rate",
"is_default": true,
"frequency": "monthly",
"first_period": "2000-01",
"last_period": "2026-10",
"family": "harmonised-inflation",
"definition": {
"measure": "year_over_year",
"seasonal_adjustment": "not_seasonally_adjusted",
"annualization": "not_annualized",
"classification": "COICOP 2018, all items (HICP total)"
}
}
],
"next_cursor": null
}日频外汇数据可通过以下 API 获取: 外汇 API。
返回 所有经济数据操作。
从免费密钥开始
每月赠送 10 美元免费额度,无需绑卡。每月 10 美元免费额度,无需绑卡。
此页面对你有帮助吗?