AI agent?先讀 /llms.txt 取得全站索引。
籌碼與資金
法人持倉深化:每筆為某股某日之外資/投信/自營商淨買賣與合計、外資持股比與其歷史分位、連買賣天數、法人成交量占比。衍生自外資持股+法人買賣超家族。非預測、非建議。
GET /v2/datasets/institutional-positioning即將開放——此資料集建置中,尚未可透過 API 查詢。下方涵蓋與誠實限制為真實資料庫狀態;serving 上線(預計 8/1)後脫離「建置中」。
| 欄位 | 型別 | 說明 |
|---|---|---|
foreign_net_buy | shares | |
investment_trust_net_buy | shares | |
dealer_net_buy | shares | |
institutional_net_buy_total | shares | |
foreign_pct | ratio | |
foreign_pct_percentile | ratio | within-history rank, NOT a rating |
buy_streak | days | |
sell_streak | days | |
inst_share_of_volume | ratio | NULL where volume absent |
每股每日,約 2013 起。foreign_pct_percentile 為歷史內分位座標(非評級);法人成交量占比在無量資料處為 NULL。此為重聚合視圖,查詢須以個股+日期界定(全表掃描會逾時)。
此為本端點的真實回應。資料列位於 "data" 之下,來源資訊如下方所示;各資料集形狀不盡相同,請以本頁為準。
{ "dataset_id": "institutional-positioning", "row_count": 3, "data": [ { "ticker": "2330", "market": "TWSE", "trade_date": "2026-07-16", "foreign_net_buy": -4214736.0, "investment_trust_net_buy": 528374.0, "dealer_net_buy": 1061380.0, "institutional_net_buy_total": -2624982.0, "foreign_pct": null, "foreign_pct_percentile": null, "buy_streak": 0, "sell_streak": 6 }, { "ticker": "2330", "market": "TWSE", "trade_date": "2026-07-15", "foreign_net_buy": -3427281.0, "investment_trust_net_buy": -596431.0, "dealer_net_buy": 455841.0, "institutional_net_buy_total": -3567871.0, "foreign_pct": null, "foreign_pct_percentile": null, "buy_streak": 0, "sell_streak": 5 }, { "ticker": "2330", "market": "TWSE", "trade_date": "2026-07-14", "foreign_net_buy": -12416209.0, "investment_trust_net_buy": 1841069.0, "dealer_net_buy": 2569779.0, "institutional_net_buy_total": -8005361.0, "foreign_pct": 69.54, "foreign_pct_percentile": 0.105088, "buy_streak": 0, "sell_streak": 4 } ]}擷取自 2026-07-20 的線上 API。
curl "https://api.twmarketdata.com/v2/datasets/institutional-positioning?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-positioning", params={"symbol": "2330"}, headers={"X-API-Key": "sk_live_..."},)resp.raise_for_status()print(resp.json()["data"])帶日期區間篩選:
import requests # The full verified example — the same call with every supported filter set.resp = requests.get( "https://api.twmarketdata.com/v2/datasets/institutional-positioning", params={"symbol": "2330"}, headers={"X-API-Key": "sk_live_..."},)resp.raise_for_status()for row in resp.json()["data"]: print(row)此端點為 GET /v2/datasets/institutional-positioning。完整機器可讀 schema(參數、認證、回應封裝)見 OpenAPI spec。