AI agent?先讀 /llms.txt 取得全站索引。
市場與價格
大波動日情境卡:每筆為某股某交易日大幅變動時的情境(|Δ%|≥5% 或相對大盤超額≥4%,不分方向),含當日漲跌幅、量能分級、era 近似漲跌停旗標、同日法人淨額/融資增減/當沖比,及當日官方事件。衍生自正規化價格+加權指數+官方事件/除息/籌碼表。非預測、非建議。
GET /v2/datasets/price-move-context即將開放——此資料集建置中,尚未可透過 API 查詢。下方涵蓋與誠實限制為真實資料庫狀態;serving 上線(預計 8/1)後脫離「建置中」。
| 欄位 | 型別 | 說明 |
|---|---|---|
pct_change | ratio | stock daily return |
market_pct_change | ratio | TAIEX return; NULL on TAIEX-gap days |
relative_to_market | ratio | stock−market excess (signed) |
magnitude_bucket | enum | <5 / >=5 / >=9.5 … |
hit_track | enum | absolute / relative / both |
limit_move_flag | bool | era-approx limit hit |
limit_move_flag_method | enum | 'approx' (v0) |
events | json | official events on date; [] if none |
inst_net | shares | institutional net |
margin_delta | lots | margin balance Δ |
day_trade_ratio | ratio | day-trade share |
266,097 列,2010-01-04 至 2026-07-21。起始 2010(2010 前漲跌幅未建置);約 115 個加權指數缺口日(約 18,000 列)market_pct_change 為 NULL、僅絕對軌;漲跌停旗標 era-approx(2015-06-01 前 ±7% / 後 ±10%),method='approx' 待 R-02。門檻版本 pmc_v1。
此為本端點的真實回應。資料列位於 "data" 之下,來源資訊如下方所示;各資料集形狀不盡相同,請以本頁為準。
{ "dataset_id": "price-move-context", "row_count": 3, "data": [ { "symbol": "2383", "trade_date": "2024-03-08", "market": "TWSE", "pct_change": -0.06130268, "market_pct_change": 0.0047, "relative_to_market": -0.06600268, "magnitude_bucket": "5-7", "hit_track": "both", "limit_move_flag": false, "limit_move_flag_method": "approx", "inst_net": -1674540.0, "margin_delta": 149.0, "day_trade_ratio": 0.43539399, "threshold_version": "pmc_v1" }, { "symbol": "2383", "trade_date": "2024-03-12", "market": "TWSE", "pct_change": -0.09274194, "market_pct_change": 0.0096, "relative_to_market": -0.10234194, "magnitude_bucket": "7-9.5", "hit_track": "both", "limit_move_flag": false, "limit_move_flag_method": "approx", "inst_net": -3745311.0, "margin_delta": 211.0, "day_trade_ratio": 0.30444614, "threshold_version": "pmc_v1" }, { "symbol": "2383", "trade_date": "2024-03-13", "market": "TWSE", "pct_change": -0.1, "market_pct_change": 0.0007, "relative_to_market": -0.1007, "magnitude_bucket": ">=9.5", "hit_track": "both", "limit_move_flag": true, "limit_move_flag_method": "approx", "inst_net": -3728133.0, "margin_delta": 1090.0, "day_trade_ratio": 0.34246184, "threshold_version": "pmc_v1" } ]}擷取自 2026-07-20 的線上 API。
curl "https://api.twmarketdata.com/v2/datasets/price-move-context?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/price-move-context", 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/price-move-context", params={"symbol": "2330"}, headers={"X-API-Key": "sk_live_..."},)resp.raise_for_status()for row in resp.json()["data"]: print(row)此端點為 GET /v2/datasets/price-move-context。完整機器可讀 schema(參數、認證、回應封裝)見 OpenAPI spec。