AI agent?先讀 /llms.txt 取得全站索引。
衍生與可轉債
期貨日情境:每筆為某契約某日的近月期貨收盤對現貨指數(基差、基差%)、未平倉量與日變動、距結算日與結算旗標、三大法人淨未平倉、賣買權比。衍生自 TAIFEX 期貨日資料+現貨指數。非預測、非建議。
GET /v2/datasets/futures-daily-context即將開放——此資料集建置中,尚未可透過 API 查詢。下方涵蓋與誠實限制為真實資料庫狀態;serving 上線(預計 8/1)後脫離「建置中」。
| 欄位 | 型別 | 說明 |
|---|---|---|
futures_close | index_pts | |
spot_close | index_pts | |
basis | index_pts | futures−spot |
basis_pct | ratio | |
open_interest | contracts | |
oi_delta | contracts | daily Δ |
days_to_settlement | days | |
settlement_flag | bool | |
inst_net_oi_foreign | contracts | NULL pre-2023-07 |
put_call_ratio | ratio | NULL where no options data |
6,923 列,1998-07-21 至 2026-07-16。三大法人淨未平倉欄僅在 TAIFEX 法人 OI 存在處有值(免費源=2023-07 起三年滾動),之前為 NULL;賣買權比僅在選擇權資料存在處有值。
此為本端點的真實回應。資料列位於 "data" 之下,來源資訊如下方所示;各資料集形狀不盡相同,請以本頁為準。
{ "dataset_id": "futures-daily-context", "row_count": 3, "data": [ { "contract": "TX", "trade_date": "2026-07-16", "near_contract_month": "202608", "futures_close": 45700.0, "spot_close": 45624.98, "basis": 75.02, "basis_pct": 0.1644, "open_interest": 106669.0, "oi_delta": 95677.0, "days_to_settlement": 34, "put_call_ratio": null }, { "contract": "TX", "trade_date": "2026-07-15", "near_contract_month": "202607", "futures_close": 45830.0, "spot_close": 45631.59, "basis": 198.41, "basis_pct": 0.4348, "open_interest": 10992.0, "oi_delta": -9070.0, "days_to_settlement": 0, "put_call_ratio": null }, { "contract": "TX", "trade_date": "2026-07-14", "near_contract_month": "202607", "futures_close": 44815.0, "spot_close": 44737.95, "basis": 77.05, "basis_pct": 0.1722, "open_interest": 20062.0, "oi_delta": -33067.0, "days_to_settlement": 1, "put_call_ratio": null } ]}擷取自 2026-07-20 的線上 API。
curl "https://api.twmarketdata.com/v2/datasets/futures-daily-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/futures-daily-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/futures-daily-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/futures-daily-context。完整機器可讀 schema(參數、認證、回應封裝)見 OpenAPI spec。