---
title: "經濟資料 API 參考 | Narwhal API"
description: "經濟資料 API 參考列出已上線的 Narwhal 經濟 API 的 REST 路徑、涵蓋國家、回應欄位、請求參數與探索資源，方便你快速找到要呼叫的路由與需要的欄位。"
url: "https://narwhalapi.com/zh-tw/docs/api/economics"
---

# 經濟資料 API 參考文件

最新發布資料與歷史觀測資料，涵蓋範圍依國家與指標列出。

七個路由傳回最新採用的官方發布資料。七個對應的 `/observations` 路由回傳目前已接受的時間序列。REST 與 MCP 使用相同的結構描述與同一份額度。

`/v1/economics/{country}/population/observations` 回傳世界銀行的年度總人口。它沒有最新值路由。

## 基礎 URL 和參數

REST 基礎路徑

```
https://api.narwhalapi.com/v1/economics/{country}
```

- `country` 是受支援的大寫 ISO alpha-3 代碼。
- `period` 為可選項。對於最新發布版本請省略；否則傳入該操作要求的月、季度或年份格式。
- /v1/economics/{country}/cpi 等核心經濟數據端點及其 MCP 工具可能回傳主要指標首次發布的暫估值，回應不會註明其為暫估值；來源發布最終數值後，Narwhal API 會替換這些值。
- 每個請求都必須包含 Bearer 標頭，詳見 [API 認證：Bearer 金鑰的使用方式](https://narwhalapi.com/zh-tw/docs/authentication.md)。

請求一個已知期間

```
curl --request GET \
  --url "https://api.narwhalapi.com/v1/economics/USA/cpi?period=2026-07" \
  --header "Authorization: Bearer $NARWHAL_API_KEY"
```

## 國家

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`

涵蓋範圍依操作與國家而異。各項操作均列出其支援的國家。

215 個國家。沒有本國統計機關、OECD、Eurostat 或 BIS 序列的國家，在歷史路由上使用世界銀行的年度歷史資料。各操作頁面列出其涵蓋的國家。

## 最新發布版本

開啟各項操作的頁面，查看確切參數、接受的期間格式、回應欄位、範例、錯誤、資料時效及目前限制。

| 操作 | REST 路徑 | 期間 |
| --- | --- | --- |
| [消費者物價指數](https://narwhalapi.com/zh-tw/docs/api/economics/cpi.md) | `/v1/economics/{country}/cpi` | `YYYY-MM` |
| [通膨](https://narwhalapi.com/zh-tw/docs/api/economics/inflation.md) | `/v1/economics/{country}/inflation` | `YYYY-MM or YYYY-QN` |
| [失業率](https://narwhalapi.com/zh-tw/docs/api/economics/unemployment.md) | `/v1/economics/{country}/unemployment` | `YYYY, YYYY-MM, or YYYY-QN` |
| [勞動力參與率](https://narwhalapi.com/zh-tw/docs/api/economics/labour-force-participation.md) | `/v1/economics/{country}/labour-force-participation` | `YYYY, YYYY-MM, or YYYY-QN` |
| [國內生產毛額](https://narwhalapi.com/zh-tw/docs/api/economics/gdp.md) | `/v1/economics/{country}/gdp` | `YYYY-QN` |
| [GDP 成長率](https://narwhalapi.com/zh-tw/docs/api/economics/gdp-growth.md) | `/v1/economics/{country}/gdp-growth` | `YYYY-QN` |
| [商品貿易](https://narwhalapi.com/zh-tw/docs/api/economics/trade.md) | `/v1/economics/{country}/trade` | `YYYY or YYYY-MM` |

## 歷史觀測資料

歷史路由接受 `start`、 `end`、 `limit`，以及 `cursor`。結果依時間由舊到新列出目前採用的數列。任何金鑰都可加入 `as_of` 或 `version=first_reported`，讀取較早的資料版本。

| 操作 | REST 路徑 | 期間 |
| --- | --- | --- |
| [消費者物價指數歷史資料](https://narwhalapi.com/zh-tw/docs/api/economics/cpi-history.md) | `/v1/economics/{country}/cpi/observations` | `YYYY-MM` |
| [通膨歷史資料](https://narwhalapi.com/zh-tw/docs/api/economics/inflation-history.md) | `/v1/economics/{country}/inflation/observations` | `YYYY-MM or YYYY-QN` |
| [失業率歷史資料](https://narwhalapi.com/zh-tw/docs/api/economics/unemployment-history.md) | `/v1/economics/{country}/unemployment/observations` | `YYYY-MM or YYYY-QN` |
| [勞動力參與率歷史資料](https://narwhalapi.com/zh-tw/docs/api/economics/labour-force-participation-history.md) | `/v1/economics/{country}/labour-force-participation/observations` | `YYYY-MM or YYYY-QN` |
| [國內生產毛額歷史資料](https://narwhalapi.com/zh-tw/docs/api/economics/gdp-history.md) | `/v1/economics/{country}/gdp/observations` | `YYYY-QN` |
| [GDP 成長率歷史資料](https://narwhalapi.com/zh-tw/docs/api/economics/gdp-growth-history.md) | `/v1/economics/{country}/gdp-growth/observations` | `YYYY-QN` |
| [貨物貿易歷史資料](https://narwhalapi.com/zh-tw/docs/api/economics/trade-history.md) | `/v1/economics/{country}/trade/observations` | `YYYY-MM` |
| [人口歷史資料](https://narwhalapi.com/zh-tw/docs/api/economics/population-history.md) | `/v1/economics/{country}/population/observations` | `YYYY` |

## 更多指標

另有五個指標涵蓋的國家較少，各頁面列出了這些國家。它們的路由使用 `series_id`，不接受 `as_of` 或 `version`。

| 操作 | REST 路徑 | 期間 |
| --- | --- | --- |
| [經常帳](https://narwhalapi.com/zh-tw/docs/api/economics/current-account.md) | `/v1/economics/{country}/current-account` | `YYYY-QN` |
| [調和通膨](https://narwhalapi.com/zh-tw/docs/api/economics/harmonised-inflation.md) | `/v1/economics/{country}/harmonised-inflation` | `YYYY-MM` |
| [工業生產](https://narwhalapi.com/zh-tw/docs/api/economics/industrial-production.md) | `/v1/economics/{country}/industrial-production` | `YYYY-MM` |
| [Money supply](https://narwhalapi.com/zh-tw/docs/api/economics/money-supply.md) | `/v1/economics/{country}/money-supply` | `YYYY-MM` |
| [生產者物價](https://narwhalapi.com/zh-tw/docs/api/economics/producer-prices.md) | `/v1/economics/{country}/producer-prices` | `YYYY-MM` |
| [經常帳歷史資料](https://narwhalapi.com/zh-tw/docs/api/economics/current-account-history.md) | `/v1/economics/{country}/current-account/observations` | `YYYY-QN` |
| [調和通膨歷史資料](https://narwhalapi.com/zh-tw/docs/api/economics/harmonised-inflation-history.md) | `/v1/economics/{country}/harmonised-inflation/observations` | `YYYY-MM` |
| [工業生產歷史資料](https://narwhalapi.com/zh-tw/docs/api/economics/industrial-production-history.md) | `/v1/economics/{country}/industrial-production/observations` | `YYYY-MM` |
| [Money supply歷史資料](https://narwhalapi.com/zh-tw/docs/api/economics/money-supply-history.md) | `/v1/economics/{country}/money-supply/observations` | `YYYY-MM` |
| [生產者物價歷史資料](https://narwhalapi.com/zh-tw/docs/api/economics/producer-prices-history.md) | `/v1/economics/{country}/producer-prices/observations` | `YYYY-MM` |

## 欄位約定

| 欄位或規則 | 含義 |
| --- | --- |
| `country` | 請求的ISO alpha-3國家代碼。 |
| `period` | 回應所代表的確切官方月份、季度或年份。 |
| `released_on` | 官方發布日期，而不是 Narwhal 的檢索時間。 |
| 十進位字串 | 經濟數值使用字串，以保留精確的十進位表示。 |
| 單位和基準 | 百分比欄位的名稱會標明其含義。幣別和指數基準均有說明。僅在序列未經季節調整或已換算為年率時顯示旗標。 |
| 缺失的發布版本 | Narwhal 會拒絕提供資料，不會編造、沿用前值或將缺失值轉換為零。 |

## 依ID取得序列歷史

`GET /v1/economics/series/{series_id}/observations`依ID回傳單一序列的歷史。MCP工具：`economics_read_series_observations`。ID為UUID。不接受經濟發布日曆中`series_id`的短識別字值，例如`usa-new-home-sales`，並會回傳`400 invalid_query`。提供兩個序列：澳洲月度CPI指標（例如`284aaefe-7919-4728-bc15-50879ba77211`）和紐西蘭季度CPI。

選用的`start`和`end`接受`YYYY`、`YYYY-MM`、`YYYY-MM-DD`或`YYYY-QN`。`limit`為1–1000（預設100）。將`next_cursor`作為`cursor`傳入以取得下一頁。所有帳戶都可讀取完整歷史。未知序列回傳`404 not_found`。其他錯誤：`400 invalid_cursor`，游標無效或與請求不符時回傳。`409 snapshot_unavailable`，游標已過期或分頁期間序列的存取權限變更時回傳；請不帶游標重新開始分頁。`503 data_unavailable`，序列暫時無法提供時回傳。

回應範例

```
{
  "country": "AUS",
  "series_id": "284aaefe-7919-4728-bc15-50879ba77211",
  "unit": "percent",
  "observations": [
    {
      "period": "2018-09",
      "value": "2",
      "released_on": "2025-10-29"
    },
    {
      "period": "2018-10",
      "value": "2.3",
      "released_on": "2025-10-29"
    }
  ],
  "next_cursor": null
}
```

一律包含`country`、`series_id`、`unit`、`observations`和`next_cursor`。最後一頁的`next_cursor`為`null`。每筆觀測值包含`period`、`value`和`released_on`。`currency`和`source`僅在適用時出現。

針對澳洲統計局的每月 CPI 指標與紐西蘭統計局的季度 CPI，任何金鑰都可在此路由使用 `as_of=YYYY-MM-DD` 或 `version=first_reported`。這些參數也適用於各國歷史資料路由。

- `as_of=YYYY-MM-DD` 會傳回截至該 UTC 日期結束時已發布的數列版本。依 ID 查詢數列的路由也會在回應中回傳 `as_of`。
- `version=first_reported` 會傳回 Narwhal 首次儲存的各期數值，並在每筆觀測資料中加入 UTC 時間戳記 `first_reported_at`。若同一期的各項數據首次儲存的時間不同，時間戳記會採用其中最晚的時間。

這兩個參數皆適用於支援的各國歷史資料路由與依 ID 查詢數列的路由。一次只能使用其中一個參數；同時傳入兩者會回傳 `400 invalid_query`。若 `as_of` 日期早於 Narwhal 首次擷取該序列的時間，會回傳 `404 series_not_found`。歷史版本從 Narwhal 首次擷取時開始。分頁方式與平常相同，游標會讓所有分頁維持使用同一份快照。

`first_reported` 以目前提供的數列為準：CPI 更換基期或來源鍵值替換後，會傳回替換後各期首次儲存的數值，而 `as_of` 仍可傳回較早的發布版本。殖利率曲線、政策利率與環境歷史資料不接受這些參數。

指定日期的序列

```
curl --request GET \
  --url "https://api.narwhalapi.com/v1/economics/series/284aaefe-7919-4728-bc15-50879ba77211/observations?as_of=2026-10-10&start=2025-07&limit=2" \
  --header "Authorization: Bearer $NARWHAL_API_KEY"
```

```
{
  "country": "AUS",
  "series_id": "284aaefe-7919-4728-bc15-50879ba77211",
  "unit": "percent",
  "observations": [
    {
      "period": "2025-07",
      "value": "2.8",
      "released_on": "2025-10-29"
    },
    {
      "period": "2025-08",
      "value": "3",
      "released_on": "2025-10-29"
    }
  ],
  "next_cursor": "eyJ…",
  "as_of": "2026-10-10"
}
```

首次記錄值

```
curl --request GET \
  --url "https://api.narwhalapi.com/v1/economics/series/284aaefe-7919-4728-bc15-50879ba77211/observations?version=first_reported&start=2025-07&limit=3" \
  --header "Authorization: Bearer $NARWHAL_API_KEY"
```

```
{
  "country": "AUS",
  "series_id": "284aaefe-7919-4728-bc15-50879ba77211",
  "unit": "percent",
  "observations": [
    {
      "period": "2025-07",
      "value": "2.8",
      "released_on": "2025-10-29",
      "first_reported_at": "2026-10-08T01:20:36.137656Z"
    },
    {
      "period": "2025-08",
      "value": "3",
      "released_on": "2025-10-29",
      "first_reported_at": "2026-10-08T01:20:36.137656Z"
    },
    {
      "period": "2025-09",
      "value": "3.5",
      "released_on": "2025-10-29",
      "first_reported_at": "2026-10-08T01:20:36.137656Z"
    }
  ],
  "next_cursor": null
}
```

早於首次擷取時間的 `as_of` 日期

```
{
  "type": ".../problems/not-found",
  "title": "Economics series not found",
  "status": 404,
  "detail": "The series had no publication at that time.",
  "code": "series_not_found"
}
```

Narwhal 於 2026 年 8 月至 9 月間開始擷取序列。對於機構在此之前已發布的期別，`first_reported_at` 記錄的是 Narwhal 首次擷取該數值的時間，晚於機構的原始發布時間。Narwhal 不會重建更早的發布版本。

## OpenAPI 與探索功能

- [OpenAPI 3.1 文件](https://api.narwhalapi.com/openapi.json)
- [ReDoc](https://api.narwhalapi.com/redoc)
- [MCP 工具與連線指南](https://narwhalapi.com/zh-tw/docs/mcp.md)

## 目前公開測試版的限制

透過 REST 和 MCP 取得9個國家與地區的公債殖利率曲線。讀取單一來源日期的資料或分頁歷史資料，數值以十進位百分比字串表示。

查看 [API 錯誤 處理：錯誤碼、額度與重試](https://narwhalapi.com/zh-tw/docs/errors.md) 以了解序列缺失與服務無法使用時的處理方式。

## 從免費金鑰開始

每月 10 美元免費額度，無需綁卡。每月 10 美元免費額度，無需綁卡。

[取得免費 API 金鑰](https://narwhalapi.com/zh-tw/signup)

此頁面對你有幫助嗎?
