瀏覽全部文件

調和通膨歷史資料 API

取得一個國家的月度調和通膨(HICP)歷史,最早的在前。

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

端點與請求

REST 端點
GET /v1/economics/{country}/harmonised-inflation/observations
請求範例
curl --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_get_harmonised_inflation_history ,並使用下列對應參數。

參數

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

名稱必填類型含義
country是路徑·ISO alpha-3一個受支援的大寫國家代碼;請參閱此操作的涵蓋清單。
start否查詢·YYYY-MM起始觀測期間(含該期間)。
end否查詢·YYYY-MM結束觀測期間(含該期間)。
limit否查詢·整數,1–1000傳回的期間數上限。預設值為 100。頁面可能包含較少的期間;請繼續使用 next_cursor。
cursor否查詢·不透明字串上一頁回傳的 next_cursor。
series_id否查詢·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_cursor 已縮短,真實的是更長的不透明字串。

欄位類型必填含義
source對象是該數值的發布方。publisher 是該數值所屬的統計機構,distributor 是 Narwhal 讀取資料的機構。每個序列只有一個來源,適用於其全部歷史。沒有 released_on。
measure字串是year_over_year 是年變動率,以百分比計。level 是指數水準。
seasonal_adjustment字串是Always not_seasonally_adjusted.
classification字串是該數值涵蓋的物價總項:全部項目,COICOP 2018。
base_period字串否指數等於 100 的年份。Present for the index level only.
base_value十進位數值字串否基準年的指數值。僅指數水準提供。
country字串是所請求的大寫 ISO 三字母國家代碼。
series_id字串是該數值來自的序列。將其作為 series_id 傳入,可再次讀取同一序列。
unit字串是年率為 percent,指數水準為 index。
observations陣列是依最早在前排列的觀測值,每個期間一筆。一頁的觀測值可能少於 limit。請沿 next_cursor 繼續讀取,直到它為 null。
observations[].period字串是觀測值所代表的官方月份、季度或年份。
observations[].value十進位數值字串是unit 中的數值:年率(百分比,可以為負),或指數水準。
observations[].status字串否僅當發布機構標註該數值時才提供:estimated、break_in_series、definition_differs 或 break_in_series_and_definition_differs。否則省略。
observations[].release_status字串否發布機構將該數值標為暫時值時為 preliminary。否則省略。
next_cursor字串或 null是將其原樣作為 cursor 傳入,即可讀取下一頁。最後一頁為 null。

API 錯誤 處理:錯誤碼、額度與重試

  • 400 invalid_query: A query parameter is unknown or repeated, country is not three uppercase letters, series_id is not a UUID, start or end is not a month in YYYY-MM format, start and end differ in format or start is after end, or limit is outside 1 to 1000. version_id, version and as_of are not accepted on this route.
  • 400 invalid_cursor: 游標格式錯誤,或是為其他篩選條件簽發的。
  • 409 snapshot_unavailable: 游標已超過 24 小時,已過期。請不帶 cursor 重新開始。
  • 401 invalid_api_key: Bearer 金鑰缺失或被拒絕。
  • 402 insufficient_credits: 你的餘額不足以支付此次呼叫。
  • 404 series_not_found: 該國家不在本頁的涵蓋清單中,series_id 不是該國的序列,或該範圍內沒有觀測值。清單之外的國家會得到一則說明該系列不適用於它的詳細訊息。404 不收費。
  • 429 rate_limit_exceeded: 達到了網路或帳戶的短窗口限制。請在 Retry-After 之後重試。
  • 503 economics_unavailable: Narwhal 無法安全地提供已儲存的序列。

Only a successful data response costs credit. 查看 所有錯誤、標頭與重試規則。

資料時效

該路由回傳 Narwhal 目前儲存的序列,最早的在前。不帶 start 時從最早儲存的期間開始,因此要讀取近期期間,請傳入 start。它不接受 as_of 或 version,所以無法讀取更早的版本。Narwhal 會省略缺漏的觀測值,而不是補齊。

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

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

10 國家

DNK, ESP, FIN, FRA, IRL, LVA, NLD, PRT, SVN, SWE

月度調和消費者物價指數(HICP),全部項目,來自 Eurostat,未經季節性調整。它不是國家的 inflation 路由,同一國家的兩個數值並不相同。預設序列是年變動率,以百分比計,可以為負。指數水準的基期為 2025=100。期間是 YYYY-MM 格式的月份。其他任何國家會回傳 404 series_not_found,且不收費。要讀取指數水準,請先列出該國家的序列:GET /v1/economics/{country}/series?family=harmonised-inflation 會回傳每個序列的 series_id、name、unit(percent 或 index)和 is_default,帶有 limit 和 cursor 的請求可逐頁瀏覽。將 unit 為 index 的 series_id 傳給最新值或歷史路由。

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
}

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

回傳 所有 經濟數據 操作。

此頁面對你有幫助嗎?