AI agent?先讀 /llms.txt 取得全站索引。
市場結構與參考
主題分類——由 TWMD 維護的投資主題參考樹,及每個主題所歸類的產業/概念。
GET /v2/datasets/theme-taxonomytheme-taxonomy 為參考型資料集:每個主題節點一筆紀錄,描述 TWMD 用來歸類證券的分類樹。用於將主題代碼解析為名稱與上層節點,或列舉可供標記的主題。此為策展快照,非時間序列。
| 欄位 | 型別 | 說明 |
|---|---|---|
theme_id | string | 穩定主題識別碼。 |
theme_name | string | 主題顯示名稱。 |
parent_id | string | 上層主題代碼(根節點為 null)。 |
level | number | 分類樹層級深度。 |
source_role | string | twmd_theme_taxonomy。 |
| 列數 | 2,160 |
| 涵蓋起訖 | 2026-05-30(單日快照) |
| 分級 | 參考 |
此為本端點的真實回應。資料列位於 "envelope.data" 之下,來源資訊如下方所示;各資料集形狀不盡相同,請以本頁為準。
{ "api_version": "v2", "endpoint": "/v2/datasets/theme-taxonomy", "request_id": "req_8e048197993f", "plan_id": "enterprise", "dataset": "theme_taxonomy", "query": { "symbol": "2330", "theme": null, "taxonomy_type": null, "market": null, "as_of_date": null, "limit": 50, "legacy_alias_ticker": null, "legacy_alias_theme_primary": null }, "meta": { "rows_returned": 2, "mandatory_contract_fields_present": [ "api_version", "data", "data_as_of" ], "plan": "enterprise", "row_limit": 100000, "is_limited": false }, "envelope": { "api_version": "v2", "dataset": "theme_taxonomy", "dataset_version": "v2.0.0-preview", "release_version": "v2.2026-05-30.preview", "release_date": "2026-05-30", "data_as_of": "2026-05-30", "request_context": { "ticker": "2330", "as_of_date": "2026-05-30", "family": "discovery_reference", "field_group_type": "derived", "dataset_view": "theme_taxonomy_v1", "supported_sort_by": [ "as_of_date" ], "supported_filter_fields": [ "symbol", "theme", "taxonomy_type" ] }, "data": [ { "symbol": "2330", "theme_id": "24", "theme_name": "24", "taxonomy_type": "industry", "market": "TWSE", "classification_level": "2", "source_name": "tw_feature_engine", "source_url": null, "as_of_date": "2026-05-30", "source_role": "derived_theme_taxonomy", "lineage": { "sources": [ "issuer_profiles", "ticker_metadata" ], "theme_policy": "theme fields only from explicit issuer_classification_map entries; no AI inference", "mapping_version": "theme_taxonomy_v1", "taxonomy_version": "v1", "subindustry_policy": "from issuer_classification_map taxonomy subindustry/sub_industry only" }, "updated_at": "2026-06-19T05:46:08.775720" }, { "symbol": "2330", "theme_id": "24", "theme_name": "24", "taxonomy_type": "sector", "market": "TWSE", "classification_level": "1", "source_name": "tw_feature_engine", "source_url": null, "as_of_date": "2026-05-30", "source_role": "derived_theme_taxonomy", "lineage": { "sources": [ "issuer_profiles", "ticker_metadata" ], "theme_policy": "theme fields only from explicit issuer_classification_map entries; no AI inference", "mapping_version": "theme_taxonomy_v1", "taxonomy_version": "v1", "subindustry_policy": "from issuer_classification_map taxonomy subindustry/sub_industry only" }, "updated_at": "2026-06-19T05:46:08.775720" } ], "quality": { "freshness_state": "fresh", "freshness_as_of": "2026-05-30", "completeness_ratio": 1, "quality_status": "ready" }, "lineage": { "source_role": "canonical", "selected_source": "issuer_classification_map", "fallback_chain": [ "issuer_profiles", "ticker_metadata" ], "policy_notes": [ "official/public-first canonical", "theme_taxonomy uses deterministic mapping only from explicit classification map entries", "ai/confidence/cluster/rank fields excluded from public contract" ] }, "error": { "error_code": null, "error_message": null, "dataset": "theme_taxonomy", "request_id": "read-api-f235e586efe2", "blocking_gate": null } }}擷取自 2026-07-20 的線上 API。
curl "https://api.twmarketdata.com/v2/datasets/theme-taxonomy?symbol=2330" \ -H "X-API-Key: sk_live_..."| 參數 | 必填 | 型別 | 說明 |
|---|---|---|---|
symbol | 否 | string | 以股票代碼篩選單一標的。 |
limit | 否 | integer | 回傳筆數上限。 |
第一個呼叫:
import requests resp = requests.get( "https://api.twmarketdata.com/v2/datasets/theme-taxonomy", params={"symbol": "2330"}, headers={"X-API-Key": "sk_live_..."},)resp.raise_for_status()print(resp.json()["envelope"]["data"])帶日期區間篩選:
import requests # The full verified example — the same call with every supported filter set.resp = requests.get( "https://api.twmarketdata.com/v2/datasets/theme-taxonomy", params={"symbol": "2330"}, headers={"X-API-Key": "sk_live_..."},)resp.raise_for_status()for row in resp.json()["envelope"]["data"]: print(row)此端點為 GET /v2/datasets/theme-taxonomy。完整機器可讀 schema(參數、認證、回應封裝)見 OpenAPI spec。