AI agent?先讀 /llms.txt 取得全站索引。
市場結構與參考
股票主檔——每檔上市櫃證券的現用參考資料(識別、上市櫃別、產業)。
GET /v2/datasets/security-mastersecurity-master 為參考型資料集:每檔證券一筆現用紀錄,非時間序列。用於將代碼解析為名稱、上市櫃別與產業。此為現用快照——完整 point-in-time 生命週期(更名、下市)尚未整合。
| 欄位 | 型別 | 說明 |
|---|---|---|
symbol | string | 股票代碼。 |
name | string | 證券名稱。 |
board | string | 上市櫃別(TWSE/TPEx)。 |
industry | string | 產業分類。 |
source_role | string | official_twse_issuer_profile。 |
| 列數 | 91,660 |
| 涵蓋起訖 | 參考資料,無時間序列 |
| 分級 | 參考 |
此為本端點的真實回應。資料列位於 "items" 之下,來源資訊如下方所示;各資料集形狀不盡相同,請以本頁為準。
{ "generated_at": "2026-07-20T18:31:32Z", "dataset_id": "security-master", "as_of_date": "2026-07-20", "row_count": 50, "survivorship_bias_warning": { "enabled": true, "level": "warning", "message": "Current security master is not point-in-time complete; survivorship bias may exist for backtests." }, "items": [ { "generated_at": "2026-07-20T18:31:32Z", "as_of_date": "2026-07-20", "ticker": "1260", "security_identity": { "ticker": "1260", "name_zh": "富味鄉", "name_en": null, "security_type": "common_stock", "is_active": true }, "market_identity": { "market": "Emerging", "source_provider": "twse_isin_public", "source_role": "canonical", "source_confidence": "high" }, "dataset_coverage": { "price": "unknown", "technical_indicators": "unknown", "margin_short": "unknown", "valuation": "unknown", "financials": "unknown" }, "source_lineage": { "isin": "TW0001260008", "source": "TWSE ISIN C_public.jsp", "source_market": "Emerging", "market_section": "興櫃" }, "data_gaps": [], "safe_usage_notes": [ "current_master_not_survivorship_safe_for_backtests", "not_investment_advice" ], "survivorship_bias_warning": { "enabled": true, "level": "warning", "message": "Current security master is not point-in-time complete; survivorship bias may exist for backtests." }, "available_tools_or_endpoints": [ { "name": "security_master_lookup", "path": "/v2/read/mcp-tool" }, { "name": "security_master_dataset", "path": "/v2/datasets/security-master" }, { "name": "security_lookup", "path": "/v2/securities/{ticker}" } ] }, { "generated_at": "2026-07-20T18:31:32Z", "as_of_date": "2026-07-20", "ticker": "1269", "security_identity": { "ticker": "1269", "name_zh": "乾杯", "name_en": null, "security_type": "common_stock", "is_active": true }, "market_identity": { "market": "Emerging", "source_provider": "twse_isin_public", "source_role": "canonical", "source_confidence": "high" }, "dataset_coverage": { "price": "unknown", "technical_indicators": "unknown", "margin_short": "unknown", "valuation": "unknown", "financials": "unknown" }, "source_lineage": { "isin": "TW0001269009", "source": "TWSE ISIN C_public.jsp", "source_market": "Emerging", "market_section": "興櫃" }, "data_gaps": [], "safe_usage_notes": [ "current_master_not_survivorship_safe_for_backtests", "not_investment_advice" ], "survivorship_bias_warning": { "enabled": true, "level": "warning", "message": "Current security master is not point-in-time complete; survivorship bias may exist for backtests." }, "available_tools_or_endpoints": [ { "name": "security_master_lookup", "path": "/v2/read/mcp-tool" }, { "name": "security_master_dataset", "path": "/v2/datasets/security-master" }, { "name": "security_lookup", "path": "/v2/securities/{ticker}" } ] } ], "safe_usage_notes": [ "not_investment_advice", "official_first_source_policy", "active_snapshot_only" ], "available_tools_or_endpoints": [ { "name": "security_master_lookup", "path": "/v2/read/mcp-tool" }, { "name": "security_master_dataset", "path": "/v2/datasets/security-master" }, { "name": "security_lookup", "path": "/v2/securities/{ticker}" } ]}擷取自 2026-07-20 的線上 API。
本頁顯示原始中文值;英文頁會以標記取代,以維持全英文。
curl "https://api.twmarketdata.com/v2/datasets/security-master?symbol=2330" \ -H "X-API-Key: sk_live_..."| 參數 | 必填 | 型別 | 說明 |
|---|---|---|---|
symbol | 否 | string | 以股票代碼篩選單一標的。 |
limit | 否 | integer | 回傳筆數上限。 |
第一個呼叫:
import requests resp = requests.get( "https://api.twmarketdata.com/v2/datasets/security-master", params={"symbol": "2330"}, headers={"X-API-Key": "sk_live_..."},)resp.raise_for_status()print(resp.json()["items"])帶日期區間篩選:
import requests # The full verified example — the same call with every supported filter set.resp = requests.get( "https://api.twmarketdata.com/v2/datasets/security-master", params={"symbol": "2330"}, headers={"X-API-Key": "sk_live_..."},)resp.raise_for_status()for row in resp.json()["items"]: print(row)此端點為 GET /v2/datasets/security-master。完整機器可讀 schema(參數、認證、回應封裝)見 OpenAPI spec。