瀏覽全部文件

通膨率 API:年增率與月增率

取得指定月份的通膨年增率、月增率及年初至今通膨率。

economics_get_inflation 可透過 REST 或 economics_get_inflation MCP 工具呼叫。兩者回傳相同的資料結構,並使用同一份額度。

端點與請求

REST 端點
GET /v1/economics/{country}/inflation
請求範例
curl --request GET \
  --url "https://api.narwhalapi.com/v1/economics/USA/inflation?period=2026-07" \
  --header "Authorization: Bearer $NARWHAL_API_KEY"

MCP 使用工具 economics_get_inflation ,並使用下列對應參數。

參數

此操作接受的期間格式是 YYYY-MM or YYYY-QN。

名稱必填類型含義
country是路徑·ISO alpha-3一個受支援的大寫國家代碼;請參閱此操作的涵蓋清單。
period否查詢·YYYY-MM 或 YYYY-QN省略此參數可取得已採納的最新完整發布資料,或傳入一個確切期間。
version_id否查詢·UUID選填的不可變發布版本。可使用 `dataset.published` 或 `dataset.revised` 事件中的 `resource_version`;省略時讀取目前已收錄的指標。

回應

回應範例
{
  "country": "USA",
  "period": "2026-07",
  "year_over_year": "3.4",
  "month_over_month": "0.0",
  "year_to_date": "3.0",
  "released_on": "2026-11-10"
}
欄位類型必填含義
country字串是所請求的大寫 ISO 三字母國家代碼。
period字串是回傳的官方觀測期間。
year_over_year十進位數值字串是與去年同月相比的變動率,單位為百分比。
month_over_month十進位數值字串否與上個月相比的變動率,單位為百分比。Left out where the publisher releases only the year-over-year figure.
quarter_over_quarter十進位數值字串否與上一季相比的變動率,單位為百分比。紐西蘭的數據按季度發布,因此用它取代 month_over_month。
year_to_date十進位數值字串否與去年十二月相比的變動率,單位為百分比。發布機構未發布時省略。
released_on日期是官方發布日期,而不是 Narwhal 的檢索時間。
source對象否The optional source object appears only when the statistic is received through a distributor. It contains publisher (the original publisher named by the distributor) and distributor (the distributing organisation). When source is present, released_on is the distributor's publication date, not the original publisher's release date. Publisher-direct series omit source. 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"], ["month_over_month"] 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.

Inflation also answers the newest figure for a country that has no stored series. It has no history: a period or version_id request for such a country returns 404 series_not_found.

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.

請求範例
curl --request GET \
  --url "https://api.narwhalapi.com/v1/economics/GRC/inflation" \
  --header "Authorization: Bearer $NARWHAL_API_KEY"
回應範例
{
  "country": "GRC",
  "period": "2026-10",
  "year_over_year": "5.7",
  "released_on": "2026-11-10",
  "source": {
    "publisher": "Hellenic Statistical Authority"
  },
  "stage": "final",
  "published_at": "2026-11-10T10: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.

讀取 來源檢查、驗證、發布版本儲存,以及檢查失敗時的處理方式。

目前公開測試版的涵蓋範圍

46 國家

ARG, AUS, AUT, BEL, BRA, CAN, CHE, 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, THA, USA, ZAF

國家通膨資料涵蓋下列國家;是否提供年初至今資料,取決於各來源的資料規格。歐元區國家使用的是本國指數,而非歐盟統計局的 HICP,因此數值可能與歐盟統計局的數值不同。澳洲使用的是月度 CPI,而非季度 CPI,因此月度數值可能與季度數值不同。A country with no stored series can still answer the newest figure from the publisher's release: it has no history, so a period or version_id request for it returns 404 series_not_found.

紐西蘭的通膨數據按季度發布,來自 Stats NZ。期間為 YYYY-QN 格式的季度,回傳 quarter_over_quarter 以取代 month_over_month,沒有 year_to_date。

IMF 月度資料

27 國家

AGO, ARM, BGD, BIH, BWA, CIV, CRI, GEO, HTI, JOR, KEN, LAO, LBN, LKA, LSO, MWI, NGA, OMN, PRY, SEN, SLV, UGA, UKR, UZB, VEN, VNM, ZMB

這些國家的最新通膨路由使用國際貨幣基金組織(IMF)的 CPI 資料集(全部項目,月度)作答,該資料集轉發統計機構的消費者物價指數。Narwhal 在開放每個國家之前,已將其最新兩個月的資料與本國統計機構核對。year_over_year 與 month_over_month 是 IMF 公布的變動率(保留一位小數),並非 Narwhal 的計算結果,也沒有 year_to_date。source 物件將 IMF 標為 distributor,將原始發布機構標為 publisher。這些國家的歷史路由仍回傳世界銀行的年度資料。

世界銀行年度歷史資料

100 國家

ABW, AFG, ALB, ATG, AZE, BDI, BEN, BFA, BHR, BHS, BLR, BLZ, BOL, BRB, BRN, BTN, CAF, CMR, COD, COG, COM, CPV, CUW, CYM, DJI, DMA, DOM, ECU, EGY, ETH, FJI, FSM, GAB, GHA, GIN, GMB, GNB, GNQ, GRD, GTM, GUY, HND, IRN, IRQ, JAM, KAZ, KGZ, KHM, KIR, KNA, LBR, LBY, LCA, MAC, MDA, MDG, MDV, MLI, MMR, MNE, MNG, MOZ, MRT, MUS, NAM, NCL, NER, NIC, NPL, PAN, PLW, PNG, PSE, RUS, RWA, SDN, SLB, SLE, SMR, SSD, STP, SUR, SWZ, SXM, SYC, SYR, TCD, TGO, TJK, TLS, TON, TTO, TUN, TZA, URY, VCT, VUT, WSM, YEM, ZWE

這些國家沒有最新值路由。對此路由發出的請求會回傳 404 series_not_found,請改用歷史路由。

每日 FX 資料可透過以下 API 取得: 外匯 API。

回傳 所有 經濟數據 操作。

此頁面對你有幫助嗎?