Taiwan Market Open Data (Unofficial)
Unofficial. TWSE & TAIFEX open data for AI: stock, ETF & futures snapshots, quotes, 270+ datasets.
Sollte ich dies verwenden
Qualität und Sicherheit
Befunde (4)
- LOWin twse_describe_dataset
- LOWin twse_etf_snapshot
- LOWin twse_lookup
- LOWin twse_stock_snapshot
Basierend auf einer automatisierten Analyse der Tool-Definitionen und der Einhaltung des Protokolls.
Kontextkosten
Dies ist die ungefähre Anzahl der Tokens, die jedes Mal verbraucht werden, wenn die Tools des Servers in den Kontext eines Modells geladen werden. Höhere Werte verringern die Aufmerksamkeit, die für andere Aufgaben verfügbar ist.
Installieren
Installation mit einem Klick
Fügen Sie dies Ihrer Datei `claude_desktop_config.json` hinzu:
{
"mcpServers": {
"twse-mcp": {
"url": "https://twse-mcp.taux.io/mcp"
}
}
}Remote-Endpunkte
https://twse-mcp.taux.io/mcpstreamable-httpWas es kann
Tool-Inventar
Tools (7)
🟢twse_search_datasets(query, tag, limit)
搜尋臺灣證交所與期交所 OpenAPI 有哪些資料集可用。取資料前先用這個找 dataset_id。會比對資料集代號、中文說明與欄位名稱;多個關鍵字用空白分隔(每個都要命中),結果依相關度排序。期交所的資料集代號一律以 taifex/ 開頭,搜期貨與選擇權可用 tag="期貨與選擇權"。
Eingabe-Schema
{
"type": "object",
"properties": {
"query": {
"default": "",
"description": "關鍵字,例如 \"ETF\"、\"融資\"、\"三大法人 期貨\"。留空列出全部。",
"type": "string"
},
"tag": {
"default": "",
"description": "依分類過濾,例如 \"證券交易\"、\"公司治理\"、\"財務報表\"。",
"type": "string"
},
"limit": {
"default": 25,
"description": "最多回傳幾筆(預設 25)。",
"type": "integer",
"minimum": 0,
"maximum": 9007199254740991
}
},
"$schema": "https://json-schema.org/draft/2020-12/schema"
}🟢twse_describe_dataset(dataset_id)
查看某個資料集的完整欄位定義,取資料前用來確認要過濾/投影哪些欄位。
Eingabe-Schema
{
"type": "object",
"properties": {
"dataset_id": {
"type": "string",
"description": "來自 twse_search_datasets 的資料集代號,例如 \"exchangeReport/STOCK_DAY_ALL\"。"
}
},
"required": [
"dataset_id"
],
"$schema": "https://json-schema.org/draft/2020-12/schema"
}🟢twse_get_dataset(dataset_id, code, match, where, sort_by, ...)
取得證交所或期交所資料集內容,支援伺服器端過濾、欄位投影與分頁。兩邊的每個資料集都是一次回整份(可能上萬筆),務必用 code/match/where/fields 縮小範圍。排名與篩選(殖利率最高的前 20 檔、本益比低於 10 的股票)用 where + sort_by,不要自己翻頁比大小。
Eingabe-Schema
{
"type": "object",
"properties": {
"dataset_id": {
"type": "string",
"description": "資料集代號,例如 \"exchangeReport/STOCK_DAY_ALL\"。"
},
"code": {
"default": "",
"description": "證券/基金/契約代號,例如 \"0050\"、\"TX\"。一律精確比對(不分大小寫),實際用了哪個欄位會回在 code_field_used。找不到完全相符的代號時回 0 筆,並在 code_candidates 給出拼法相近的代號——**那些是候選不是答案**,可能是不同商品(MXF 與 MXFFX 是不同契約),請確認後改用該代號重查,不要直接引用它們的數字。",
"type": "string"
},
"match": {
"description": "其他欄位的子字串過濾,例如 {\"基金類型\": \"ETF\"}。最多 20 個欄位。",
"type": "object",
"propertyNames": {
"type": "string"
},
"additionalProperties": {
"type": "string"
}
},
"where": {
"description": "數值條件,全部都要成立。例如本益比低於 10、殖利率至少 5%:[{\"field\":\"PEratio\",\"op\":\"lt\",\"value\":10},{\"field\":\"DividendYield\",\"op\":\"gte\",\"value\":5}]。欄位值會去逗號轉數字;空值或非數字(例如虧損公司的本益比)無法比較,會被排除並回報筆數。",
"maxItems": 10,
"type": "array",
"items": {
"type": "object",
"properties": {
"field": {
"type": "string"
},
"op": {
"type": "string",
"enum": [
"gt",
"gte",
"lt",
"lte",
"eq",
"ne"
]
},
"value": {
"type": "number"
}
},
"required": [
"field",
"op",
"value"
]
}
},
"sort_by": {
"default": "",
"description": "依這個欄位排序,在分頁之前做——要「前 N 名」就用它配 limit。多數值是數字就依數值排,否則依字串排;空值與非數字一律排最後。",
"type": "string"
},
"order": {
"default": "desc",
"description": "\"desc\"(大到小,預設)或 \"asc\"。",
"type": "string",
"enum": [
"desc",
"asc"
]
},
"fields": {
"description": "只回傳這些欄位。",
"maxItems": 100,
"type": "array",
"items": {
"type": "string"
}
},
"limit": {
"default": 30,
"description": "回傳筆數上限(硬上限 200)。",
"type": "integer",
"minimum": 0,
"maximum": 9007199254740991
},
"offset": {
"default": 0,
"description": "分頁位移。",
"type": "integer",
"minimum": 0,
"maximum": 9007199254740991
}
},
"required": [
"dataset_id"
],
"$schema": "https://json-schema.org/draft/2020-12/schema"
}🟢twse_etf_snapshot(code, include_realtime)
一次取得單一上市 ETF 的完整概況:基本資料 + 前一交易日價量 + 定期定額熱度。價量為前一交易日,不是盤中即時;要當下價格請用 twse_realtime_quote。合併三個證交所資料集並行查詢。任何一段查不到都會標成 null 並記在 caveats,不會整個失敗。
Eingabe-Schema
{
"type": "object",
"properties": {
"code": {
"type": "string",
"description": "ETF 代號,例如 \"0056\"、\"0050\"、\"00878\"。"
},
"include_realtime": {
"default": false,
"description": "是否附上盤中即時報價。預設 false,需要當下價格時才帶 true(多一次外呼)。",
"type": "boolean"
}
},
"required": [
"code"
],
"$schema": "https://json-schema.org/draft/2020-12/schema"
}🟢twse_lookup(query, limit)
用名稱或代號找上市公司與上市基金(含 ETF)的代號。使用者只講名稱(「台積電」「元大高股息」)時先用這個取得代號,不要憑印象猜代號。比對公司簡稱、全名、英文簡稱與代號,不分全半形與台/臺。只收上市標的;上櫃公司的名稱對照取不到。
Eingabe-Schema
{
"type": "object",
"properties": {
"query": {
"type": "string",
"minLength": 1,
"description": "名稱或代號,例如 \"台積電\"、\"TSMC\"、\"高股息\"、\"2330\"。"
},
"limit": {
"default": 10,
"description": "最多回傳幾筆(預設 10,上限 50)。",
"type": "integer",
"minimum": 1,
"maximum": 50
}
},
"required": [
"query"
],
"$schema": "https://json-schema.org/draft/2020-12/schema"
}🟢twse_stock_snapshot(code)
一次取得單一上市公司的完整概況:基本資料、前一交易日價量、本益比/殖利率/股價淨值比、最新月營收(含月增率與年增率)、近期除權除息預告、是否為注意股或處置股,以及市值。合併七個證交所資料集。價量為前一交易日,不是盤中即時;要當下價格請用 twse_realtime_quote。ETF 請用 twse_etf_snapshot。任何一段查不到都會標成 null 並記在 caveats,不會整個失敗。
Eingabe-Schema
{
"type": "object",
"properties": {
"code": {
"type": "string",
"description": "上市公司股票代號,例如 \"2330\"、\"2317\"。只知道名稱時先用 twse_lookup。"
}
},
"required": [
"code"
],
"$schema": "https://json-schema.org/draft/2020-12/schema"
}🟢twse_realtime_quote(codes, market)
取得盤中即時報價(約 5 秒更新一次)。OpenAPI 只有前一交易日資料,要當下的價格得走基本市況報導站。ETF 與上市股票用 market="tse",上櫃用 "otc"。
Eingabe-Schema
{
"type": "object",
"properties": {
"codes": {
"maxItems": 50,
"type": "array",
"items": {
"type": "string",
"pattern": "^[0-9A-Za-z]{1,10}$"
},
"description": "代號清單,例如 [\"0050\", \"0056\", \"2330\"]。"
},
"market": {
"default": "tse",
"description": "\"tse\"(上市)或 \"otc\"(上櫃)。",
"type": "string",
"enum": [
"tse",
"otc"
]
}
},
"required": [
"codes"
],
"$schema": "https://json-schema.org/draft/2020-12/schema"
}Community
Nachweis