AI agent?先讀 /llms.txt 取得全站索引。
總體經濟
海關進出口貿易統計:財政部關務署官方月統計,每筆為某項目某月之貿易值(新臺幣千元)。來源寬表轉長表。機器攜帶出處(OGDL v1)。非預測、非建議。
GET /v2/datasets/customs-trade-monthly即將開放——此資料集建置中,尚未可透過 API 查詢。下方涵蓋與誠實限制為真實資料庫狀態;serving 上線(預計 8/1)後脫離「建置中」。
| 欄位 | 型別 | 說明 |
|---|---|---|
stat_item | text | 統計項目 |
item_code | code | metric |
item_name | text | 繁中 label |
value | numeric | 新臺幣千元 (NTD k) |
unit | text | |
attribution | text | 機關全名 (first-class) |
1,043 列,2014-01 至 2026-05,7 項(出口總值/出口/復出口/進口總值/進口/復進口/出入超)。單位新臺幣千元。
此為本端點的真實回應。資料列位於 "data" 之下,來源資訊如下方所示;各資料集形狀不盡相同,請以本頁為準。
{ "dataset_id": "customs-trade-monthly", "row_count": 3, "data": [ { "dataset_key": "customs_trade_monthly", "period_month": "2026-05-01", "stat_item": "海關進出口", "item_code": "export_total", "item_name": "出口總值", "value": 2475945706.0, "unit": "新臺幣千元", "attribution": "財政部關務署" }, { "dataset_key": "customs_trade_monthly", "period_month": "2026-04-01", "stat_item": "海關進出口", "item_code": "export_total", "item_name": "出口總值", "value": 2153671224.0, "unit": "新臺幣千元", "attribution": "財政部關務署" }, { "dataset_key": "customs_trade_monthly", "period_month": "2026-03-01", "stat_item": "海關進出口", "item_code": "export_total", "item_name": "出口總值", "value": 2536953556.0, "unit": "新臺幣千元", "attribution": "財政部關務署" } ]}擷取自 2026-07-20 的線上 API。
本頁顯示原始中文值;英文頁會以標記取代,以維持全英文。
curl "https://api.twmarketdata.com/v2/datasets/customs-trade-monthly?symbol=2330" \ -H "X-API-Key: sk_live_..."| 參數 | 必填 | 型別 | 說明 |
|---|---|---|---|
symbol | 是 | string | 股票代碼,例如 2330。 |
start_date | 否 | string (YYYY-MM-DD) | 查詢起始日期。 |
end_date | 否 | string (YYYY-MM-DD) | 查詢結束日期。 |
limit | 否 | integer | 回傳筆數上限。 |
第一個呼叫:
import requests resp = requests.get( "https://api.twmarketdata.com/v2/datasets/customs-trade-monthly", params={"symbol": "2330"}, headers={"X-API-Key": "sk_live_..."},)resp.raise_for_status()print(resp.json()["data"])帶日期區間篩選:
import requests # The full verified example — the same call with every supported filter set.resp = requests.get( "https://api.twmarketdata.com/v2/datasets/customs-trade-monthly", params={"symbol": "2330"}, headers={"X-API-Key": "sk_live_..."},)resp.raise_for_status()for row in resp.json()["data"]: print(row)此端點為 GET /v2/datasets/customs-trade-monthly。完整機器可讀 schema(參數、認證、回應封裝)見 OpenAPI spec。