AI agent?先讀 /llms.txt 取得全站索引。
籌碼與資金
三大法人每交易日全市場買賣超彙總,由官方 T86 報表跨全體上市股票加總而得。
GET /v2/datasets/institutional-flow-market-aggregateinstitutional-flow-market-aggregate 為推導型資料集:將官方 TWSE T86 報表中每檔股票的外資、投信、自營商買賣超加總為每交易日一列的全市場資料,讓 agent 無須逐檔抓取加總即可讀取整體法人動向;lineage 欄位回指底層 T86 來源,彙總值可稽核。
| 欄位 | 型別 | 說明 |
|---|---|---|
date | string | 交易日。 |
foreign_net | number | 全市場外資買賣超(股)。 |
trust_net | number | 全市場投信買賣超(股)。 |
dealer_net | number | 全市場自營商買賣超(股)。 |
total_net | number | 三大法人合計買賣超(股)。 |
source_role | string | 正規來源角色(derived_twse_institutional_aggregate)。 |
| 列數 | 11,744,999 |
| 涵蓋起訖 | 2012-05-02 至 2026-07-17 |
| 分級 | 衍生 |
此為本端點的真實回應。資料列位於 "items" 之下,來源資訊如下方所示;各資料集形狀不盡相同,請以本頁為準。
{ "dataset_id": "institutional-flow-market-aggregate", "row_count": 50, "status": "ok", "items": [ { "generated_at": "2026-07-20T18:33:56Z", "trade_date": "2026-07-17", "market": "TWSE", "foreign_net_buy": -1272145532, "investment_trust_net_buy": 29630849, "dealer_net_buy": -3197999349, "institutional_net_buy_total": -4440514032, "constituent_row_count": 1337, "source_lineage": { "provider": "twse_t86", "source_role": "official_twse_t86", "source_table": "institutional_flow_items", "derived_from_dataset": "institutional_flow", "derivation_method": "group_by_trade_date_market_sum", "derived_from_official_twse_t86_constituents": true }, "data_gaps": [], "coverage_window": { "min_trade_date": "2026-05-04", "max_trade_date": "2026-07-17" }, "safe_usage_notes": [ "aggregate_not_single_stock_signal", "do_not_forward_fill_missing_chip_days_without_policy", "source_specific_methodology_may_change" ], "not_investment_advice": true, "available_tools_or_endpoints": [ { "name": "institutional_flow", "path": "/v2/datasets/institutional-flow" }, { "name": "institutional_flow_market_aggregate", "path": "/v2/datasets/institutional-flow-market-aggregate" } ], "db_write_executed": false }, { "generated_at": "2026-07-20T18:33:56Z", "trade_date": "2026-07-16", "market": "TWSE", "foreign_net_buy": 3387389, "investment_trust_net_buy": -23517807, "dealer_net_buy": -313350914, "institutional_net_buy_total": -333481332, "constituent_row_count": 1327, "source_lineage": { "provider": "twse_t86", "source_role": "official_twse_t86", "source_table": "institutional_flow_items", "derived_from_dataset": "institutional_flow", "derivation_method": "group_by_trade_date_market_sum", "derived_from_official_twse_t86_constituents": true }, "data_gaps": [], "coverage_window": { "min_trade_date": "2026-05-04", "max_trade_date": "2026-07-17" }, "safe_usage_notes": [ "aggregate_not_single_stock_signal", "do_not_forward_fill_missing_chip_days_without_policy", "source_specific_methodology_may_change" ], "not_investment_advice": true, "available_tools_or_endpoints": [ { "name": "institutional_flow", "path": "/v2/datasets/institutional-flow" }, { "name": "institutional_flow_market_aggregate", "path": "/v2/datasets/institutional-flow-market-aggregate" } ], "db_write_executed": false } ], "safe_usage_notes": [ "not_investment_advice", "twse_only_scope", "aggregate_not_single_stock_signal" ]}擷取自 2026-07-20 的線上 API。
curl "https://api.twmarketdata.com/v2/datasets/institutional-flow-market-aggregate?symbol=2330" \ -H "X-API-Key: sk_live_..."| 參數 | 必填 | 型別 | 說明 |
|---|---|---|---|
symbol | 是 | string | 股票代碼,例如 2330。 |
start_date | 否 | string (YYYY-MM-DD) | 查詢起始日期。 |
end_date | 否 | string (YYYY-MM-DD) | 查詢結束日期。 |
limit | 否 | integer | 回傳筆數上限。 |
第一個呼叫:
import requests resp = requests.get( "https://api.twmarketdata.com/v2/datasets/institutional-flow-market-aggregate", 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/institutional-flow-market-aggregate", params={"symbol": "2330"}, headers={"X-API-Key": "sk_live_..."},)resp.raise_for_status()for row in resp.json()["items"]: print(row)此端點為 GET /v2/datasets/institutional-flow-market-aggregate。完整機器可讀 schema(參數、認證、回應封裝)見 OpenAPI spec。