Taiwan Futures & Options API

16 endpoints

Last updated 2026-11
Base URL
https://api.blave.org
Auth
api-key + secret-key headers on every request
Access
API plan or Blave Agent plan
Rate Limit
500 requests / 5 min per key and per IP

Taiwan Futures OHLCV

GET/studio/market/twfutures/ohlcv/<symbol>/<schema>
Data From
TXF 2011-01-03; MXF 2020-03-22 (1d); stock futures per contract
Update
Near-real-time

Parameters

NameDescriptionAllowedDefault
symbol
string · pathRequired
Near-month continuous contractTXF (台指期), MXF (小台), or a stock-futures id listed by ohlcv/symbols (case-insensitive)
schema
string · pathRequired
Bar size1m, 5m, 15m, 30m, 60m, 1d
start
string · query
First dayYYYY-MM-DDend − the schema's max range
end
string · query
Last dayYYYY-MM-DDtoday (UTC)

Max range per request (end − start): 1m 31 d · 5m 62 d · 15m 93 d · 30m 186 d · 60m 365 d · 1d 3650 d.

Example

Response

{"symbol", "schema", "data": [...]}.

FieldTypeUnitDescription
tsstringUTC ISOBar open time
open / high / low / closefloatindex points (price for stock futures)Prices
volumeintcontracts (口)Volume

Errors

StatusBodyWhen
400{"error": "Invalid symbol. Allowed: [...]"}Symbol not covered
400{"error": "Invalid schema. Allowed: [...]"}Bad schema
400{"error": "Invalid date format. Use YYYY-MM-DD"}Malformed date
400{"error": "date_range_too_large", "message": "...", "max_days": <n>}Range over the cap
503error messageData source temporarily unavailable

Notes

  • Intraday bars before 2017-05-15 are day session only (the night session 15:00–05:00 Taipei launched then), so bars per day jump from ~300 to ~1,140 at that date.
  • The series rolls contracts at monthly settlement without price adjustment — mask the roll in backtests.
  • Roll rule (all schemas; TXF, MXF, and stock futures alike): monthly settlement day — the 3rd Wednesday, or the next trading day when that Wednesday is closed — is the expiring month for the whole day. It trades through its 13:30 Taipei close, no bar is stamped 13:31–14:59 Taipei on that day, and the series is the next month from the 15:00 night session on. The settlement day's 1d bar is the expiring month's, so its close is that contract's last trade at 13:30.
  • For years of history use ohlcv/<symbol>/export/<year> instead of chunked JSON.
  • A range with no data returns 200 with [].
  • Do not assume the series runs to the last trading day — MXF and CAF asked for everything up to the request date both came back with a last bar months old. Read data[-1]["ts"].
  • 1d bars carry a 16:00:00+00:00 time component (00:00 Taipei), not midnight UTC — take the date from ts rather than assuming the timestamp is date-aligned.
  • TXF's start date holds for 1d and intraday; MXF's is for 1d. Stock futures start per contract — CAF has 1d bars at least as early as 2016-09-18.
  • Bars are refreshed on request.

Taiwan Futures Minute-Line Symbols

GET/studio/market/twfutures/ohlcv/symbols
Data From
Snapshot
Update
Live

Parameters

None.

Example

Python
symbols = requests.get(f"{BASE_URL}/studio/market/twfutures/ohlcv/symbols", headers=headers, timeout=30).json()["data"]

Response

{"data": ["CDF", "DHF", "MXF", "TXF", ...]} — symbols accepted by ohlcv, ohlcv/export, and bid_ask_vol: TXF, MXF, plus the stock futures with minute-line coverage. Coverage changes over time — check a contract's minute_line_enabled in stock_futures/list rather than assuming a count.

Errors

Shared errors only.

Taiwan Futures 1m Yearly Export

GET/studio/market/twfutures/ohlcv/<symbol>/export/<year>
Data From
2011 (TXF)
Update
Current year refreshed on download

Parameters

NameDescriptionAllowedDefault
symbol
string · pathRequired
SymbolAs ohlcv/symbols
year
int · pathRequired
Calendar year2014 – current year

Example

Python
import ioimport pandas as pdr = requests.get(f"{BASE_URL}/studio/market/twfutures/ohlcv/TXF/export/2024", headers=headers, timeout=120)raw = pd.read_parquet(io.BytesIO(r.content))raw.index = pd.to_datetime(raw["ts"], utc=True)bars_60m = (raw[["open", "high", "low", "close", "volume"]]            .resample("60min")            .agg(open=("open", "first"), high=("high", "max"), low=("low", "min"),                 close=("close", "last"), volume=("volume", "sum"))            .dropna(subset=["open"]))

Response

application/octet-stream, a parquet file (<SYMBOL>_<year>_1m.parquet) with columns ts, open, high, low, close, volume (1m bars).

Errors

StatusBodyWhen
400{"error": "Invalid symbol. Allowed: [...]"}Symbol not covered
400{"error": "Invalid year. Allowed: 2014-<current>"}Year out of range
404{"error": "no_data", "message": "No 1m data on disk for <symbol> in <year>"}No file

Notes

  • One request per year, zero server-side computation — resample locally.
  • Same near-month continuous series as ohlcv/<symbol>/1m, under the same settlement-day roll rule (no bars stamped 13:31–14:59 Taipei on monthly settlement day).
  • Past years' files are immutable; the current year's file is refreshed before download.

Taiwan Futures Bid/Ask Volume

GET/studio/market/twfutures/bid_ask_vol/<symbol>
Data From
2018-02-22 (TXF)
Update
Aggregated from ticks, refreshed on request

Parameters

NameDescriptionAllowedDefault
symbol
string · pathRequired
SymbolTXF, MXF (both verified to return data); other ohlcv/symbols ids untested
start
string · query
First dayYYYY-MM-DDend − 31 days
end
string · query
Last day; end − start ≤ 31 daysYYYY-MM-DDtoday (UTC)

Example

Python
data = requests.get(f"{BASE_URL}/studio/market/twfutures/bid_ask_vol/TXF", headers=headers,                    params={"start": "2026-05-29", "end": "2026-05-29"}, timeout=60).json()["data"]# [{"ts": "2026-05-29 00:45:00+00:00", "bid_vol": 669, "ask_vol": 447, "total_vol": 1156}, ...]

Response

{"symbol", "start", "end", "data": [...]}, 1-minute rows, day and night sessions.

FieldTypeUnitDescription
tsstringUTC ISOBar open time
bid_volintcontracts內盤 — trades hitting the bid (seller-initiated)
ask_volintcontracts外盤 — trades lifting the ask (buyer-initiated)
total_volintcontractsTotal, including unclassified ticks

Errors

StatusBodyWhen
400{"error": "Invalid symbol. Allowed: [...]"}Symbol not covered
400{"error": "Invalid date format. Use YYYY-MM-DD"}Malformed date
400{"error": "date_range_too_large", "message": "...", "max_days": 31}Range over 31 days
503error messageData source temporarily unavailable

Notes

  • Rows are the near-month continuous contract under the same roll rule as ohlcv: on monthly settlement day there are no rows between the expiring month's 13:30 Taipei close and the 15:00 night open; from the night session on the rows are the next month.

Taiwan Futures Daily by Contract

GET/studio/market/twfutures/daily/<futures_id>
Data From
TX 1998-07-21; MTX 2001-04-09; CDF 2010-01-25
Update
Daily, after about 15:00 Taipei

Parameters

NameDescriptionAllowedDefault
futures_id
string · pathRequired
Product2–6 letters, case-insensitive — e.g. TX, MTX, TMF, TE, TF, or a stock-futures id (e.g. CDF)
start
string · query
First dateYYYY-MM-DD1998-07-01
end
string · query
Last dateYYYY-MM-DDtoday

Example

Python
data = requests.get(f"{BASE_URL}/studio/market/twfutures/daily/TX", headers=headers,                    params={"start": "2026-08-01"}, timeout=60).json()["data"]

Response

{"futures_id", "data": [...]}; several rows per day (every contract month × trading session).

FieldDescription
date, futures_idDay, product
contract_dateContract month (spread contracts contain /)
open / max / min / closePrices (max = high, min = low)
spread / spread_perChange / change %
volumeContracts
settlement_priceSettlement price
open_interestOpen interest
trading_sessionposition (regular) or after_market (night)

Errors

StatusBodyWhen
400{"error": "Invalid futures_id"}Format check failed
404{"error": "No data found for futures_id: <id>"}No data
503{"error": "Upstream rate limit. Please retry shortly."}Upstream quota exhausted

Notes

  • The latest day for TX / MTX / TMF comes from the official TAIFEX publication.
  • TX is the earliest product; others start later (CDF is a stock future).
  • Server cache: 5 minutes.

Stock Futures List

GET/studio/market/twfutures/stock_futures/list
Data From
Snapshot (current TAIFEX listing)
Update
Listing refreshed daily; minute-line flag live

Parameters

None.

Example

Python
rows = requests.get(f"{BASE_URL}/studio/market/twfutures/stock_futures/list", headers=headers,                    timeout=30).json()["data"]# Live capture 2026-11-06 (abridged with ...):# [{"futures_id": "CAF", "code": "CA", "stock_id": "1303", "stock_name": "南亞",#   "stock_full_name": "南亞塑膠工業股份有限公司", "unit": 2000, "minute_line_enabled": true}, ...,#  {"futures_id": "CDF", "code": "CD", "stock_id": "2330", "stock_name": "台積電",#   "stock_full_name": "台灣積體電路製造股份有限公司", "unit": 2000, "minute_line_enabled": true}, ...,#  {"futures_id": "QFF", "code": "QF", "stock_id": "2330", "stock_name": "台積電",#   "stock_full_name": "台灣積體電路製造股份有限公司", "unit": 100, "minute_line_enabled": true}, ... 240 rows]by_stock = {}for r in rows:                                    # one stock can have a standard and a mini contract    by_stock.setdefault(r["stock_id"], []).append(r["futures_id"])

Response

{"data": [...]}, one row per contract, sorted by futures_id.

FieldTypeDescription
futures_idstringContract id used by the other futures endpoints, e.g. CDF (= code + F)
codestringTAIFEX product code, e.g. CD
stock_idstringUnderlying stock code, e.g. 2330
stock_name / stock_full_namestringUnderlying short / full name
unitintShares per contract (standard 2,000; mini 100)
minute_line_enabledbooltrue when the contract has minute bars (ohlcv/<symbol>/<schema>, bid_ask_vol/<symbol>)

Errors

StatusBodyWhen
503{"error": "Stock futures symbol list temporarily unavailable. Please retry shortly."}Listing unavailable

Notes

  • Covers futures on listed (上市) common stocks only; futures on OTC stocks and ETFs are not in the list. Never hard-code the count — TAIFEX lists and delists contracts.
  • stock_id → futures_id is one-to-many: a stock can have a standard (2,000 shares) and a mini (100 shares) contract. Their lot counts are not comparable — the mini's notional per lot is 1/20.
  • The ids here are the ones stock_futures/batch/daily accepts.

Stock Futures Liquidity Ranking

GET/studio/market/twfutures/stock_futures/liquidity_ranking
Data From
Snapshot (last 20 trading days)
Update
Daily, after about 15:00 Taipei (cached 1 hour)

Parameters

None.

Example

Python
rows = requests.get(f"{BASE_URL}/studio/market/twfutures/stock_futures/liquidity_ranking", headers=headers,                    timeout=120).json()["data"]# Live capture 2026-11-06 (abridged with ...):# [{"rank": 1, "futures_id": "CCF", "code": "CC", "stock_id": "2303", "stock_name": "聯電",#   "stock_full_name": "聯華電子股份有限公司", "unit": 2000,#   "avg_volume": 50357.3, "avg_open_interest": 75444.95, "minute_line_enabled": true},#  {"rank": 2, "futures_id": "QFF", "code": "QF", "stock_id": "2330", "stock_name": "台積電",#   "stock_full_name": "台灣積體電路製造股份有限公司", "unit": 100,#   "avg_volume": 44525.55, "avg_open_interest": 109939.75, "minute_line_enabled": true}, ... 240 rows]standard = [r for r in rows if r["unit"] == 2000][:20]   # compare lots within one unit only

Response

{"data": [...]}, every stock-futures contract that has daily data, sorted by avg_volume descending.

FieldTypeUnitDescription
rankint—1-based rank by avg_volume
futures_id, code, stock_id, stock_name, stock_full_name, unit——Same as stock_futures/list
avg_volumefloatcontractsAverage daily volume over the last 20 trading days: regular session only, every contract month summed per day, spread contracts and after-hours excluded
avg_open_interestfloatcontractsAverage daily open interest over the same days, summed the same way
minute_line_enabledbool—Same as stock_futures/list

Errors

StatusBodyWhen
503{"error": "Stock futures symbol list temporarily unavailable. Please retry shortly."}Listing unavailable

Notes

  • Lot counts are comparable only within one unit: a mini contract's lot is 1/20 of a standard one, so rank across units by notional (lots × unit × price) instead.
  • A contract whose data could not be read on that request is missing from the response (the list is then not cached, so the next request retries it). Compare the length with stock_futures/list if you need every contract.
  • A cold request can take tens of seconds; use a long timeout.

Stock Futures Batch Daily

GET/studio/market/twfutures/stock_futures/batch/daily
Data From
Per contract listing (CDF: 2010-01-25)
Update
Same as twfutures/daily

Parameters

NameDescriptionAllowedDefault
futures_ids
string · queryRequired
IdsComma-separated stock-futures ids, ≤ 250
start
string · query
First dateYYYY-MM-DD1998-07-01
end
string · query
Last dateYYYY-MM-DDtoday

Example

Python
body = requests.get(f"{BASE_URL}/studio/market/twfutures/stock_futures/batch/daily", headers=headers,                    params={"futures_ids": "CDF,DHF", "start": "2026-08-01"}, timeout=120).json()

Response

{"data": {"<futures_id>": [...rows as /daily...]}, "failed": [...]}. failed = ids whose fetch failed (retry); an id absent from both genuinely has no data.

Errors

StatusBodyWhen
400{"error": "futures_ids parameter required"}Missing
400{"error": "futures_ids exceeds max 250 per request"}Too many
400{"error": "Invalid stock futures_id(s): [...]"}Any id is not a stock future
503{"error": "Stock futures symbol list temporarily unavailable. Please retry shortly."}Symbol list unavailable

Taiwan Futures Institutional Investors

GET/studio/market/twfutures/institutional/<futures_id>
Data From
2018-06-05
Update
Daily, after about 15:00 Taipei

Parameters

NameDescriptionAllowedDefault
futures_id
string · pathRequired
ProductIndex futures — TX, MTX, TMF, TE, TF (all verified to return data); stock futures not supported
start
string · query
First dateYYYY-MM-DD2018-06-05
end
string · query
Last dateYYYY-MM-DDtoday

Example

Python
data = requests.get(f"{BASE_URL}/studio/market/twfutures/institutional/TX", headers=headers,                    params={"start": "2026-08-01"}, timeout=60).json()["data"]

Response

{"futures_id", "data": [...]}, 3 rows per day (自營商 / 投信 / 外資).

FieldDescription
date, futures_idDay, product
institutional_investorsInvestor type
long_deal_volume / long_deal_amountLong trades (contracts / TWD thousand)
short_deal_volume / short_deal_amountShort trades
long_open_interest_balance_volume / long_open_interest_balance_amountLong OI
short_open_interest_balance_volume / short_open_interest_balance_amountShort OI

Errors

StatusBodyWhen
400{"error": "Invalid futures_id"}Format check failed
404{"error": "institutional data not available for stock futures (<id>)"}Stock future
404{"error": "No data found for futures_id: <id>"}Product has no data at all. A range with no rows in it is 200 with "data": []
503upstream rate limit / symbol list unavailableRetry later

Notes

  • The latest day comes from the official TAIFEX publication.
  • *_amount is TWD thousand — inferred from magnitude, not stated upstream, but the arithmetic backs it: a TX row with long_open_interest_balance_amount 722870036 over ..._volume 78292 is 9,233 per contract, and a TX contract is index × 200, so 9,233 thousand ÷ 200 ≈ 46,160 index points, which is where the index was trading that day. Read as TWD it would be 1,000× too small.
  • Server cache: 5 minutes.

Taiwan Futures Large Traders

GET/studio/market/twfutures/large_traders/<futures_id>
Data From
2007-01-02
Update
Daily

Parameters

NameDescriptionAllowedDefault
futures_id
string · pathRequired
ProductIndex futures, e.g. TX; stock futures not supported
start
string · query
First dateYYYY-MM-DD1998-07-01
end
string · query
Last dateYYYY-MM-DDtoday

Example

Python
data = requests.get(f"{BASE_URL}/studio/market/twfutures/large_traders/TX", headers=headers,                    params={"start": "2026-08-01"}, timeout=60).json()["data"]

Response

{"futures_id", "data": [...]}, 3 rows per day (contract_type: week / current month / all).

FieldDescription
date, futures_id, name, contract_typeDay, product, product name, contract scope
buy_top5_trader_open_interest / buy_top10_trader_open_interest (+ _per)Long OI of top 5 / 10 traders (contracts, % of market)
sell_top5_trader_open_interest / sell_top10_trader_open_interest (+ _per)Short OI of top 5 / 10 traders
buy_top5_specific_open_interest / buy_top10_specific_open_interest (+ _per)Long OI of top 5 / 10 specific legal persons
sell_top5_specific_open_interest / sell_top10_specific_open_interest (+ _per)Short OI of top 5 / 10 specific legal persons
market_open_interestTotal market OI

Errors

StatusBodyWhen
400{"error": "Invalid futures_id"}Format check failed
404{"error": "large_traders data not available for stock futures (<id>)"}Stock future
404{"error": "No data found for futures_id: <id>"}Product has no data at all. A range with no rows in it is 200 with "data": []
503upstream rate limit / symbol list unavailableRetry later

Notes

  • Server cache: 5 minutes.

Taiwan Futures Retail Long/Short Ratio

GET/studio/market/twfutures/retail_long_short_ratio/<futures_id>
Data From
2018-06-05 (TMF from 2024-07-29, its listing date)
Update
Daily, after about 15:00 Taipei

Parameters

NameDescriptionAllowedDefault
futures_id
string · pathRequired
ProductIndex futures, 2–6 letters, case-insensitive — TMF (微型臺指), MTX (小型臺指), TX (臺股期貨)
date
string · query
One trading dayYYYY-MM-DDlatest settled day

Example

Python
row = requests.get(f"{BASE_URL}/studio/market/twfutures/retail_long_short_ratio/TMF", headers=headers,                   timeout=60).json()# Live capture 2026-11-06:# {"date": "2026-11-06", "futures_id": "TMF", "market_open_interest": 96708,#  "institutional_long_open_interest": 6870, "institutional_short_open_interest": 52454,#  "retail_long_open_interest": 89838, "retail_short_open_interest": 44254,#  "retail_long_short_ratio": 47.13570749059023}# Same day: MTX 17.37, TX 5.92 — each product has its own retail share, so never compare across them# For a series use /retail_long_short_ratio/<futures_id>/history (one call for a whole range)

Response

One object for one day (no data wrapper).

FieldTypeUnitDescription
datestring—Trading day
futures_idstring—Product
market_open_interestintcontractsWhole-market open interest: every contract month, regular session, spread contracts excluded
institutional_long_open_interestintcontractsLong OI of the three institutional investors (自營商 + 投信 + 外資)
institutional_short_open_interestintcontractsShort OI of the three institutional investors
retail_long_open_interestintcontractsmarket_open_interest − institutional_long_open_interest
retail_short_open_interestintcontractsmarket_open_interest − institutional_short_open_interest
retail_long_short_ratiofloat%(retail long − retail short) ÷ market_open_interest × 100. Positive = retail net long

Errors

StatusBodyWhen
400{"error": "Invalid futures_id"}Format check failed
400{"error": "Invalid date, expected YYYY-MM-DD"}Malformed date
404{"error": "No retail long/short ratio data for futures_id <id> on <date>"}date is not a trading day, or not published yet
404{"error": "No data found for futures_id: <id>"} (or a similar no-data message)Product has no data (stock futures have no institutional data)
503{"error": "Upstream rate limit. Please retry shortly."}Upstream quota exhausted

Notes

  • Retail here means every position outside the three institutional investors, so it also includes large traders who are not institutions. It is a residual, not a count of individual accounts.
  • Only the regular-session (position) rows of daily/<futures_id> count toward market OI; the after-hours rows carry no OI, and calendar-spread contracts are excluded. The institutional side is the sum of the three rows of institutional/<futures_id> for the same day.
  • A day appears only when both the market OI and the institutional rows for it are published. Before about 15:00 Taipei the default is the previous trading day.
  • The three products give very different numbers and are not comparable with each other: TMF (微型臺指, index × 10 per contract) has the highest retail share of the three (its long side is almost all retail), MTX (小型臺指, index × 50) sits in between, and TX (臺股期貨, index × 200) is mostly institutional, so the residual there is small. On 2026-11-06 the ratio was 47.14 for TMF, 17.37 for MTX and 5.92 for TX. Track one product over time and compare it only with itself.
  • TMF history starts 2024-07-29, its listing date.
  • The ratio is unrounded — round for display.
  • Server cache: 5 minutes.

Taiwan Futures Retail Long/Short Ratio History

GET/studio/market/twfutures/retail_long_short_ratio/<futures_id>/history
Data From
2018-06-05 (TMF from 2024-07-29, its listing date)
Update
Daily, after about 15:00 Taipei

Parameters

NameDescriptionAllowedDefault
futures_id
string · pathRequired
ProductIndex futures, 2–6 letters, case-insensitive — TMF (微型臺指), MTX (小型臺指), TX (臺股期貨)
start
string · query
First dateYYYY-MM-DDearliest available
end
string · query
Last dateYYYY-MM-DDtoday

Example

Python
import pandas as pdresp = requests.get(f"{BASE_URL}/studio/market/twfutures/retail_long_short_ratio/TMF/history",                    headers=headers, params={"start": "2026-10-27", "end": "2026-11-07"}, timeout=60).json()# Live capture 2026-11-09: 9 rows, 2026-10-27 .. 2026-11-06# {"futures_id": "TMF", "data": [..., {"date": "2026-11-06", "futures_id": "TMF",#   "market_open_interest": 96708, "institutional_long_open_interest": 6870,#   "institutional_short_open_interest": 52454, "retail_long_open_interest": 89838,#   "retail_short_open_interest": 44254, "retail_long_short_ratio": 47.13570749059023}]}df = pd.DataFrame(resp["data"]).set_index("date")

Response

{"futures_id", "data": [...]}; one row per trading day, oldest first. Each row has the same fields as the single-day endpoint above (date, futures_id, market_open_interest, institutional_long_open_interest, institutional_short_open_interest, retail_long_open_interest, retail_short_open_interest, retail_long_short_ratio).

Errors

StatusBodyWhen
400{"error": "Invalid futures_id"}Format check failed
400{"error": "Invalid start date, expected YYYY-MM-DD"} (or end)Malformed date
400{"error": "start must not be after end"}Reversed range
404{"error": "No data found for futures_id: <id>"}Product has no data at all
503{"error": "Upstream rate limit. Please retry shortly."}Upstream quota exhausted

A range with no settled day in it (a weekend, or before the product's history) is 200 with "data": [], not an error.

Notes

  • Same formula and same caveats as the single-day endpoint: never compare TMF, MTX and TX with each other.
  • Without start the whole history comes back (about 2,050 rows for TX, 2026-11).
  • Published after the close: in a backtest, act on a day's value from the next trading day on.
  • Server cache: 5 minutes.

Taiwan Options Institutional Investors

GET/studio/market/twfutures/option/institutional/<option_id>
Data From
2018-06-05
Update
Daily

Parameters

NameDescriptionAllowedDefault
option_id
string · pathRequired
Option productTXO (2–6 letters accepted)
start
string · query
First dateYYYY-MM-DD2018-06-05
end
string · query
Last dateYYYY-MM-DDtoday

Example

Python
data = requests.get(f"{BASE_URL}/studio/market/twfutures/option/institutional/TXO", headers=headers,                    params={"start": "2026-08-01"}, timeout=60).json()["data"]

Response

{"option_id", "data": [...]}, 6 rows per day (3 investor types × call / put). Fields: date, option_id, call_put (買權 / 賣權), institutional_investors, and the same long_* / short_* deal and open-interest volume / amount fields as futures institutional.

Errors

400 {"error": "Invalid option_id"}; 404 {"error": "No data found for option_id: <id>"} when the product has no data at all (a range with no rows is 200 with "data": []); 503 upstream rate limit.

Notes

  • Server cache: 5 minutes.

Taiwan Options Large Traders

GET/studio/market/twfutures/option/large_traders/<option_id>
Data From
2007-01-02
Update
Daily

Parameters

NameDescriptionAllowedDefault
option_id
string · pathRequired
Option productTXO (2–6 letters accepted)
start
string · query
First dateYYYY-MM-DD1998-07-01
end
string · query
Last dateYYYY-MM-DDtoday

Example

Python
data = requests.get(f"{BASE_URL}/studio/market/twfutures/option/large_traders/TXO", headers=headers,                    params={"start": "2026-08-01"}, timeout=60).json()["data"]

Response

{"option_id", "data": [...]}, 6 rows per day (call / put × week / current month / all). Fields: date, option_id, name, put_call, contract_type, and the same top-5 / top-10 trader and specific-legal-person open-interest fields as futures large traders, plus market_open_interest.

Errors

400 {"error": "Invalid option_id"}; 404 {"error": "No data found for option_id: <id>"} when the product has no data at all (a range with no rows is 200 with "data": []); 503 upstream rate limit.

Notes

  • Server cache: 5 minutes.

TXO Put/Call Ratio

GET/studio/market/twfutures/option/pcr
Data From
2001-12-24
Update
Daily

Parameters

NameDescriptionAllowedDefault
start
string · query
First dateYYYY-MM-DD2001-12-24
end
string · query
Last dateYYYY-MM-DDtoday

Example

Python
data = requests.get(f"{BASE_URL}/studio/market/twfutures/option/pcr", headers=headers,                    params={"start": "2024-01-01", "end": "2024-12-31"}, timeout=60).json()["data"]# [{"date": "2024-01-02", "put_volume": 309583, "call_volume": 404231, "volume_pcr": 76.59,#   "put_oi": 263673, "call_oi": 246495, "oi_pcr": 106.97, "pcr": 106.97},#  {"date": "2024-01-03", "put_volume": 622854, "call_volume": 729547, "volume_pcr": 85.38,#   "put_oi": 177203, "call_oi": 178062, "oi_pcr": 99.52, "pcr": 99.52}, ...]

Response

{"data": [...]}, one row per trading day.

FieldUnitDescription
date—Trading day
put_volume / call_volumecontractsPut / call volume
volume_pcr%Put/call volume ratio
put_oi / call_oicontractsPut / call open interest
oi_pcr%Put/call open-interest ratio (買賣權未平倉量比率)
pcr%Same as oi_pcr (kept for compatibility)

Errors

503 store not ready or upstream rate limit. A range with no rows is 200 with "data": [].

Notes

  • The official TAIFEX ratio — not derived from option institutional or large-trader data.
  • Server cache: 5 minutes.

Taiwan Index Futures Institutional Carrying Cost

GET/studio/market/twfutures/carrying_cost/<identity>
Data From
2023-10-18
Update
Daily, 15:40 and 17:40 Taipei

Blave's estimate of the average cost of one institution's net TAIEX-futures position, with its unrealized and realized PnL. An estimate from daily aggregates, not the institution's real fills.

Method:

  • Position = long OI − short OI, converted to 大台 (TX) contracts: TX × 1, MTX × 1/4, TMF × 1/20 (scope=all), or TX only (scope=tx).
  • Adding to the position uses that institution's own average trade price of the day on the side it added (TAIFEX 交易契約金額 ÷ (口數 × 200)) and updates a weighted-average cost. Reducing books realized PnL at the opposite side's average price and leaves the cost unchanged. A flip, or going flat, realizes the whole old position; the new direction starts at that day's price.
  • Every monthly settlement day (third Wednesday; the next trading day if closed) starts a new cycle: cost resets to the mark price and realized PnL to 0. This makes the cost independent of where the data starts.
  • Mark price = TAIFEX's own valuation of the open position (OI contract value ÷ (contracts × 200), i.e. at each month's settlement price). Unrealized PnL = (mark − cost) × net contracts × 200.

Parameters

NameDescriptionAllowedDefault
identity
string · pathRequired
外資 / 投信 / 自營商foreign, investment_trust, dealer
start
string · query
First trading date, inclusiveYYYY-MM-DD2023-10-18 (whole history)
end
string · query
Last trading date, inclusiveYYYY-MM-DDtoday
scope
string · query
all = TX + MTX + TMF in TX-equivalent contracts; tx = 大台 only (the basis most Taiwanese sites quote)all, txall

The ledger always runs from the start of the stored history; start / end only cut the window, so the same day has the same values whatever window you ask for.

Example

Python
body = requests.get(f"{BASE_URL}/studio/market/twfutures/carrying_cost/foreign", headers=headers,                    params={"start": "2026-10-06"}, timeout=60).json()rows = body["data"]# Live capture 2026-10-07 (scope=all):# {"identity": "foreign", "scope": "all", "data": [#   {"date": "2026-10-06", "net_open_interest": -78570.7, "net_open_interest_change": -3923.5,#    "cost": 46527.57, "txf_close": 50060.0, "mark_price": 50088.51,#    "unrealized_pnl": -55957022956, "realized_pnl": -5893982992, "total_pnl": -61851005948,#    "cycle_start": "2026-09-16"},#   {"date": "2026-10-07", "net_open_interest": -78435.8, "net_open_interest_change": 134.9,#    "cost": 46527.57, "txf_close": 49979.0, "mark_price": 49974.38,#    "unrealized_pnl": -54070636128, "realized_pnl": -5988669182, "total_pnl": -60059305310,#    "cycle_start": "2026-09-16"}]}gap = rows[-1]["txf_close"] - rows[-1]["cost"]   # points the market is above (+) / below (−) their cost

Response

{"identity", "scope", "data": [...]}, one row per trading day, oldest → newest; "stale": true is added only when the server's copy is behind TAIFEX's last published day (the newest row may be missing).

FieldTypeUnitDescription
datestring—Trading day (Taipei)
net_open_interestfloatTX-equivalent contractsLong − short OI (negative = net short)
net_open_interest_changefloatcontractsChange vs the previous trading day
costfloat | nullindex pointsWeighted-average cost of the net position; null when flat
txf_closefloat | nullindex pointsTX near-month day-session close (the expiring contract is skipped on settlement day)
mark_pricefloat | nullindex pointsTAIFEX valuation of the position, at settlement prices
unrealized_pnlintTWD(mark − cost) × net contracts × 200
realized_pnlintTWDRealized since cycle_start; resets to 0 on every settlement day
total_pnlintTWDunrealized_pnl + realized_pnl
cycle_startstring—The settlement day that opened the current cycle

Errors

StatusBodyWhen
400{"error": "Invalid identity. Allowed: ['dealer', 'foreign', 'investment_trust']"}Unknown identity
400{"error": "Invalid scope. Allowed: ['all', 'tx']"}Unknown scope
400{"error": "Invalid start date, expected YYYY-MM-DD"} (or end) / {"error": "start must not be after end"}Bad date / reversed range
503{"error": "Market data is not ready on this server. Please retry later."}Store not ready — retry later, never read as "no position"
500{"error": "Internal error"}Unexpected server error

Notes

  • Futures only: option positions (including dealers' hedges) are not in the ledger, so a dealer's "loss" here may be offset elsewhere.
  • Right after a settlement day the cost equals the mark by construction — the first days of a cycle say little about where the position was really built.
  • Other sites' 外資成本 figures use different rules (TX only, near-month close as the trade price, or undisclosed) — numbers will differ; compare like with like (scope=tx).
  • TAIFEX publishes only about the last three years, which sets the start date.
  • Updated after TAIFEX publishes each day.
  • Server cache: 5 minutes.