AI agent?先讀 /llms.txt 取得全站索引。
市場結構與參考
股票主檔——每檔上市櫃證券的現用參考資料(識別、上市櫃別、產業)。
GET /v2/datasets/security-master股票主檔是台灣市場資料集,來源為 TWSE / TPEx,由 TW Market Data 以 GET /v2/datasets/security-master 提供。
security-master 為參考型資料集:每檔證券一筆現用紀錄,非時間序列。用於將代碼解析為名稱、上市櫃別與產業。此為現用快照——完整 point-in-time 生命週期(更名、下市)尚未整合。
| 欄位 | 型別 | 說明 |
|---|---|---|
generated_at | string | |
as_of_date | string | |
ticker | string | |
security_identity | object | |
market_identity | object | |
dataset_coverage | object | |
safe_usage_notes | array | |
survivorship_bias_warning | object | |
available_tools_or_endpoints | array |
| 列數 | 約 70,760 |
| 涵蓋起訖 | 2025-09-01 – 2026-09-04 |
| 分級 | 參考 |
| 量測時間 | 2026-09-05取自資料集登錄表 |
此為本端點的真實回應。資料列位於 "items" 之下,來源資訊如下方所示;各資料集形狀不盡相同,請以本頁為準。
{
"generated_at": "2026-08-06T05:14:55Z",
"dataset_id": "security-master",
"as_of_date": "2026-08-06",
"row_count": 1,
"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-08-06T05:14:55Z",
"as_of_date": "2026-08-06",
"ticker": "2114",
"security_identity": {
"ticker": "2114",
"name_zh": "鑫永銓股份有限公司",
"name_en": null,
"security_type": "common_stock",
"is_active": true
},
"market_identity": {
"market": "TWSE",
"source_provider": "twse_official",
"source_role": "official_twse_issuer_profile",
"source_confidence": "high"
},
"dataset_coverage": {
"price": "available",
"technical_indicators": "available",
"margin_short": "available",
"valuation": "partial",
"financials": "partial"
},
"source_lineage": {
"emitter": "build_reference_refresh_candidates",
"source_policy": "official_first",
"selected_source": "official_twse_issuer_profile",
"source_as_of_date": "2026-08-03"
},
"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。
本頁顯示原始中文值;英文頁會以標記取代,以維持全英文。
以下欄位會隨資料一併回傳,記錄這一列的來源。它們屬於出處而非本資料集要講的事實,因此列在這裡而不進欄位表。
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/structure-reference/security-master
版本取自資料集自己的 as_of,不是這一頁的產生日期。沒有 as_of 的資料集就不列這個欄位,不會補一個看起來合理的值。 驗證簽章
可與本資料集對齊的其他資料集。每組都標出可用來 join 的欄位,規劃跨表查詢時不必自己猜。
可用 as_of_date + ticker 對齊
可用 as_of_date + ticker 對齊
可用 as_of_date + ticker 對齊
可用 as_of_date + ticker 對齊
可用 as_of_date + ticker 對齊
curl "https://api.twmarketdata.com/v2/datasets/security-master?ticker=2114" \
-H "X-API-Key: sk_live_..."| 參數 | 必填 | 型別 | 說明 |
|---|---|---|---|
symbol | 否 | string | 以股票代碼篩選單一標的。 |
limit | 否 | integer | 回傳筆數上限。 |
import requests
resp = requests.get(
"https://api.twmarketdata.com/v2/datasets/security-master",
params={"ticker": "2114"},
headers={"X-API-Key": "sk_live_..."},
)
resp.raise_for_status()
print(resp.json()["items"])此端點為 GET /v2/datasets/security-master。完整機器可讀 schema(參數、認證、回應封裝)見 OpenAPI spec。