浏览全部文档

GDP 增长率 API 参考

获取一个季度的官方实际 GDP 增长率,按不变价格计算,以百分比表示。

economics_get_gdp_growth 可通过 REST 和 economics_get_gdp_growth MCP 工具调用。两者返回相同的数据结构,并使用同一额度。

端点与请求

REST 端点
GET /v1/economics/{country}/gdp-growth
请求示例
curl --request GET \
  --url "https://api.narwhalapi.com/v1/economics/USA/gdp-growth?period=2026-Q2" \
  --header "Authorization: Bearer $NARWHAL_API_KEY"

MCP 使用工具 economics_get_gdp_growth ,并传入下方对应的参数。

参数

此操作接受的期间格式是 YYYY-QN。

名称必填类型含义
country是路径·ISO alpha-3一个受支持的大写国家代码;请参阅此操作的覆盖列表。
period否查询·YYYY-QN省略此参数可获取已采纳的最新完整发布数据,也可传入一个具体期间。
version_id否查询·UUID可选的不可变发布版本。可使用 `dataset.published` 或 `dataset.revised` 事件中的 `resource_version`;省略时读取当前已收录的指标。

响应

响应示例
{
  "country": "USA",
  "period": "2026-Q2",
  "year_over_year": "2.2",
  "quarter_over_quarter": "0.6",
  "released_on": "2026-10-29",
  "calculated": [
    "quarter_over_quarter"
  ]
}
字段类型必填含义
country字符串是所请求的大写 ISO 三字母国家代码。
period字符串是返回的官方观测期间。
year_over_year十进制字符串是与上年同一季度相比的实际 GDP 变化率,单位为百分比。
quarter_over_quarter十进制字符串否与上一季度相比的实际 GDP 变化率,单位为百分比,未换算为年率。发布机构只发布同比数据时,以及年度期间,该字段会被省略。
year_to_date十进制字符串否来源发布时提供的官方年初至今增长率,单位为百分比;否则省略。
seasonal_adjustment字符串或 null是该数据是否经过季节调整,以发布机构的说明为准:seasonally_adjusted、not_seasonally_adjusted、calendar_adjusted 或 trend。null 表示发布机构没有说明。请勿将 null 理解为已调整。mixed 表示两个增长数据的基准不同。日本就是一例:其同比增长未经调整,环比增长经过调整。
year_over_year_seasonal_adjustment字符串或 null是每个增长数据各自的基准,取值与上述相同。仅当 seasonal_adjustment 为 mixed 时才会填写。其他情况,或发布内容没有说明该增长数据的基准时,为 null。
quarter_over_quarter_seasonal_adjustment字符串或 null是每个增长数据各自的基准,取值与上述相同。仅当 seasonal_adjustment 为 mixed 时才会填写。其他情况,或发布内容没有说明该增长数据的基准时,为 null。
annualization字符串或 null是环比增长是否已年化:annualized 或 not_annualized。如果返回结果中没有环比数据,则为 null。同比增长从不年化。
not_seasonally_adjustedtrue否仅在增长率未经季节性调整时出现,值为 true。
annualizedtrue否仅在已发布的增长率经过年化时出现,值为 true。
year_over_year_not_seasonally_adjustedtrue否仅当某国混用不同基准且其同比数值未经季节性调整时出现,值为 true。此时顶层标志不出现。
quarter_over_quarter_not_seasonally_adjustedtrue否仅当某国混用不同基准且其季度环比数值未经季节性调整时出现,值为 true。此时顶层标志不出现。
seasonally_adjustedtrue否仅当两个数值均记录为经季节性调整时出现,值为 true。
year_over_year_seasonally_adjustedtrue否仅当某国混用不同基准且其同比数值经季节性调整时出现,值为 true。此时顶层标志不出现。
quarter_over_quarter_seasonally_adjustedtrue否仅当某国混用不同基准且其季度环比数值经季节性调整时出现,值为 true。此时顶层标志不出现。
released_on日期是官方发布日期,而不是 Narwhal 的检索时间。
source对象否Who published the figure: the statistics office or central bank, for example {"publisher": "Office for National Statistics"}. Where the data reaches us through another body, distributor names that body too. If we cannot tell who published a figure, source is left out. On a newest figure read from the publisher's own release, source is {"publisher": "..."} with no distributor, and released_on is the publisher's local release day.
stage字符串否Appears only on a newest figure read from the publisher's release. Which reading of the figure this is: flash, advance, first, second, third, preliminary or final.
published_atRFC 3339 时间戳否Appears only on a newest figure read from the publisher's release. When the publisher released the figure.
provisionaltrue否Present, as true, only when the figure read from the release is marked provisional.
calculatedarray of strings否Present only when Narwhal calculated a figure from the publisher's own numbers because the publisher does not print it. Lists the calculated figures: ["year_over_year"], ["quarter_over_quarter"] or both. A printed figure always wins over a calculated one. A stored answer can carry it too, not only an answer read from the release.

Newest figure read from the release

The newest answer can come from Narwhal's own read of the statistics office's release, before the stored series has it. Such an answer adds source、 stage、 published_at 和 provisional (only when true). An answer with none of these fields is the stored value. A stored answer can also carry calculated, which lists the figures Narwhal calculated from the publisher's own numbers.

For a country with a stored series, a read value is shown when it is for a later period than the stored one, or a later final reading of the same period.

Where a stored series reaches Narwhal through a distributor, the statistics office's own printed figure for the same period replaces it. The answer then names the office as the source and no distributor.

It also answers the newest figure for a country that has no stored series, from the release alone, with the same fields and the same charge: Cameroon, Chad, Comoros, Cyprus, Fiji, Guadeloupe, Hong Kong, Hungary, Iceland, Martinique, Morocco, New Caledonia, Niger, Papua New Guinea, Senegal and Taiwan。It has no history: a period 或 version_id request for such a country returns 404 series_not_found。

For these countries GDP growth is answered only when the office's release or its own tables state whether each figure is seasonally adjusted. A year-over-year figure whose basis is not stated is a 404 series_not_found, and a quarter-over-quarter figure whose basis is not stated, or that is annualised, is left out of the answer.

请求示例
curl --request GET \
  --url "https://api.narwhalapi.com/v1/economics/SEN/gdp-growth" \
  --header "Authorization: Bearer $NARWHAL_API_KEY"
响应示例
{
  "country": "SEN",
  "period": "2026-Q2",
  "year_over_year": "6.1",
  "quarter_over_quarter": "0.1",
  "released_on": "2026-10-02",
  "source": {
    "publisher": "Agence Nationale de la Statistique et de la Démographie"
  },
  "stage": "preliminary",
  "published_at": "2026-10-02T10:00:00Z"
}
请求示例
curl --request GET \
  --url "https://api.narwhalapi.com/v1/economics/GBR/gdp-growth" \
  --header "Authorization: Bearer $NARWHAL_API_KEY"
响应示例
{
  "country": "GBR",
  "period": "2026-Q3",
  "year_over_year": "1.9",
  "quarter_over_quarter": "0.7",
  "released_on": "2026-11-12",
  "source": {
    "publisher": "Office for National Statistics"
  },
  "stage": "preliminary",
  "published_at": "2026-11-12T07:00:00Z"
}

API 错误码与额度

  • 400 invalid_query — 国家、期间或筛选格式无效。
  • 401 invalid_api_key — Bearer 密钥缺失或被拒绝。
  • 404 series_not_found — 没有已批准的观测值符合请求。
  • 429 rate_limit_exceeded — 已达到网络或账户的短时窗口限额;请按以下响应头指定的等待时间重试: Retry-After。
  • 402 insufficient_credits ,余额不足以支付该调用。
  • 503 economics_unavailable — Narwhal 无法安全提供已接受的发布版本。

Only a successful data response costs credit. 查看 所有错误、响应头和重试规则。

数据时效性

省略 period 返回 Narwhal 最新存储的已接受发布版本。API 调用读取 Narwhal 数据库,不会实时调用官方发布机构。

released_on 是官方发布日期。

The newest figure can be shown as soon as the publisher releases it, from Narwhal's read of the release. Until the stored series has the same period, the answer carries the read fields described above.

读取 源检查、验证、已存储发布版本和失败检查的工作方式。

当前公开测试覆盖范围

44 国家

ARG, AUS, AUT, BEL, BRA, CAN, CHL, CHN, COL, CZE, DEU, DNK, ESP, EST, FIN, FRA, GBR, HRV, IDN, IND, IRL, ISR, ITA, JPN, KOR, LTU, LUX, LVA, MEX, MYS, NLD, NOR, NZL, PAK, PHL, POL, PRT, QAT, SAU, SGP, SVN, SWE, USA, ZAF

季度同比及环比增长率数据覆盖的国家见下方列表。可选字段 year_to_date 仅在官方来源发布相应数据时出现。

世界银行年度历史数据

165 国家

ABW, AFG, AGO, ALB, AND, ARE, ARM, ASM, ATG, AZE, BDI, BEN, BFA, BGR, BHR, BHS, BIH, BLR, BLZ, BMU, BOL, BRB, BRN, BTN, BWA, CAF, CIV, CMR, COD, COG, COM, CPV, CRI, CUB, CUW, CYM, CYP, DJI, DMA, DOM, DZA, ECU, EGY, ERI, ETH, FJI, FRO, FSM, GAB, GEO, GHA, GIN, GMB, GNB, GNQ, GRC, GRD, GRL, GTM, GUM, GUY, HKG, HND, HTI, HUN, IMN, IRN, IRQ, ISL, JAM, JOR, KAZ, KEN, KGZ, KHM, KIR, KNA, KWT, LAO, LBN, LBR, LBY, LCA, LIE, LKA, LSO, MAC, MAF, MAR, MCO, MDA, MDG, MDV, MHL, MKD, MLI, MLT, MMR, MNE, MNG, MNP, MOZ, MRT, MUS, MWI, NAM, NCL, NER, NGA, NIC, NPL, NRU, OMN, PAN, PER, PLW, PNG, PRI, PRY, PSE, PYF, ROU, RUS, RWA, SDN, SEN, SLB, SLE, SLV, SMR, SOM, SRB, SSD, STP, SUR, SVK, SWZ, SXM, SYC, SYR, TCA, TCD, TGO, TJK, TKM, TLS, TON, TTO, TUN, TUR, TUV, TZA, UGA, UKR, URY, UZB, VCT, VEN, VIR, VNM, VUT, WSM, YEM, ZMB, ZWE

这些国家没有最新值路由。向此路由发出的请求会返回 404 series_not_found,请改用历史路由。

日频外汇数据可通过以下 API 获取: 外汇 API。

返回 所有经济数据操作。

此页面对你有帮助吗?