AI agent?先讀 /llms.txt 取得全站索引。
市場與價格
指數分類——將每個指數代碼對映到所屬家族與類別(大盤、類股、主題)的參考查表。
GET /v2/datasets/index-classificationindex-classification 為參考型資料集:每個指數一筆紀錄,描述其在 TWSE 指數體系中的位置。用於將指數代碼解析為名稱與類別,或列舉某家族下的指數。此為查表快照,非水準時間序列。
| 欄位 | 型別 | 說明 |
|---|---|---|
index_code | string | 指數代碼。 |
index_name | string | 指數顯示名稱。 |
category | string | 分類(大盤/類股/主題)。 |
family | string | 指數代碼所屬家族。 |
source_role | string | 正規來源角色(official_twse_index_master)。 |
| 列數 | 5 |
| 涵蓋起訖 | 2026-05-22 至 2026-05-28 |
| 分級 | 參考 |
TODO —— 尚未擷取到此資料集的真實回應(需要有權限的 API 金鑰,或其必填參數尚未確認)。寧可留白,也不顯示未經實測的範例。
curl "https://api.twmarketdata.com/v2/datasets/index-classification?symbol=2330" \ -H "X-API-Key: sk_live_..."| 參數 | 必填 | 型別 | 說明 |
|---|---|---|---|
symbol | 否 | string | 以股票代碼篩選單一標的。 |
limit | 否 | integer | 回傳筆數上限。 |
第一個呼叫:
import requests resp = requests.get( "https://api.twmarketdata.com/v2/datasets/index-classification", params={"symbol": "2330"}, headers={"X-API-Key": "sk_live_..."},)resp.raise_for_status()print(resp.json())帶日期區間篩選:
import requests # The full verified example — the same call with every supported filter set.resp = requests.get( "https://api.twmarketdata.com/v2/datasets/index-classification", params={"symbol": "2330"}, headers={"X-API-Key": "sk_live_..."},)resp.raise_for_status()print(resp.json())此端點為 GET /v2/datasets/index-classification。完整機器可讀 schema(參數、認證、回應封裝)見 OpenAPI spec。