AI agent?先讀 /llms.txt 取得全站索引。
市場與價格
TWSE 市場指數日線水準——發行量加權股價指數(TAIEX)及各類股指數的每日開高低收。
GET /v2/datasets/market-index市場指數是台灣市場資料集,來源為 TWSE,由 TW Market Data 以 GET /v2/datasets/market-index 提供。
market-index 以官方 TWSE 指數發布為源,每個指數每交易日回傳一列,涵蓋大盤 TAIEX 與各類股指數。每列附來源角色,指數水準可回溯交易所資料。
| 欄位 | 型別 | 說明 |
|---|---|---|
index_identity | object | |
market_identity | object | |
index_level | object | |
daily_change | object | |
turnover | object | |
safe_usage_notes | array | |
available_tools_or_endpoints | object |
| 列數 | 約 4,174 |
| 涵蓋起訖 | 2009-01-05 – 2026-09-04 |
| 分級 | 已驗證 |
| 量測時間 | 2026-09-04取自資料集登錄表 |
此為本端點的真實回應。資料列位於 "items" 之下,來源資訊如下方所示;各資料集形狀不盡相同,請以本頁為準。
{
"dataset_id": "market-index",
"row_count": 50,
"items": [
{
"index_identity": {
"index_code": "TWSE_TAIEX",
"index_name": "發行量加權股價指數",
"index_version": "v1",
"index_type": "price"
},
"market_identity": {
"market": "TWSE",
"as_of_date": "2026-08-05",
"provider": "twse_official",
"source_role": "official_twse_mi_index"
},
"index_level": {
"value": 44611.6
},
"daily_change": {
"points": 1250.94,
"return_pct": 2.88
},
"turnover": {
"turnover_value": null,
"volume_shares": null
},
"source_lineage": {
"scope": "TAIEX only — the other 137 indices are out of scope (market_index 待定)",
"source": "TWSE_MI_INDEX",
"match_rule": "exact string equality; total-return index explicitly excluded",
"source_url": "https://www.twse.com.tw/exchangeReport/MI_INDEX?response=json&date=20260805&type=IND",
"matched_index_name": "發行量加權股價指數",
"index_return_pct_units": "percent (matches the stored convention)"
},
"data_gaps": [],
"safe_usage_notes": [
"breadth_overview_sector_rows_are_held",
"not_investment_advice",
"twse_taiex_index_only_scope"
],
"available_tools_or_endpoints": {
"dataset_endpoint": "/v2/datasets/market-index",
"lookup_hint": "index_code=TWSE_TAIEX&market=TWSE",
"scope_note": "taiex_index_only_read_model"
}
},
{
"index_identity": {
"index_code": "TWSE_TAIEX",
"index_name": "發行量加權股價指數",
"index_version": "v1",
"index_type": "price"
},
"market_identity": {
"market": "TWSE",
"as_of_date": "2026-08-04",
"provider": "twse_official",
"source_role": "official_twse_mi_index"
},
"index_level": {
"value": 43360.66
},
"daily_change": {
"points": -25.75,
"return_pct": -0.06
},
"turnover": {
"turnover_value": null,
"volume_shares": null
},
"source_lineage": {
"scope": "TAIEX only — the other 137 indices are out of scope (market_index 待定)",
"source": "TWSE_MI_INDEX",
"match_rule": "exact string equality; total-return index explicitly excluded",
"source_url": "https://www.twse.com.tw/exchangeReport/MI_INDEX?response=json&date=20260804&type=IND",
"matched_index_name": "發行量加權股價指數",
"index_return_pct_units": "percent (matches the stored convention)"
},
"data_gaps": [],
"safe_usage_notes": [
"breadth_overview_sector_rows_are_held",
"not_investment_advice",
"twse_taiex_index_only_scope"
],
"available_tools_or_endpoints": {
"dataset_endpoint": "/v2/datasets/market-index",
"lookup_hint": "index_code=TWSE_TAIEX&market=TWSE",
"scope_note": "taiex_index_only_read_model"
}
}
],
"held_policy": {
"market_breadth_items": "held",
"market_overview_snapshots": "held",
"sector_or_unknown_index_rows": "held"
}
}擷取自 2026-07-20 的線上 API。
本頁顯示原始中文值;英文頁會以標記取代,以維持全英文。
以下欄位會隨資料一併回傳,記錄這一列的來源。它們屬於出處而非本資料集要講的事實,因此列在這裡而不進欄位表。
source_lineagedata_gaps本服務部分資料取自政府資料開放平臺(data.gov.tw),依「政府資料開放授權條款-第1版」授權利用。資料提供機關:臺灣證券交易所、證券櫃檯買賣中心、臺灣期貨交易所、臺灣集中保管結算所、國家發展委員會、中央銀行、經濟部統計處、財政部關務署。本服務之加值處理、衍生計算與呈現方式由 TWMD 負責,與各資料提供機關無涉。
TW Market Data. (n.d.). 市場指數 [Data set]. TW Market Data. Retrieved 2026-09-05, from https://twmarketdata.com/zh-TW/docs/api/market-prices/market-index
版本取自資料集自己的 as_of,不是這一頁的產生日期。沒有 as_of 的資料集就不列這個欄位,不會補一個看起來合理的值。 驗證簽章
可與本資料集對齊的其他資料集。每組都標出可用來 join 的欄位,規劃跨表查詢時不必自己猜。
curl "https://api.twmarketdata.com/v2/datasets/market-index?index_code=TWSE_TAIEX&market=TWSE&start_date=2026-06-01&end_date=2026-07-15&limit=5" \
-H "X-API-Key: sk_live_..."| 參數 | 必填 | 型別 | 說明 |
|---|---|---|---|
index_code | 否 | string | 指數代碼,例如 TWSE_TAIEX。IX0001 在此端點不是有效代碼。 |
market | 否 | string | 市場別。TWSE 有資料;TPEX 目前無回傳列。 |
start_date | 否 | string | 查詢起始日期(YYYY-MM-DD)。 |
end_date | 否 | string | 查詢結束日期(YYYY-MM-DD)。 |
limit | 否 | integer | 回傳筆數上限;超過 500 端點會回 validation_error。 |
import requests
resp = requests.get(
"https://api.twmarketdata.com/v2/datasets/market-index",
params={"index_code": "TWSE_TAIEX", "market": "TWSE", "limit": "5"},
headers={"X-API-Key": "sk_live_..."},
)
resp.raise_for_status()
print(resp.json()["items"])此端點為 GET /v2/datasets/market-index。完整機器可讀 schema(參數、認證、回應封裝)見 OpenAPI spec。