AI agent?先讀 /llms.txt 取得全站索引。
衍生與可轉債
期貨日情境:每筆為某契約某日的近月期貨收盤對現貨指數(基差、基差%)、未平倉量與日變動、距結算日與結算旗標、三大法人淨未平倉、賣買權比。衍生自 TAIFEX 期貨日資料+現貨指數。非預測、非建議。
GET /v2/datasets/futures-daily-context期貨日情境(基差/近月/法人OI)是台灣市場資料集,來源為 TAIFEX,由 TW Market Data 以 GET /v2/datasets/futures-daily-context 提供,資料日 2026-07-31。
| 欄位 | 型別 | 說明 |
|---|---|---|
contract | string | |
trade_date | string | |
near_contract_month | string | |
method | string | |
futures_close | number | |
spot_index_code | string | |
spot_close | number | |
basis | number | futures−spot |
basis_pct | number | |
open_interest | number | |
oi_delta | number | daily Δ |
settlement_price | number | |
days_to_settlement | number | |
settlement_flag | boolean | |
inst_net_oi_foreign | null | NULL pre-2023-07 |
inst_net_oi_itrust | null | |
inst_net_oi_dealer | null | |
put_call_ratio | null | NULL where no options data |
grade | string | |
rule_version | string |
| 列數 | 6,954 |
| 涵蓋起訖 | 1998-07-21 – 2026-09-03 |
| 分級 | 衍生 |
| 量測時間 | 2026-09-04取自資料集登錄表 |
此為本端點的真實回應。資料列位於 "data" 之下,來源資訊如下方所示;各資料集形狀不盡相同,請以本頁為準。
{
"dataset_id": "futures_daily_context",
"request_context": {
"scope": "taifex_futures_daily_context",
"coverage_type": "daily_series",
"filters": {
"contract": null,
"trade_date": null,
"date_from": null,
"date_to": null,
"settlement_flag": null,
"limit": 50
},
"min_trade_date": "2026-05-25",
"max_trade_date": "2026-08-04"
},
"quality": {
"row_count": 50,
"contract_count": 1,
"settlement_day_count": 2,
"rows_missing_basis": 0,
"sensitive_fields_exposed": false
},
"lineage": {
"methods": [
"current_month"
],
"rule_versions": [
"v0"
],
"semantics": "One row per trading session: the futures close against its spot index, the resulting basis (futures minus spot) and basis_pct, open interest and its day-over-day delta, days to settlement, and the three institutional NET OPEN INTEREST legs with the put/call ratio. DERIVED from taifex_futures_daily, so an outage upstream appears here a day later."
},
"error": null,
"data": [
{
"contract": "TX",
"trade_date": "2026-08-04",
"near_contract_month": "202608",
"method": "current_month",
"futures_close": 43357,
"spot_index_code": "TWSE_TAIEX",
"spot_close": 43360.66,
"basis": -3.66,
"basis_pct": -0.0084,
"open_interest": 106602,
"oi_delta": -2987,
"settlement_price": 43344,
"days_to_settlement": 15,
"settlement_flag": false,
"inst_net_oi_foreign": null,
"inst_net_oi_itrust": null,
"inst_net_oi_dealer": null,
"put_call_ratio": null,
"grade": "derived",
"rule_version": "v0"
},
{
"contract": "TX",
"trade_date": "2026-08-03",
"near_contract_month": "202608",
"method": "current_month",
"futures_close": 43230,
"spot_index_code": "TWSE_TAIEX",
"spot_close": 43386.41,
"basis": -156.41,
"basis_pct": -0.3605,
"open_interest": 109589,
"oi_delta": -1713,
"settlement_price": 43219,
"days_to_settlement": 16,
"settlement_flag": false,
"inst_net_oi_foreign": null,
"inst_net_oi_itrust": null,
"inst_net_oi_dealer": null,
"put_call_ratio": null,
"grade": "derived",
"rule_version": "v0"
}
],
"data_count": 50,
"known_gaps": [
"basis_is_futures_close_minus_spot_close_a_negative_basis_is_backwardation",
"inst_net_oi_legs_are_net_open_interest_not_traded_volume",
"days_to_settlement_counts_calendar_days_not_trading_days"
],
"warnings": [
"not_investment_advice"
],
"envelope": {
"dataset_id": "futures_daily_context",
"scope": "taifex_futures_daily_context",
"row_count": 50
}
}擷取自 2026-07-20 的線上 API。
本服務部分資料取自政府資料開放平臺(data.gov.tw),依「政府資料開放授權條款-第1版」授權利用。資料提供機關:臺灣證券交易所、證券櫃檯買賣中心、臺灣期貨交易所、臺灣集中保管結算所、國家發展委員會、中央銀行、經濟部統計處、財政部關務署。本服務之加值處理、衍生計算與呈現方式由 TWMD 負責,與各資料提供機關無涉。
TW Market Data. (2026). 期貨日情境(基差/近月/法人OI) (Version 2026-07-31) [Data set]. TW Market Data. Retrieved 2026-09-05, from https://twmarketdata.com/zh-TW/docs/api/derivatives/futures-daily-context
版本取自資料集自己的 as_of,不是這一頁的產生日期。沒有 as_of 的資料集就不列這個欄位,不會補一個看起來合理的值。 驗證簽章
可與本資料集對齊的其他資料集。每組都標出可用來 join 的欄位,規劃跨表查詢時不必自己猜。
可用 contract + trade_date 對齊
可用 contract 對齊
可用 trade_date 對齊
可用 trade_date 對齊
可用 trade_date 對齊
curl "https://api.twmarketdata.com/v2/datasets/futures-daily-context" \
-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={},
headers={"X-API-Key": "sk_live_..."},
)
resp.raise_for_status()
print(resp.json()["data"])此端點為 GET /v2/datasets/futures-daily-context。完整機器可讀 schema(參數、認證、回應封裝)見 OpenAPI spec。