Taiwan Stock API

40 endpoints · Market Data · Fundamentals · Institutional Flow · Other · Sectors & Themes · Screener

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

Conventions

  • stock_id — TWSE (上市) / TPEx (上櫃) code, e.g. 2330, 0050, 00878, 006208. Letters and digits (dots allowed), ≤ 8 chars, else 400 {"error": "Invalid stock_id"}.
  • start / end — YYYY-MM-DD, inclusive. Unless a block says otherwise they are not format-validated (filtering is a string comparison), so always send YYYY-MM-DD.
  • Upstream quota exhausted → 503 {"error": "Upstream rate limit. Please retry shortly."} — retry later.
  • For many stocks use batch/<data_type> (≤ 50 ids per call); never loop a single-stock endpoint over a universe.

Taiwan Stock List

GET/studio/market/twstock/list
Data From
Snapshot (currently listed securities)
Update
Server cache 24 h

Parameters

None.

Example

Python
data = requests.get(f"{BASE_URL}/studio/market/twstock/list", headers=headers, timeout=60).json()["data"]# [{"stock_id": "00400A", "name": "主動國泰動能高息", "close": 14.72, "market": "TWSE",#   "industry_code": None, "listing_date": None}, ...]   # 2,392 rows in this response

Response

{"data": [...]}, ~2,400 rows (上市 + 上櫃, incl. ETFs; 興櫃 excluded).

FieldTypeDescription
stock_idstringCode
namestringName
closefloat | nullLatest daily close (null when upstream had none, e.g. halted)
marketstringTWSE (上市) or TPEx (上櫃)
industry_codestring | nullTWSE/TPEx raw numeric 產業別 code, passthrough (not decoded). null for ETFs / non-company securities. Common codes: 15 航運業, 17 金融保險業, 22 生技醫療業, 24 半導體業, 25 電腦及週邊設備業, 26 光電業, 27 通信網路業, 28 電子零組件業, 29 電子通路業, 30 資訊服務業, 31 其他電子業
listing_datestring | nullYYYY-MM-DD; null for ETFs / non-company securities

Errors

Shared errors only (500 if both markets fail).

Notes

  • Use for universe building. When sampling, spread across industries — codes are grouped by sector, so [:N] truncation concentrates in a few sectors.
  • A list noticeably shorter than ~2,400 means one market failed to load — treat as degraded, not as delistings.
  • The server cache drops to 10 minutes when one market failed to load.

Taiwan Stock Info

GET/studio/market/twstock/info/<stock_id>
Data From
Snapshot
Update
Server cache 24 h

Parameters

NameDescriptionAllowedDefault
stock_id
string · pathRequired
CodeSee category conventions

Example

Python
info = requests.get(f"{BASE_URL}/studio/market/twstock/info/2330", headers=headers, timeout=30).json()["data"]# {"stock_id": "2330", "name": "台積電", "close": 2410.0, "industry_code": "24", "listing_date": "1994-09-05"}

Response

{"stock_id": "<stock_id>", "data": {...}}; data has the same fields as one /list row.

Errors

StatusBodyWhen
400{"error": "Invalid stock_id"}Format check failed
404{"error": "Stock not found"}Not a currently listed security

Notes

  • Served from the same cache as /list.

Taiwan Stock Daily Price (Raw)

GET/studio/market/twstock/price/<stock_id>
Data From
1994-10-01
Update
Daily, about 14:00 Taipei

Parameters

NameDescriptionAllowedDefault
stock_id
string · pathRequired
Listed (上市) or OTC (上櫃) stock / ETF codeLetters/digits (dots allowed), ≤ 8 chars — e.g. 2330, 0050, 00878, 006208
start
string · query
First date, inclusiveYYYY-MM-DDfull history
end
string · query
Last date, inclusiveYYYY-MM-DDlatest available

Example

Python
response = requests.get(f"{BASE_URL}/studio/market/twstock/price/2330", headers=headers, timeout=60)data = response.json()["data"]   # no start/end → full history, 8,069 rows# [{"date": "1994-10-01", "stock_id": "2330", "open": 171.0, "high": 172.0,#   "low": 171.0, "close": 172.0, "spread": 1.0,#   "volume": 1660506, "turnover_value": 284858008, "turnover_count": 684},#  {"date": "1994-10-03", "stock_id": "2330", "open": 172.0, "high": 173.0,#   "low": 171.0, "close": 172.0, "spread": 0.0,#   "volume": 1560000, "turnover_value": 268084000, "turnover_count": 711}, ...]

Response

{"stock_id": "<stock_id>", "data": [ ... ]}, rows ascending by date.

FieldTypeUnitDescription
datestringYYYY-MM-DDTrading day
stock_idstring—Stock code
open / high / low / closefloatTWDUnadjusted prices
spreadfloatTWDChange vs the previous close
volumeintshares (股)Trading volume
turnover_valueintTWDTrading value
turnover_countinttrades (筆)Number of trades

Errors

StatusBodyWhen
400{"error": "Invalid stock_id"}stock_id fails the format check
404{"error": "No data found for stock_id: <stock_id>"}Unknown code / no data upstream
503{"error": "Upstream rate limit. Please retry shortly."}Upstream quota exhausted — retry later

Notes

  • start / end are not format-validated: a malformed value filters by string comparison instead of returning 400, so always send YYYY-MM-DD.
  • Use price_adj for backtesting total return; this endpoint is unadjusted.
  • For many stocks use batch/price (≤ 50 ids per call) instead of looping this endpoint.
  • 1994-10-01 is the earliest date served; codes listed later start later.
  • The same-day row comes from the official TWSE / TPEx closing files and appears after they are published (about 14:00 Taipei).
  • Server cache: 5 minutes.

Taiwan Stock Daily Price (Forward-Adjusted)

GET/studio/market/twstock/price_adj/<stock_id>
Data From
1994-10-01 (same as /price)
Update
Daily

Parameters

Same as /price/<stock_id>.

Example

Python
params = {"start": "2020-01-01", "end": "2024-12-31"}data = requests.get(f"{BASE_URL}/studio/market/twstock/price_adj/2330", headers=headers, params=params, timeout=60).json()["data"]

Response

Same shape and fields as /price/<stock_id>; open / high / low / close are adjusted, volume / turnover_* are identical to the raw series.

Errors

Same as /price/<stock_id>.

Notes

  • Forward adjustment (後復權 / 向後調整) for cash and stock dividends: early prices stay as traded; from each ex-dividend date onward prices are multiplied by the cumulative factor, so recent adjusted prices sit above raw. Use for total-return backtests.
  • Rebuilt when the raw /price series advances.
  • Server cache: 5 minutes.

Taiwan Stock Real-Time Quote

GET/studio/market/twstock/quote/<stock_id>
Data From
Snapshot only — no history
Update
About every 10 seconds

Parameters

NameDescriptionAllowedDefault
stock_id
string · pathRequired
CodeSee category conventions

Example

Python
data = requests.get(f"{BASE_URL}/studio/market/twstock/quote/2330", headers=headers, timeout=30).json()["data"]# {"open": 2415.0, "high": 2465.0, "low": 2415.0, "close": 2445.0,#  "change_price": -20.0, "change_rate": -0.81, "average_price": 2432.58,#  "volume": 4245, "total_volume": 26403, "amount": 10379025000, "total_amount": 64227410000,#  "yesterday_volume": 27390, "buy_price": 2445.0, "buy_volume": 17,#  "sell_price": 2450.0, "sell_volume": 11, "volume_ratio": 0.96,#  "quote_time": "2026-07-03 14:30:00", "stock_id": "2330", "tick_type": 2}

Response

{"stock_id": "<stock_id>", "data": {...}}; data is a flat object.

FieldTypeDescription
open / high / low / closefloatToday's OHLC so far
change_price / change_ratefloatChange vs previous close (TWD / %)
average_pricefloatAverage traded price
volumeintLatest tick's volume
total_volumeintCumulative volume today
amount / total_amountfloatLatest tick / cumulative traded value
yesterday_volumeintPrevious day's volume
buy_price / buy_volumefloat / intBest bid
sell_price / sell_volumefloat / intBest ask
volume_ratiofloatVolume ratio
quote_timestringYYYY-MM-DD HH:MM:SS — a full timestamp, unlike other endpoints' bare date
stock_idstringCode
tick_typeint0 indeterminate, 1 sell-initiated (賣盤成交), 2 buy-initiated (買盤成交)

Errors

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

Notes

  • For intraday price checks only — no history, not for backtesting.
  • Server cache: 10 s.

Taiwan Stock Real-Time Quote (Batch)

GET/studio/market/twstock/quote
Data From
Snapshot only — no history
Update
About every 10 seconds

Parameters

NameDescriptionAllowedDefault
stock_ids
string · queryRequired
CodesComma-separated, ≤ 50 ids

Example

Python
data = requests.get(f"{BASE_URL}/studio/market/twstock/quote", headers=headers,                    params={"stock_ids": "2330,2317"}, timeout=30).json()["data"]# {"2330": {...}, "2317": {...}}

Response

{"data": {"<stock_id>": {...quote fields...}, ...}}; fields as /quote/<stock_id>. Ids with no quote are absent.

Errors

StatusBodyWhen
400{"error": "stock_ids parameter required"}Missing
400{"error": "stock_ids exceeds max 50 per request"}Too many
400{"error": "Invalid stock_id in list"}A code fails the format check
503{"error": "Upstream rate limit. Please retry shortly."}Upstream quota exhausted

Notes

  • Server cache: 10 s.

Taiwan Stock Real-Time Quote (All)

GET/studio/market/twstock/quote/all
Data From
Snapshot only — no history
Update
About every 10 seconds

Parameters

None.

Example

Python
rows = requests.get(f"{BASE_URL}/studio/market/twstock/quote/all", headers=headers, timeout=30).json()["data"]

Response

{"data": [{...quote fields...}, ...]} (~2,800 rows); fields as /quote/<stock_id>.

Errors

StatusBodyWhen
503{"error": "Upstream rate limit. Please retry shortly."}Upstream quota exhausted

Notes

  • Server cache: 10 s.

Taiwan Stock Minute-Line OHLCV

GET/studio/market/twstock/minute/ohlcv/<stock_id>/<schema>
Data From
2019-01 (backfilled per stock)
Update
Intraday live bars; official correction after the close

Parameters

NameDescriptionAllowedDefault
stock_id
string · pathRequired
CodeA currently listed TWSE/TPEx code, or TAIEX (加權指數)
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 day, inclusiveYYYY-MM-DDtoday (UTC)
adjust
string · query
1 = forward-adjusted (後復權) OHLC, same factors as /price_adj; volume is never adjusted0, 1, true, false0

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

Python
body = requests.get(f"{BASE_URL}/studio/market/twstock/minute/ohlcv/2330/1m", headers=headers,                    params={"start": "2026-08-06", "end": "2026-08-06"}, timeout=60).json()# {"stock_id": "2330", "schema": "1m", "data": [#   {"close": 2385.0, "high": 2395.0, "low": 2385.0, "open": 2395.0, "ts": "2026-08-06 01:00:00+00:00", "volume": 2540}, ...]}

Response

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

FieldTypeUnitDescription
tsstringUTC ISOBar open time (minute-start label); the 13:30 Taipei bar is the closing auction
open / high / low / closefloatTWDPrices
volumeintlots (張), not sharesVolume. TAIEX bars always carry volume: 0 at every schema — the index has no volume, so none is served; do not read it as a turnover figure

Errors

StatusBodyWhen
400{"error": "Invalid stock_id (must be a listed TWSE/TPEx security)"}Not listed
400{"error": "Invalid schema. Allowed: [...]"}Bad schema
400{"error": "Invalid adjust (use 0 or 1)"}Bad adjust
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
503{"error": "market data temporarily unavailable"}Store read failure
503{"error": "adjust factors temporarily unavailable"}adjust=1 and factors unavailable — never silently served unadjusted

Notes

  • Coverage is demand-driven: any listed stock can be queried; the first query seeds ~30 recent days and enrolls the stock for live tracking, and deep history (2019-01 →) backfills afterwards. Check minute/ohlcv/symbols before requesting years of history.
  • A range with no data returns 200 with [].
  • A still-forming bar is not returned; use /quote/<stock_id> for the live price.
  • Split long spans into chunks within the per-schema cap.

Minute-Line Covered Symbols

GET/studio/market/twstock/minute/ohlcv/symbols
Data From
Snapshot
Update
Live

Parameters

None.

Example

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

Response

{"data": ["2330", "TAIEX", ...]} — ids that already have minute-line data on disk (currently listed stocks plus TAIEX), sorted.

Errors

Shared errors only.

Taiwan Stock 1-Minute Bars (Legacy)

GET/studio/market/twstock/kbar/<stock_id>
Data From
2019-01-01
Update
Server cache 60 s when the range includes today, else 5 min

Parameters

NameDescriptionAllowedDefault
stock_id
string · pathRequired
CodeA currently listed TWSE/TPEx code, or TAIEX
start
string · query
First dayYYYY-MM-DDtoday − 6 days
end
string · query
Last day; end − start ≤ 31 daysYYYY-MM-DDtoday

Example

Python
data = requests.get(f"{BASE_URL}/studio/market/twstock/kbar/2330", headers=headers,                    params={"start": "2026-08-03", "end": "2026-08-07"}, timeout=60).json()["data"]

Response

{"stock_id", "data": [...]}, ascending.

FieldTypeDescription
datestringYYYY-MM-DD (Taipei)
minutestringHH:MM:SS Taipei, bar start (09:00–13:30)
stock_idstringCode
open / high / low / closefloatTWD
volumeintLots (張)

Errors

StatusBodyWhen
400{"error": "Invalid stock_id (must be a listed TWSE/TPEx security)"}Not listed
400{"error": "Date range exceeds 31 days"}Range too long
400{"error": "Invalid start date, expected YYYY-MM-DD"} (or end)Malformed date
400{"error": "start must not be after end"}Reversed range

Notes

  • Legacy — prefer minute/ohlcv/<stock_id>/1m. A listed stock with no minute data returns [] (this endpoint does not trigger seeding).
  • Today's bars are provisional intraday and replaced by official bars after ~16:10 Taipei.
  • Only ids covered by minute/ohlcv/symbols have data.

Taiwan Stock Market Value

GET/studio/market/twstock/market_value/<stock_id>
Data From
2004-01-01
Update
Daily

Parameters

NameDescriptionAllowedDefault
stock_id
string · pathRequired
CodeSee category conventions
start
string · query
First dateYYYY-MM-DDfull history
end
string · query
Last dateYYYY-MM-DDlatest

Example

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

Response

{"stock_id", "data": [{"date", "stock_id", "market_value"}]}; market_value in TWD.

Errors

400 invalid stock_id, 404 no data, 503 upstream quota.

Notes

  • Server cache: 5 minutes.

Taiwan Stock Market Value Ranking

GET/studio/market/twstock/market_value/all
Data From
Snapshot (latest published day)
Update
Daily (EOD)

Parameters

NameDescriptionAllowedDefault
top
int · query
Keep only the top N by market value1–3000all (~2,400)

Example

Response

{"date": "YYYY-MM-DD", "twse_ex_etf_market_value": int, "data": [...]}, sorted by market value descending.

FieldTypeDescription
datestringAs-of day actually used (latest published; can lag today by a day)
twse_ex_etf_market_valueintTWD. Sum of the market == "TWSE" rows that are not ETFs, on the same as-of day. Whole-market denominator — not reduced by top
data[].rankint1-based rank
data[].stock_idstringCode
data[].namestringName
data[].marketstring"TWSE" (上市) or "TPEx" (上櫃), from the TWSE / TPEx listing rosters
data[].market_valueintTWD
data[].is_etfbooltrue for the ETFs in the ranking (359 of 2,370 rows on 2026-09-17). false means "not in the ETF set", not "confirmed not an ETF": a security with no industry category — e.g. REIT 01010T — is false, and it stays inside twse_ex_etf_market_value

Errors

StatusBodyWhen
400{"error": "top must be an integer between 1 and 3000"}Bad top
503{"error": "Data temporarily unavailable. Please retry shortly."}Recent data or the listing is temporarily unavailable
503{"error": "Upstream rate limit. Please retry shortly."}Upstream quota exhausted

Notes

  • Universe is 上市 + 上櫃 + ETF (興櫃 excluded; ETNs have no data). Use this instead of looping /market_value/<stock_id> for "top N by market cap" questions.
  • rank and twse_ex_etf_market_value are different universes. rank is whole-market — 上市 + 上櫃, ETFs included — and did not change when the denominator was added. The denominator is 上市 only and excludes ETFs (industry_category in {ETF, 上櫃ETF, 上櫃指數股票型基金(ETF)}); REITs and preferred shares are not excluded from it. So market_value / twse_ex_etf_market_value is an index weight only for a row whose market is "TWSE" and which is not an ETF — a TPEx or ETF row over this denominator is not a weight — while rank stays a whole-market rank. Don't read the two as one ranking.
  • market is a listing-board tag, not an ETF flag — is_etf is the ETF flag. Use it for an ETF-free universe. Don't infer ETFs from the stock_id prefix (00 is a market convention rather than a contract, and it misses REITs 01xxxT) and don't re-fetch a classification from elsewhere. is_etf is exactly the criterion twse_ex_etf_market_value is computed on, so an is_etf filter and the denominator can never disagree.
  • Server cache: 30 minutes.

Taiwan Stock PER / PBR / Dividend Yield

GET/studio/market/twstock/per/<stock_id>
Data From
2005-10-01
Update
Daily

Parameters

NameDescriptionAllowedDefault
stock_id
string · pathRequired
CodeSee category conventions
start
string · query
First dateYYYY-MM-DDfull history
end
string · query
Last dateYYYY-MM-DDlatest

Example

Python
data = requests.get(f"{BASE_URL}/studio/market/twstock/per/2330", headers=headers,                    params={"start": "2026-01-01", "end": "2026-07-22"}, timeout=60).json()["data"]# [{"date": "2026-07-21", "stock_id": "2330", "dividend_yield": 0.95, "PER": 34.87, "PBR": 11.05}, ...]

Response

{"stock_id", "data": [...]}.

FieldTypeDescription
datestringTrading day
stock_idstringCode
dividend_yieldfloatDividend yield (%)
PERfloatPrice / earnings
PBRfloatPrice / book

Errors

400 invalid stock_id, 404 no data, 503 upstream quota.

Notes

  • For value screens across many stocks use batch/per.
  • The same-day row comes from the official TWSE / TPEx publication and appears the same afternoon.
  • Server cache: 5 minutes.

Taiwan Stock Income Statement

GET/studio/market/twstock/financials/<stock_id>
Data From
2013-01-01 by default; earlier on request
Update
Quarterly

Parameters

NameDescriptionAllowedDefault
stock_id
string · pathRequired
CodeSee category conventions
start
string · query
First dateYYYY-MM-DD2013-01-01
end
string · query
Last dateYYYY-MM-DDtoday

Example

Python
import pandas as pddata = requests.get(f"{BASE_URL}/studio/market/twstock/financials/2330", headers=headers,                    params={"start": "2022-01-01", "end": "2024-12-31"}, timeout=30).json()["data"]# [{"date": "2022-03-31", "stock_id": "2330", "type": "Revenue", "value": 491075000000.0, "origin_name": "營業收入"}, ...]wide = pd.DataFrame(data).pivot_table(index="date", columns="type", values="value", aggfunc="first")

Response

{"stock_id", "data": [...]}, long format (one row per item per quarter).

FieldTypeDescription
datestringQuarter end (03-31 / 06-30 / 09-30 / 12-31)
stock_idstringCode
typestringItem code, e.g. Revenue, GrossProfit, OperatingIncome, NetIncome, EPS, TAX, OtherComprehensiveIncome
valuefloatValue (TWD; EPS in TWD per share)
origin_namestringChinese label — use it to identify unfamiliar type codes

Errors

400 invalid stock_id, 404 no data, 503 upstream quota.

Notes

  • start defaults to 2013-01-01; send an earlier start and earlier rows come back (2330 goes back to 2000-06-30).
  • Server cache: 24 hours.

Taiwan Stock Balance Sheet

GET/studio/market/twstock/balance_sheet/<stock_id>
Data From
2013-01-01 by default; earlier on request
Update
Quarterly

Parameters

Same as /financials/<stock_id>.

Example

Python
data = requests.get(f"{BASE_URL}/studio/market/twstock/balance_sheet/2330", headers=headers,                    params={"start": "2022-01-01"}, timeout=30).json()["data"]

Response

Same long format as /financials/<stock_id>. Key type codes: CashAndCashEquivalents, TotalAssets, TotalLiabilities, TotalEquity. Codes ending in _per are % of total assets.

Errors

400 invalid stock_id, 404 no data, 503 upstream quota.

Notes

  • start defaults to 2013-01-01; send an earlier start and earlier rows come back (2330 goes back to 2012-12-31).
  • Server cache: 24 hours.

Taiwan Stock Cash Flow Statement

GET/studio/market/twstock/cashflow/<stock_id>
Data From
2013-01-01 by default; earlier on request
Update
Quarterly

Parameters

Same as /financials/<stock_id>.

Example

Python
import pandas as pddata = requests.get(f"{BASE_URL}/studio/market/twstock/cashflow/2330", headers=headers,                    params={"start": "2022-01-01"}, timeout=30).json()["data"]cfo = (pd.DataFrame(data).query("type == 'CashFlowsFromOperatingActivities'")         .assign(date=lambda d: pd.to_datetime(d["date"])).set_index("date")["value"].sort_index())cfo_q = cfo - cfo.groupby(cfo.index.year).shift(1).fillna(0)   # YTD → single quarter

Response

Same long format as /financials/<stock_id>. Main type codes (the upstream dataset's own codes; the full set varies by company and year, so treat the response as the authoritative list and use origin_name for anything not below). Filter on type, not origin_name — the same code's label switches between full- and half-width brackets across years:

typeorigin_name
CashFlowsFromOperatingActivities營業活動之淨現金流入(流出)
CashProvidedByInvestingActivities投資活動之淨現金流入(流出)
CashFlowsProvidedFromFinancingActivities籌資活動之淨現金流入(流出)
PropertyAndPlantAndEquipment取得不動產、廠房及設備 (capex, negative)
Depreciation / AmortizationExpense折舊費用 / 攤銷費用
CashBalancesIncrease本期現金及約當現金增加(減少)數
CashBalancesBeginningOfPeriod / CashBalancesEndOfPeriod期初(年初)/ 期末現金及約當現金餘額

Flow items are year-to-date (YTD) cumulative, as filed in Taiwan: the 03-31 row is Q1 alone, 06-30 is Q1–Q2, 09-30 is Q1–Q3, 12-31 is the full year. For a single quarter subtract the previous quarter of the same year (Q1 needs no subtraction) — so fetch from a January start. CashBalancesEndOfPeriod is the balance at the quarter end; CashBalancesBeginningOfPeriod is the balance at the start of the year. This endpoint has no period parameter — it always returns YTD (the ?period=quarter single-quarter view exists only on the web chart route, not here).

Errors

400 invalid stock_id, 404 no data, 503 upstream quota.

Notes

  • start defaults to 2013-01-01; send an earlier start and earlier rows come back (2330 goes back to 2012-03-31).
  • Server cache: 24 hours.

Taiwan Stock Monthly Revenue

GET/studio/market/twstock/monthly_revenue/<stock_id>
Data From
2000-01-01
Update
Monthly

Parameters

NameDescriptionAllowedDefault
stock_id
string · pathRequired
CodeSee category conventions
start
string · query
First dateYYYY-MM-DD2000-01-01
end
string · query
Last dateYYYY-MM-DDtoday

Example

Python
import pandas as pddata = requests.get(f"{BASE_URL}/studio/market/twstock/monthly_revenue/2330", headers=headers,                    params={"start": "2024-01-01", "end": "2024-12-31"}, timeout=30).json()["data"]df = pd.DataFrame(data).sort_values(["revenue_year", "revenue_month"])df["yoy_pct"] = df["revenue"].pct_change(periods=12) * 100# [{"date": "2024-01-01", "stock_id": "2330", "country": "Taiwan", "create_time": "",#   "revenue": 176299866000, "revenue_year": 2023, "revenue_month": 12},#  {"date": "2024-02-01", "stock_id": "2330", "country": "Taiwan", "create_time": "",#   "revenue": 215785127000, "revenue_year": 2024, "revenue_month": 1}, ...]

Response

{"stock_id", "data": [...]}, one row per month.

FieldTypeDescription
datestringFirst day of the month after the revenue month — 2024-01-01 carries revenue_year: 2023, revenue_month: 12. Never use it as the period
stock_idstringCode
countrystringMarket — observed value is Taiwan
create_timestringObserved empty ("") on every row
revenueintMonthly revenue in TWD (元), not thousands — inferred from magnitude, not stated upstream: 2330 for revenue_year 2024, revenue_month 1 returned 215785127000, which is only a sane figure read as 元 (NT$215.8bn)
revenue_monthintRevenue month (1–12) — use this, not date, for the period
revenue_yearintRevenue year

Errors

400 invalid stock_id, 404 no data, 503 upstream quota.

Notes

  • Server cache: 24 hours.

Taiwan Stock Financial Ratios

GET/studio/market/twstock/ratios/<stock_id>
Data From
2013-03-31 (2013 Q1)
Update
Quarterly

Parameters

NameDescriptionAllowedDefault
stock_id
string · pathRequired
CodeSee category conventions
start
string · query
First quarter-end dateYYYY-MM-DD2013-01-01
end
string · query
Last quarter-end dateYYYY-MM-DDtoday

Example

Python
import pandas as pddata = requests.get(f"{BASE_URL}/studio/market/twstock/ratios/2330", headers=headers,                    params={"start": "2024-01-01"}, timeout=30).json()["data"]# [..., {"date": "2026-06-30", "stock_id": "2330",#   "gross_margin_q": 67.7207, "gross_margin_ttm": 64.2302, "operating_margin_q": 60.3443, "operating_margin_ttm": 56.1009,#   "net_margin_q": 55.6354, "net_margin_ttm": 50.3717, "roe_q": 11.3934, "roe_ttm": 40.3342, "roa_q": 7.8372, "roa_ttm": 27.3074,#   "eps_q": 27.25, "eps_ttm": 86.28, "eps_yoy_q": 77.4089, "eps_yoy_ttm": 53.2232,#   "revenue_yoy_q": 36.0453, "revenue_yoy_ttm": 30.5567, "revenue_qoq_q": 12.0163, "revenue_qoq_ttm": 8.2017,#   "debt_ratio": 30.9438, "current_ratio": 245.7635, "quick_ratio": 225.0114, "equity_multiplier": 1.4481,#   "interest_coverage_q": 280.5515, "interest_coverage_ttm": 227.0232,#   "inventory_turnover_q": 1.1767, "inventory_turnover_ttm": 4.6058, "cfo_to_net_income_q": 1.1084, "cfo_to_net_income_ttm": 1.1779,#   "fcf_q": 287363030000.0, "fcf_ttm": 1143556366000.0, "fcf_per_share_q": 11.0827, "fcf_per_share_ttm": 44.1036, ...}]df = pd.DataFrame(data).assign(date=lambda d: pd.to_datetime(d["date"])).set_index("date")

Response

{"stock_id", "data": [...]}, wide format: one row per quarter, oldest first, one column per ratio. Every ratio is a float rounded to 4 decimals, or null.

FieldTypeDescription
datestringQuarter end (03-31 / 06-30 / 09-30 / 12-31) — not the day the filing became public
stock_idstringCode
<ratio>_qfloat | nullThe quarter alone
<ratio>_ttmfloat | nullTrailing four quarters (the four single quarters summed); null if any of the four is missing
debt_ratio, current_ratio, quick_ratio, equity_multiplierfloat | nullPeriod-end balance-sheet ratios — no suffix

<ratio> (each has both _q and _ttm):

GroupRatiosUnit
Profitabilitygross_margin, operating_margin, pretax_margin, net_margin, opex_ratio, roe, roa% (already ×100)
Per shareeps, revenue_per_share, fcf_per_shareTWD per share
Growthrevenue_yoy, revenue_qoq, operating_income_yoy, net_income_yoy, eps_yoy% (already ×100)
Structureinterest_coveragetimes
Efficiencyreceivable_turnover, inventory_turnover, asset_turnover, cfo_to_net_incometimes
Cash flowfcfTWD, raw amount (not thousands)

No-suffix columns: debt_ratio, current_ratio, quick_ratio are % (already ×100 — a current ratio of 2.46× comes back as 245.7635); equity_multiplier is times.

Errors

StatusBodyWhen
400{"error": "Invalid stock_id"}Code fails the format check
404{"error": "No data found for stock_id: <id>"}No financial statements for the code (ETFs such as 0050 / 00878), or no row inside start–end
503{"error": "Data temporarily unavailable. Please retry shortly."}Ratio store not ready — retry later, never read it as "no data"

Notes

  • Single-quarter ROE / ROA are not annualised; per-share figures use a share count derived from net income ÷ EPS; banks, securities firms and insurers have several ratios that are always null (no gross margin, current ratio, etc.).
  • Rows are stamped with the quarter end, but a quarter's filing is public only weeks later. In a backtest shift each row to its availability date (the statutory filing deadlines, same as the statements) — joining on date is lookahead.
  • A missing line item or a zero denominator gives null, never 0.
  • Not included: PER / PBR / dividend yield (daily — per/<stock_id>) and the monthly-revenue ratios (compute YoY / MoM from monthly_revenue/<stock_id>).
  • Many stocks → GET /studio/market/twstock/batch/ratios?stock_ids=... (≤ 50 ids per call).
  • 2013-03-31 is a hard floor: an earlier start returns nothing older.
  • Recomputed by the same job that refreshes the statements, twice daily (13:30 and 23:00 UTC).
  • Server cache: 6 hours.

Taiwan Stock Dividend Events

GET/studio/market/twstock/dividend/<stock_id>
Data From
Per stock (2330: 2005-06-19)
Update
Refreshed on request when stale

Parameters

NameDescriptionAllowedDefault
stock_id
string · pathRequired
CodeCurrently listed code (4–6 digits, optional trailing letter)
start
string · query
First effective datestrict YYYY-MM-DDfull history
end
string · query
Last effective datestrict YYYY-MM-DDfull history

Range filtering uses a three-tier effective date: cash_ex_date if set, else stock_ex_date, else record_date — freshly announced events without an ex date still show up.

Example

Python
data = requests.get(f"{BASE_URL}/studio/market/twstock/dividend/2330", headers=headers,                    params={"start": "2025-01-01", "end": "2025-12-31"}, timeout=30).json()["data"]# [{"record_date": "2025-03-24", "period": "113年第3季", "announce_date": "2025-03-03",#   "cash_ex_date": "2025-03-18", "stock_ex_date": "", "pay_date": "2025-04-10",#   "cash": 4.50002042, "stock": 0.0, "stock_ratio": 0.0}, ...]

Response

{"stock_id", "data": [...]}, one row per announcement row.

FieldTypeDescription
record_datestring權利分派基準日 YYYY-MM-DD
periodstring股利所屬期間 — an opaque label (114年第3季, 113, 不適用, …); compare as string, do not parse into a year
announce_datestring公告日; "" when unknown
cash_ex_datestring除息交易日; "" when none / not decided
stock_ex_datestring除權交易日; "" when none
pay_datestring現金股利發放日; "" when unknown
cashfloatCash dividend per share (TWD, 盈餘 + 公積)
stockfloatStock dividend per share (元面額, 盈餘 + 公積)
stock_ratiofloatstock / 10 — split-style adjustment ratio

Errors

StatusBodyWhen
400{"error": "Invalid stock_id"}Format check failed
400{"error": "Invalid start date, expected YYYY-MM-DD"} (or end)Malformed date
404{"error": "No data found for stock_id: <id>"} / {"error": "No dividend records for stock_id: <id>"}Not listed, or no dividend history at all
503{"error": "Upstream rate limit. Please retry shortly."}Upstream quota exhausted

Notes

  • Zero-value rows (cash == 0 and stock == 0) are kept — an announced no-distribution decision.
  • Effective dates can be in the future (announced but not yet ex) — the 2330 full-history call ran to a date a week ahead of the request. Filter by date yourself if you need past events only.
  • A valid stock with history but no events in range returns 200 + [] (distinct from 404).
  • Delisted stocks are 404.

Taiwan Stock News

GET/studio/market/twstock/news/<stock_id>
Data From
About mid-2020 (sparse until about 2021-02)
Update
Fetched on request

Parameters

NameDescriptionAllowedDefault
stock_id
string · pathRequired
CodeSee category conventions
start
string · query
First dayYYYY-MM-DDtoday − 6 days
end
string · query
Last day; end − start ≤ 31 daysYYYY-MM-DDtoday

Example

Python
data = requests.get(f"{BASE_URL}/studio/market/twstock/news/2330", headers=headers,                    params={"start": "2026-08-01", "end": "2026-08-07"}, timeout=60).json()["data"]

Response

{"stock_id", "data": [...]}, several articles per day (weekends included).

FieldTypeDescription
datestringPublish datetime
stock_idstringCode
titlestringHeadline
sourcestringPublisher
linkstringURL

Errors

StatusBodyWhen
400{"error": "Date range exceeds 31 days"} or a date-parse messageRange too long / malformed date
503{"error": "Upstream rate limit. Please retry shortly."}Upstream quota exhausted

Notes

  • Coverage begins around mid-2020 (rows exist as early as 2020-08; the true start is not documented) and is sparse — a few articles a day or none — until about 2021-02; earlier dates may return [].
  • Each day's articles are fetched on the first request for that day.
  • Server cache: 5 minutes.

Taiwan Stock Institutional Investors

GET/studio/market/twstock/institutional/<stock_id>
Data From
Per stock (2330: 2012-05-02)
Update
Daily

Parameters

NameDescriptionAllowedDefault
stock_id
string · pathRequired
CodeSee category conventions
start
string · query
First dateYYYY-MM-DDfull history
end
string · query
Last dateYYYY-MM-DDlatest

Example

Python
data = requests.get(f"{BASE_URL}/studio/market/twstock/institutional/2330", headers=headers,                    params={"start": "2024-01-01", "end": "2024-12-31"}, timeout=60).json()["data"]# [{"date": "2024-01-02", "stock_id": "2330", "foreign_buy": 28464159, "foreign_sell": 47404324,#   "trust_buy": 5553520, "trust_sell": 269712, "dealer_self_buy": 452000, "dealer_self_sell": 366190,#   "dealer_hedge_buy": 942546, "dealer_hedge_sell": 780090,#   "foreign_dealer_self_buy": 0, "foreign_dealer_self_sell": 0}, ...]

Response

{"stock_id", "data": [...]}, wide format, one row per day. All values in shares (股).

FieldDescription
date, stock_idDay, code
foreign_buy / foreign_sell外資 (excl. foreign dealers)
trust_buy / trust_sell投信
dealer_self_buy / dealer_self_sell自營商自行買賣
dealer_hedge_buy / dealer_hedge_sell自營商避險
foreign_dealer_self_buy / foreign_dealer_self_sell外資自營商 (mostly 0)

Errors

400 invalid stock_id, 404 no data, 503 upstream quota.

Notes

  • Net buy = *_buy − *_sell.
  • Per-stock layer — no bucketing. These are the raw per-category columns; how you group them is your call. Blave's own per-stock surfaces (web, app, AI chat) count 外資自營商 as part of 外資, matching the exchanges' own column naming, and treat 自營商 as 自行買賣 plus 避險. The whole-market endpoint (GET /studio/market/twmarket/institutional) groups it differently — see that section.
  • The same-day row comes from the official TWSE / TPEx publication and appears once the exchanges have published it.
  • Server cache: 5 minutes.

Taiwan Stock Margin Trading

GET/studio/market/twstock/margin/<stock_id>
Data From
Per stock (2330: 2001-01-05)
Update
Daily

Parameters

NameDescriptionAllowedDefault
stock_id
string · pathRequired
CodeSee category conventions
start
string · query
First dateYYYY-MM-DDfull history
end
string · query
Last dateYYYY-MM-DDlatest

Example

Python
import pandas as pddata = requests.get(f"{BASE_URL}/studio/market/twstock/margin/2330", headers=headers,                    params={"start": "2024-01-01"}, timeout=60).json()["data"]df = pd.DataFrame(data)df["margin_util"] = df["margin_balance"] / df["margin_limit"]   # 融資使用率

Response

{"stock_id", "data": [...]}, one row per day. Values are lots (張), not shares — verified against TWSE MI_MARGN: for 2026-09-15 2330 returned margin_balance: 29282 and margin_limit: 6483092, matching TWSE's own 今日餘額 29,282 and 次一營業日限額 6,483,092 for that date exactly. Every row carries its own date and stock_id; when reading full history (no start / end) take every figure from the same row — margin_limit is re-published per day and changes over time.

FieldDescription
margin_buy / margin_sell融資買進 / 賣出
margin_cash_repay融資現金償還
margin_balance / margin_prev_balance融資今日 / 前日餘額
margin_limit融資限額 — TWSE's 次一營業日限額 as published on that row's date, i.e. the cap that applies to the NEXT business day (2330 on 2026-09-15: 6,483,092 lots)
short_buy / short_sell融券買進 / 賣出
short_cash_repay融券現金償還
short_balance / short_prev_balance融券今日 / 前日餘額
short_limit融券限額
offset_loan_short資券相抵

Errors

400 invalid stock_id, 404 no data, 503 upstream quota.

Notes

  • Server cache: 5 minutes.

Taiwan Stock Shareholding Distribution

GET/studio/market/twstock/shareholding/<stock_id>
Data From
Per stock (2330: 2010-01-29)
Update
Weekly, Fridays

Parameters

NameDescriptionAllowedDefault
stock_id
string · pathRequired
CodeSee category conventions
start
string · query
First dateYYYY-MM-DDfull history
end
string · query
Last dateYYYY-MM-DDlatest

Example

Python
data = requests.get(f"{BASE_URL}/studio/market/twstock/shareholding/2330", headers=headers,                    params={"start": "2024-01-01", "end": "2024-03-31"}, timeout=60).json()["data"]

Response

{"stock_id", "data": [...]}, one row per date × level.

FieldTypeDescription
datestringWeek date
stock_idstringCode
levelstringHolding bracket: 1-999, 1,000-5,000, 5,001-10,000, 10,001-15,000, 15,001-20,000, 20,001-30,000, 30,001-40,000, 40,001-50,000, 50,001-100,000, 100,001-200,000, 200,001-400,000, 400,001-600,000, 600,001-800,000, 800,001-1,000,000, more than 1,000,001, total, 差異數調整(說明4)
peopleintNumber of holders
unitintShares held
percentfloat% of issued shares

Errors

400 invalid stock_id, 404 no data, 503 upstream quota.

Notes

  • The figures are the shareholding distribution published by TDCC (集保結算所).
  • Server cache: 5 minutes.

Taiwan Stock Foreign Shareholding

GET/studio/market/twstock/foreign_shareholding/<stock_id>
Data From
2013-01-01 by default; earlier on request
Update
Daily

Parameters

NameDescriptionAllowedDefault
stock_id
string · pathRequired
CodeSee category conventions
start
string · query
First dateYYYY-MM-DD2013-01-01
end
string · query
Last dateYYYY-MM-DDtoday

Example

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

Response

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

FieldDescription
date, stock_idDay, code
ForeignInvestmentSharesShares held by foreign investors
ForeignInvestmentSharesRatioForeign holding ratio (%)
ForeignInvestmentRemainingSharesRemaining shares foreigners may buy
ForeignInvestmentRemainRatioRemaining ratio (%)
ForeignInvestmentUpperLimitRatioForeign holding cap (%)
ChineseInvestmentUpperLimitRatioPRC-investor holding cap (%)
NumberOfSharesIssuedShares issued

Errors

400 invalid stock_id, 404 no data, 503 upstream quota.

Notes

  • start defaults to 2013-01-01; send an earlier start and earlier rows come back (2330 goes back to 2004-02-12).
  • Server cache: 24 hours.

Taiwan Stock Government Bank Buy/Sell

GET/studio/market/twstock/gov_bank/<stock_id>
Data From
2021-06-30
Update
Daily

Parameters

NameDescriptionAllowedDefault
stock_id
string · pathRequired
CodeSee category conventions
start
string · query
First dayYYYY-MM-DDtoday − 6 days
end
string · query
Last day; end − start ≤ 31 daysYYYY-MM-DDtoday

Example

Python
data = requests.get(f"{BASE_URL}/studio/market/twstock/gov_bank/2330", headers=headers,                    params={"start": "2026-08-01", "end": "2026-08-07"}, timeout=60).json()["data"]

Response

{"stock_id", "data": [...]}, up to 8 rows per day (one per bank), sorted by date, bank.

FieldDescription
date, stock_idDay, code
bank_nameBank
buy / sellShares bought / sold
buy_amount / sell_amountTWD bought / sold

Errors

StatusBodyWhen
400{"error": "Date range exceeds 31 days"} or a date-parse messageRange too long / malformed date
503{"error": "Upstream rate limit. Please retry shortly."}Upstream quota exhausted

Notes

  • Server cache: 5 minutes.

Taiwan Stock Securities Lending

GET/studio/market/twstock/lending/<stock_id>
Data From
2001-05-01
Update
Daily

Parameters

NameDescriptionAllowedDefault
stock_id
string · pathRequired
CodeSee category conventions
start
string · query
First dateYYYY-MM-DDfull history
end
string · query
Last dateYYYY-MM-DDlatest

Example

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

Response

{"stock_id", "data": [...]}, several rows per day.

FieldDescription
date, stock_idDay, code
transaction_type競價 / 議借
volumeVolume
fee_rateLending fee rate
closeClose price
original_return_dateOriginal return date
original_lending_periodOriginal lending period

Errors

400 invalid stock_id, 404 no data, 503 upstream quota.

Notes

  • Server cache: 5 minutes.

Broker Buy/Sell by Stock

GET/studio/market/twstock/broker/stock/<stock_id>
Data From
2021-06-30
Update
Daily, after about 21:30 Taipei

Parameters

Send date for one day, or start (+ end) for a range; start wins if both are sent.

NameDescriptionAllowedDefault
stock_id
string · pathRequired
CodeSee category conventions
date
string · query
Single dayYYYY-MM-DDtoday
start
string · query
Range startYYYY-MM-DD
end
string · query
Range end; range ≤ 366 days inclusiveYYYY-MM-DDstart

Example

Python
rows = requests.get(f"{BASE_URL}/studio/market/twstock/broker/stock/2330", headers=headers,                    params={"start": "2026-08-03", "end": "2026-08-07"}, timeout=60).json()["data"]

Response

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

FieldTypeDescription
datestringTrading day
stock_idstringCode
broker_idstringBranch code (may be alphanumeric, e.g. 920A)
broker_namestringBranch name
pricefloatVolume-weighted average traded price
buy / sellintShares bought / sold

Errors

StatusBodyWhen
400{"error": "Invalid stock_id"}Format check failed
400{"error": "Invalid date (YYYY-MM-DD)"}Malformed date
400{"error": "start/end range is <n> days; max 366 (inclusive) — split into smaller ranges"}Range too long
503{"error": "Upstream rate limit. Please retry shortly."}Data temporarily unavailable — retry; do not read as "no trades"

Notes

  • A day with no data (holiday, before 2021-06-28, or today before ~21:30) is 200 + [].
  • Range queries are live: start / end over 2026-09-06 → 2026-09-13 returned rows spanning five distinct trading days, for both broker/stock/<stock_id> and broker/trader/<trader_id>.
  • Server cache: 5 minutes.

Broker Buy/Sell by Branch

GET/studio/market/twstock/broker/trader/<trader_id>
Data From
2021-06-30
Update
Daily, after about 21:30 Taipei

Parameters

Same date / start / end rules as /broker/stock/<stock_id>.

NameDescriptionAllowedDefault
trader_id
string · pathRequired
Branch code from /broker/searchLetters, digits, - (e.g. 9217, 920A)
date
string · query
Single dayYYYY-MM-DDtoday
start
string · query
Range startYYYY-MM-DD
end
string · query
Range end; range ≤ 366 days inclusiveYYYY-MM-DDstart

Example

Python
rows = requests.get(f"{BASE_URL}/studio/market/twstock/broker/trader/9217", headers=headers,                    params={"date": "2026-08-07"}, timeout=60).json()["data"]

Response

{"trader_id", "data": [...]}, one row per stock per day; fields date, broker_id, broker_name, stock_id, price, buy, sell (as /broker/stock).

Errors

As /broker/stock/<stock_id>, with 400 {"error": "Invalid trader_id"} for a bad code.

Notes

  • Server cache: 5 minutes.

Taiwan Stock Attention & Disposition Announcements

GET/studio/market/twstock/alerts
Data From
TWSE 2001-01; TPEx notices 2002-02, disposals 2003-09
Update
Daily at 17:45, 21:30 and 07:00 Taipei

Parameters

Give date, or start / end, or neither (= today, Taipei).

NameDescriptionAllowedDefault
date
string · query
One day: disposals in force that day, notices announced that daystrict YYYY-MM-DD; not with start / end
start
string · query
First day of the rangestrict YYYY-MM-DD2001-01-01 with stock_id, else end − 365 days
end
string · query
Last day of the range (inclusive)strict YYYY-MM-DDtoday (or start if later)
kind
string · query
Announcement typedisposal (處置), notice (注意)both
market
string · query
Exchangetwse, tpexboth
stock_id
string · query
One code; lifts the 366-day capSee category conventionsall

Range semantics: a disposal is returned when its period (start–end) overlaps the range, a notice when its announcement date is inside it. Without stock_id the range is at most 366 days inclusive — split longer whole-market ranges (one calendar year per call fits). Unlike the category default, start / end / date are strictly validated.

Example

Response

{"start", "end", "data": [...]}; start / end echo the resolved range (both equal date when date was sent). Rows sorted by date, market, kind, stock_id. One row per announcement.

FieldTypeDescription
datestringAnnouncement day YYYY-MM-DD (a disposal takes effect the next trading day)
stock_idstringCode — includes warrants, ETFs and convertible bonds (e.g. 037060, 45402)
stock_namestring | nullName as published
marketstringtwse (上市) or tpex (上櫃)
kindstringdisposal or notice
countintThe exchange's cumulative count (累計 / 累計次數)
start, endstring | nullDisposal period, both days included; null on notices
conditionstring | nullDisposal: the trigger as published (連續三次, 連續3個營業日, 最近十個營業日已有六次 …). Notice: the clauses cited (第一款、第五款); null if none
measurestring | nullDisposal type: 第一次處置, 第二次處置, 再次處置, 人工管制撮合, 收足五成款券 …; null on notices and on early TPEx rows
match_minutesint | nullDisposal: N of 「約每N分鐘撮合一次」 read from the text; null when the text names none (every TWSE disposal before ~2011 — its text is blank — and non-matching measures) and on notices
reasonstring | nullFull announcement text; null where the exchange published none (every TWSE disposal before 2011-03) (disposal 處置內容, notice 注意交易資訊)
close, pefloat | nullClose and P/E on the announcement; always null on TWSE disposals

Errors

StatusBodyWhen
400{"error": "Invalid start date, expected YYYY-MM-DD"} (or end)Malformed start / end
400{"error": "start must not be after end"}Reversed range
400{"error": "Invalid date, expected YYYY-MM-DD"}Malformed date
400{"error": "use either date or start/end"}date sent with start or end
400{"error": "Invalid stock_id"}Format check failed
400{"error": "kind must be one of ['disposal', 'notice']"} / {"error": "market must be one of ['twse', 'tpex']"}Unknown value
400{"error": "start/end range is <n> days; max 366 (inclusive) without stock_id — split into smaller ranges"}Range over 366 days without stock_id
503{"error": "Data temporarily unavailable. Please retry shortly."}A table you asked for is not servable (not refreshed for 48 h, or unreadable) — retry later, never read it as "no announcements". Only the requested kind / market tables are checked

Notes

  • A disposal is announced after the close and takes effect the next trading day — date is the announcement day, start the first day in force. To ask "under disposition on D", use date=D (or start=end=D), not the announcement date.
  • A stock can have overlapping disposal periods (a 第二次處置 announced inside the first).
  • start / end are the announced period; a market holiday or trading suspension inside it extends the real end, which the data does not record.
  • match_minutes follows the rules of the day (TPEx 5 / 20 minutes → 2 from 2026-08-10) — read it per row, never assume a value.
  • Pre-disposal candidate lists (處置候選) are not included.
  • Cite as 「資料來源:臺灣證券交易所、證券櫃檯買賣中心」.
  • The TWSE start date covers both disposals and notices.
  • A TPEx evening announcement may first appear in the 07:00 run.

Taiwan Stock Batch Fetch

GET/studio/market/twstock/batch/<data_type>
Data From
Per data_type (same as the single-stock endpoint)
Update
Per data_type

Parameters

NameDescriptionAllowedDefault
data_type
string · pathRequired
Datasetprice, price_adj, per, institutional, shareholding, foreign_shareholding, financials, balance_sheet, monthly_revenue, ratios, dividend
stock_ids
string · queryRequired
CodesComma-separated, ≤ 50
start
string · query
First dateYYYY-MM-DD (strictly validated for dividend only)per data_type
end
string · query
Last dateYYYY-MM-DDper data_type

Example

Python
payload = requests.get(f"{BASE_URL}/studio/market/twstock/batch/per", headers=headers,                       params={"stock_ids": "2330,6182", "start": "2026-08-04", "end": "2026-08-08"},                       timeout=120).json()# {"data_type": "per",#  "data": {"2330": [{"date": "2026-08-04", "dividend_yield": 0.95, "PER": 31.19, "PBR": 10.21, "stock_id": "2330"}, ...],#           "6182": [...]},#  "failed": []}

Response

{"data_type", "data": {"<stock_id>": [...rows...]}, "failed": [...]}. Rows are identical to the matching single-stock endpoint.

  • failed — ids whose server-side fetch failed (rate limit or upstream error); retry those.
  • An id absent from both data and failed genuinely has no data.

Errors

StatusBodyWhen
400{"error": "Unsupported data_type '<x>'. Supported: [...]"}Bad data_type
400{"error": "stock_ids parameter required"}Missing
400{"error": "stock_ids exceeds max 50 per request"}Too many
400{"error": "Invalid stock_id in list"}A code fails the format check
400{"error": "Invalid start date, expected YYYY-MM-DD"}dividend only

Notes

  • The whole market (~2,000 stocks) is ~40 calls; never fan out single-stock endpoints.
  • ratios (財務比率): each id's rows are the wide per-quarter rows of /ratios/<stock_id> ("data": {"2330": [{"date": "2026-06-30", "stock_id": "2330", "roe_q": 11.3934, ...}], "2317": [...]}). A code with no financial statements (ETFs) is absent from both data and failed (no 404); a ratio store that is not ready puts every id in failed (no 503).
  • dividend differs from /dividend/<stock_id>: it reads stored data only (no refresh), an unknown id or a stock with no dividend history is silently absent (no 404), and an upstream quota problem shows up in failed, not as a 503.

Taiwan Stock Sector Rotation

GET/studio/market/twstock/sector/overview
Data From
Snapshot (latest trading day)
Update
Daily; sector indices after about 14:00 Taipei, flows later

Parameters

NameDescriptionAllowedDefault
window
int · query
Trading days for relative strength and the window flow sums10, 20, 6020

Example

Response

One object (no data wrapper): {"date", "summary", "sectors": [...], "concentration", "flow_caps"}. sectors has the 32 TWSE sector indices in a fixed order.

FieldTypeUnitDescription
datestring—Latest trading day of the sector indices
summary.up / summary.downintsectorsSectors that closed up / down on date
summary.migrations_todayintsectorsSectors that changed quadrant on date
summary.foreign_total / summary.trust_totalfloatTWD 100M (億)Whole-market 外資 / 投信 net buy on the latest published day (official totals)
summary.foreign_streak / summary.trust_streakintdaysConsecutive net-buy (+N) or net-sell (−N) days
summary.margin_changefloatTWD 100M (億)Whole-market margin balance change on the latest published day
summary.margin_pctlint0–100Percentile of margin_change against the past year; null with less than a year of history
sectors[].slug / name / groupstring—Sector id (used by sector/constituents/<slug>), Chinese name, elec (電子) / fin (金融) / trad (傳產)
sectors[].weightfloat%Sector market value ÷ all mapped stocks' market value
sectors[].returnsobject%d1, d5, d10, d20, d60, ytd index returns (ytd vs the previous year's last close)
sectors[].rsfloatindex (100 = TAIEX)Relative strength over window: 100 × (sector close ÷ sector close window days earlier) ÷ (TAIEX close ÷ TAIEX close window days earlier)
sectors[].momentumfloatindex (100 = flat)100 + 5-day change in rs
sectors[].quadrantstring—leading (rs ≥ 100, momentum ≥ 100), weakening (rs ≥ 100, momentum < 100), lagging (both < 100), improving (rs < 100, momentum ≥ 100)
sectors[].migration_daysinttrading daysConsecutive trading days in the current quadrant (looks back up to 90 trading days)
sectors[].tailarray—[rs, momentum] pairs for the 4 days before date, oldest first
sectors[].clampedbool—true when rs, momentum or a tail point was capped (see Notes)
sectors[].foreign / trust / dealerfloatTWD 100M (億)Estimated 外資 / 投信 / 自營商 net buy on date
sectors[].foreign_win / trust_win / dealer_winfloatTWD 100M (億)Same, summed over the last window trading days
sectors[].foreign_win_prevfloatTWD 100M (億)Foreign sum over the window days before that
sectors[].stats.rs_up_streakintdaysConsecutive days rs rose
sectors[].stats.foreign_streak / dealer_streakintdaysConsecutive net-buy (+N) / net-sell (−N) days
sectors[].stats.d5_return_pctl_1yint0–100Percentile of the 5-day return against the past year
sectors[].stats.foreign_buy_days_20dintdaysForeign net-buy days out of the last 20
sectors[].stats.foreign_buy_days_pctl_1yint0–100Percentile of that count against the past year
concentration.top3_buy_sharefloat0–1Share of the day's positive foreign sector flow taken by the top 3 sectors
flow_capsobjectTWD 100M (億){"foreign", "trust", "dealer"}: typical size (P90) of a sector's 20-day flow sum over the past year, for colour scaling; null with less than a year of history

Any field can be null when its history is too short or the day is not published yet.

Errors

StatusBodyWhen
400{"error": "window must be one of [10, 20, 60]"}Bad window
503{"error": "<message>"}Sector data not available yet
503{"error": "Upstream rate limit. Please retry shortly."}Upstream quota exhausted

Notes

  • Sectors are the 32 TWSE 類股指數 (上市 only). Constituents, weights and flows use TWSE-listed common stocks; OTC (上櫃) stocks are not in any sector.
  • Sector flows are estimates (each stock's daily net shares × that day's close, summed per sector). The summary totals are the official whole-market amounts, so they will not equal the sum of the sectors.
  • rs, momentum and tail are capped for charting (window 10: 88–112, 20: 85–115, 60: 78–122; momentum 88–112) and clamped is set when a cap applied. quadrant and migration_days always use the uncapped values.
  • Flows publish later than the indices. foreign / trust / dealer are only ever date's own values, so they are null until that day's flows publish. *_win, foreign_win_prev, the streaks and foreign_buy_days_* end on the latest published flow day, which in the afternoon can be the previous trading day.
  • foreign_win / trust_win / dealer_win are null until the window has enough flow days.
  • Sector slugs: cement, food, plastic, textile, electric_machinery, wire_cable, chemical, biotech, glass_ceramic, paper, steel, rubber, automobile, semiconductor, computer_peripheral, optoelectronic, communication, electronic_components, electronic_distribution, information_service, other_electronic, construction, shipping, tourism, financial, trading_consumer, oil_gas, green_energy, digital_cloud, sports_leisure, household, other.

Taiwan Stock Sector Breadth

GET/studio/market/twstock/sector/breadth
Data From
Up to 730 calendar days back
Update
Daily, after about 14:00 Taipei

Parameters

NameDescriptionAllowedDefault
days
int · query
Calendar days back from today≥ 1; values above 730 are treated as 730365

Example

Python
body = requests.get(f"{BASE_URL}/studio/market/twstock/sector/breadth", headers=headers,                    params={"days": 90}, timeout=120).json()# Live capture 2026-11-06 (abridged with ...):# {"dates": ["2026-08-10", "2026-08-11", "2026-08-12", ..., "2026-11-06"],#  "pct_up": [76.7, 46.7, 56.7, ..., 6.2]}   # 60 trading days

Response

One object (no data wrapper): {"dates": [...], "pct_up": [...]}, parallel arrays, one element per trading day, oldest first.

FieldTypeUnitDescription
datesstring[]—Trading days (YYYY-MM-DD)
pct_upfloat[]%Share of the sector indices that closed up that day, out of those with a change figure that day (32 on most days; one decimal)

Errors

StatusBodyWhen
400{"error": "days must be an integer"}Not an integer
400{"error": "days must be positive"}days < 1
503{"error": "<message>"}Sector data not available yet
503{"error": "Upstream rate limit. Please retry shortly."}Upstream quota exhausted

Notes

  • A flat sector counts as not up; a sector with no change figure that day is left out of that day's denominator.
  • Server cache: 5 minutes.

Taiwan Stock Sector Constituents

GET/studio/market/twstock/sector/constituents/<slug>
Data From
Snapshot (latest trading day)
Update
Daily (EOD)

Parameters

NameDescriptionAllowedDefault
slug
string · pathRequired
SectorOne of the 32 sector slugs listed under sector/overview

Example

Python
body = requests.get(f"{BASE_URL}/studio/market/twstock/sector/constituents/semiconductor", headers=headers,                    timeout=60).json()# Live capture 2026-11-06 (abridged with ...):# {"date": "2026-11-06", "total": 116,#  "stocks": [{"stock_id": "2330", "name": "台積電", "chg": -4.69, "foreign": -487.7,#              "themes": [{"slug": "silicon-photonics-cpo",#                          "name": {"zh": "矽光子/CPO", "en": "Silicon Photonics / CPO", "cn": "硅光子/CPO"}}]},#             {"stock_id": "2454", "name": "聯發科", "chg": -2.02, "foreign": -153.8, "themes": []}, ...,#             {"stock_id": "2408", "name": "南亞科", "chg": -4.58, "foreign": 19.3,#              "themes": [{"slug": "memory", "name": {"zh": "記憶體", "en": "Memory", "cn": "存储器"}}]}, ... 5 rows]}

Response

One object (no data wrapper): {"date", "total", "stocks": [...]}. stocks is the sector's 5 largest constituents by market value, largest first.

FieldTypeUnitDescription
datestring—Trading day of the prices
totalintstocksNumber of constituents in the sector
stocks[].stock_id / namestring—Code, name
stocks[].chgfloat%Change on date
stocks[].foreignfloatTWD 100M (億)Estimated foreign net buy on date (net shares × close)
stocks[].themesarray—[{"slug", "name"}] concept-stock themes the stock belongs to, name = {"zh", "en", "cn"}; [] when none

Errors

StatusBodyWhen
404{"error": "Unknown sector slug"}slug is not one of the 32
503{"error": "No recent market price data available"}No published prices in the last 7 days
503{"error": "Upstream rate limit. Please retry shortly."}Upstream quota exhausted

Notes

  • Constituents are TWSE-listed common stocks mapped to the sector by industry category; a stock belongs to one sector only.
  • chg and foreign are null when that stock's price or flow for the day is missing. On days when market values are not published yet, the 5 stocks fall back to code order.
  • Server cache: 30 minutes.

Taiwan Stock Concept Themes

GET/studio/market/twstock/theme/overview
Data From
Snapshot (latest trading day)
Update
Daily, after the close

Parameters

NameDescriptionAllowedDefault
window
int · query
Trading days for the window flow sums10, 20, 6020

Example

Response

One object (no data wrapper): {"date", "list_ym", "first_ym", "list_age_days", "stale_months", "pctl_includes_backfill", "summary", "themes": [...], "flow_caps"}.

FieldTypeUnitDescription
datestring—Latest trading day of the theme indices
list_ymstring—Month of the newest theme lists, YYYY-MM
first_ymstring—Month of the first list of any theme
list_age_days / stale_monthsintdays / monthsAge of the newest lists: days since they took effect, months since their list month
pctl_includes_backfillbool—true when a percentile's one-year history reaches back before a list took effect
summary.up / summary.downintthemesThemes up / down on date
summary.top / summary.bottomobject%{"slug", "d20"}: best and worst 20-day return
summary.foreign_topobjectTWD 100M (億){"slug", "foreign_win", "foreign_win_ex_top", "top_name"}: theme with the largest foreign net buy once its largest stock is taken out
themes[].slugstring—Theme id (used by the other theme endpoints)
themes[].nameobject—{"zh", "en", "cn"}
themes[].countintstocksMembers in the current list (delisted stocks excluded)
themes[].snapshot_ymstring—Month of the theme's current list
themes[].indexablebool—true when the theme has at least 5 members and its list is at most 90 days old
themes[].returnsobject%d1, d5, d10, d20, d60, ytd returns of the theme index
themes[].returns_backfillobject—Same keys, true when that return starts before the theme's first list took effect
themes[].foreign / trust / dealerfloatTWD 100M (億)Estimated net buy of the members on date; null until that day's flows publish
themes[].foreign_win / trust_win / dealer_winfloatTWD 100M (億)Same, summed over the last window trading days
themes[].foreign_win_prevfloatTWD 100M (億)Foreign sum over the window days before that
themes[].foreign_win_ex_topfloatTWD 100M (億)foreign_win without the largest member's own foreign flow
themes[].foreign_buy_membersintstocksMembers with a positive foreign sum over the window
themes[].topobject%{"stock_id", "name", "mv_share"}: largest member and its share of the theme's market value, measured on the list's effective date
themes[].top5array—[{"stock_id", "name"}]: 5 largest members by market value on the list's effective date
themes[].statsobject—foreign_streak, dealer_streak (±days), d5_return_pctl_1y, foreign_buy_days_20d, foreign_buy_days_pctl_1y — same meaning as in sector/overview
flow_capsobjectTWD 100M (億){"foreign", "trust", "dealer"}: typical size (P90) of a theme's 20-day flow sum, for colour scaling; null with less than a year of flow history

Errors

StatusBodyWhen
400{"error": "window must be one of [10, 20, 60]"}Bad window
503{"error": "not_yet_effective"}No theme list is in effect yet

Notes

  • Themes are concept-stock lists Blave curates and publishes monthly (上市 + 上櫃), each with a reason and public sources per stock (see theme/constituents/<slug>). Current slugs: ai, silicon-photonics-cpo, memory, pcb-abf-substrate, thermal-cooling, robotics.
  • The theme index is equal-weight and dividend-adjusted (total return). Before a theme's first list took effect it is backfilled with that first list, so those returns carry hindsight — returns_backfill marks them.
  • Flows are estimates: each member's daily net shares × that day's close, summed. *_win, the streaks and foreign_buy_days_* end on the latest published flow day, which in the afternoon can be the previous trading day.
  • A theme that is retired drops out of themes.

Taiwan Stock Theme Constituents

GET/studio/market/twstock/theme/constituents/<slug>
Data From
Snapshot (current list)
Update
Daily, after the close; lists monthly

Parameters

NameDescriptionAllowedDefault
slug
string · pathRequired
ThemeA theme slug from theme/overview

Example

Response

One object (no data wrapper).

FieldTypeDescription
datestringTrading day of the per-stock figures
slug, statusstringTheme id, active
name / introobject{"zh", "en", "cn"} theme name / one-paragraph description
snapshot_ymstringMonth of the current list
published_at / effective_datestringDay the list was published / took effect
first_ymstringMonth of the theme's first list
list_age_days / stale_monthsintDays since the list took effect / months since its list month
countintMembers, delisted stocks excluded
indexablebooltrue with at least 5 members and a list at most 90 days old
changesobject{"added", "removed", "prev_ym"}: stock ids added / removed against the previous list (prev_ym null for the first list)
relatedarray[{"slug", "overlap"}]: up to 3 other themes sharing members, most shared first
gatedboolAlways false for API keys
stocks[].stock_id / namestringCode, name
stocks[].marketstringtwse or tpex
stocks[].sector_slugstringSector slug as in sector/overview by industry category (OTC stocks included); null when unmapped
stocks[].chgfloatChange % on date
stocks[].foreignfloatEstimated foreign net buy on date, TWD 100M (億); null until that day's flows publish
stocks[].ret20floatDividend-adjusted 20-trading-day return, %
stocks[].rev_yoyfloatLatest monthly revenue vs a year earlier, %
stocks[].roefloatTrailing four-quarter ROE, %
stocks[].foreign_share_chg_20dfloatChange in foreign shareholding over 20 trading days, percentage points
stocks[].disposalboolUnder disposition today
stocks[].delisted / last_trade_datebool / stringDelisted since the list was made, and its last trading day (null otherwise)
stocks[].alsostring[]Other themes holding the stock
stocks[].reasonobject{"zh", "en", "cn"} why the stock is in the theme
stocks[].sourcesarray[{"kind", "label", "url", "date"}]: public sources for the reason; kind filing or news, label {"zh", "en", "cn"}

Errors

StatusBodyWhen
404{"error": "Unknown theme"}No such slug
410{"error": "Theme retired", "retired": true}Theme retired
503{"error": "not_yet_effective"}The theme's list is not in effect yet

Notes

  • Delisted members stay in stocks (listed last) with delisted: true; count leaves them out.
  • rev_yoy, roe and foreign_share_chg_20d can each be null on their own when that figure is missing for a stock.

Taiwan Stock Theme Index

GET/studio/market/twstock/theme/<slug>/index
Data From
Last 3 years, rolling (backfilled before each theme's first list)
Update
Daily, after the close

Parameters

NameDescriptionAllowedDefault
slug
string · pathRequired
ThemeA theme slug from theme/overview
range
string · query
Calendar window ending on the latest day (92 / 366 / 1,096 days)3m, 1y, 3y3m

Example

Python
body = requests.get(f"{BASE_URL}/studio/market/twstock/theme/memory/index", headers=headers,                    params={"range": "3y"}, timeout=60).json()# Live capture 2026-11-06 (abridged with ...):# {"slug": "memory", "range": "3y", "base_date": "2026-10-14", "first_ym": "2026-10",#  "points": [{"date": "2023-11-06", "value": 19.82, "taiex": 31.86, "tpex": 48.39, "is_backfill": true,#              "n": 9, "snapshot_ym": "2026-10"}, ...,#             {"date": "2026-10-14", "value": 100.0, "taiex": 100.0, "tpex": 100.0, "is_backfill": true, "n": 9,#              "snapshot_ym": "2026-10"}, ...,#             {"date": "2026-11-06", "value": 79.89, "taiex": 81.65, "tpex": 72.37, "is_backfill": false,#              "n": 9, "snapshot_ym": "2026-10"}]}   # 728 points

Response

One object (no data wrapper): {"slug", "range", "base_date", "first_ym", "points": [...]}, points oldest first.

FieldTypeDescription
base_datestringDay the index is 100 (the trading day before the theme's first list took effect)
first_ymstringMonth of the theme's first list
points[].datestringTrading day
points[].valuefloatTheme index, 100 on base_date
points[].taiex / tpexfloatTAIEX / TPEx total-return indices rescaled to 100 on base_date, for comparison
points[].is_backfillbooltrue before the theme's first list took effect (members taken from that first list)
points[].nintMembers in the index that day
points[].snapshot_ymstringMonth of the list the members came from

Errors

StatusBodyWhen
400{"error": "range must be one of ['3m', '1y', '3y']"}Bad range
404{"error": "Unknown theme"}No such slug
410{"error": "Theme retired", "retired": true}Theme retired
503{"error": "not_yet_effective"}The theme's list is not in effect yet

Notes

  • Equal weight, dividend-adjusted. Members are fixed at the start of each month and on each new list's effective date; a member that stops trading mid-period is frozen until the next reset.
  • The backfilled part uses a list made later, so it reflects stocks known to belong to the theme today — read it as context, not as a backtest.
  • To compare with the market, divide value by taiex (or tpex) at each point.

Institutional Buying Breadth by Group

GET/studio/market/twstock/chip_breadth/<scope>
Data From
Snapshot (latest close)
Update
Nightly, after the close

Parameters

NameDescriptionAllowedDefault
scope
string · pathRequired
Group typetheme, sector
window
int · query
Trading days the net buy is summed over10, 20, 6020
inst
string · query
Investor the groups are ranked byforeign, trustforeign

Example

Response

One object (no data wrapper): {"scope", "window", "inst", "as_of", "min_group", "baseline", "groups": [...], "excluded": [...], "sources"}.

FieldTypeDescription
as_ofstringLast day of the flow window
min_groupintGroups with fewer counted stocks than this are not ranked (6)
baseline.universestringMarket the groups are compared with: twse for sectors, twse+tpex for themes
baseline.foreign / baseline.trustobject{"buy", "total", "ratio"}: common stocks in that market net bought over the window, all counted, and the share in %
groups[].slug / name—Group id; name is a string for sectors and {"zh", "en", "cn"} for themes
groups[].totalintCounted stocks in the group
groups[].foreign / groups[].trustobject{"buy", "ratio", "gap", "rank"}: stocks net bought, their share in %, the share minus the baseline share in percentage points (integer), and the rank by share
excludedarray[{"slug", "name", "total"}]: groups under min_group
sources.institutionalobject{"zh", "en", "cn"} name of the exchange(s) behind the flows

groups is ordered by inst's rank; both investors' ranks are always present.

Errors

StatusBodyWhen
400{"error": "window must be one of [10, 20, 60]"}Bad window
400{"error": "inst must be one of ['foreign', 'trust']"}Bad inst
404{"error": "Unknown scope"}scope is not theme / sector
503{"error": "not_yet_effective"}theme: no theme list in effect yet
503{"error": "Data temporarily unavailable. Please retry shortly."}Upstream quota exhausted or the stock-to-sector map is unavailable

Notes

  • Counted stocks are common stocks (no ETF, ETN, REIT, preferred share or depositary receipt) with a flow figure for the window. Net bought means the window's estimated net buy (daily net shares × close) is above 0.
  • Sectors are the 32 TWSE sectors of sector/overview (上市 only); themes are the lists of theme/overview (上市 + 上櫃) — which is why their baselines differ.
  • Ties in share rank the group with more counted stocks first, then by slug.
  • gap rounds half away from zero on the exact fraction.

Institutional Buying Breadth Constituents

GET/studio/market/twstock/chip_breadth/<scope>/<slug>
Data From
Snapshot (latest close)
Update
Nightly, after the close

Parameters

NameDescriptionAllowedDefault
scope
string · pathRequired
Group typetheme, sector
slug
string · pathRequired
GroupA sector slug (sector/overview) or theme slug (theme/overview)
window
int · query
Trading days the net buy is summed over10, 20, 6020

Example

Response

One object (no data wrapper): the ranking's scope, window, as_of, min_group and baseline, plus:

FieldTypeDescription
price_as_ofstringDay the prices and returns end on
slugstringGroup
groupobjectThe group's row as in the ranking (rank missing when it is not ranked)
rankedboolfalse when the group is under min_group
stocks[].stock_id / name / marketstringCode, name, twse / tpex
stocks[].foreign / truststringbuy, sell or flat over the window
stocks[].foreign_<N>dfloatEstimated foreign net buy over the window, TWD 100M (億); <N> = window
stocks[].market_capfloatTWD 100M (億)
stocks[].ret_<N>dfloatReturn over the window, % (dividend-adjusted where available)
stocks[].themesarray[{"slug", "name"}] every theme holding the stock (for scope theme, the requested theme is left out), name = {"zh", "en", "cn"}
stocks[].disposal / noticeboolUnder disposition / attention notice on as_of; null when that data is unavailable
excluded_countintMembers not counted (non-common or no flow figure)
alerts_availableboolfalse when the disposition / attention data could not be read
sourcesobject{"institutional", "alerts"}, each {"zh", "en", "cn"}

stocks holds the counted members only (its length is group.total), largest market cap first.

Errors

StatusBodyWhen
400{"error": "window must be one of [10, 20, 60]"}Bad window
404{"error": "Unknown scope"}scope is not theme / sector
404{"error": "Unknown group"}No such slug in that scope
410{"error": "Theme retired", "retired": true}Theme retired
503{"error": "not_yet_effective"}The theme's list is not in effect yet
503{"error": "Data temporarily unavailable. Please retry shortly."}Upstream quota exhausted or the stock-to-sector map is unavailable

Notes

  • disposal / notice are judged on as_of: a disposition period covering that day, an attention notice announced on it.

Taiwan Stock Screener

POST/studio/market/twstock/screener/run
Data From
Snapshot (latest close, whole market)
Update
Nightly, after the close

Parameters

JSON request body (send with json=; any other body is a 400). Every field is optional; {} returns the 300 largest common stocks by market cap.

NameDescriptionAllowedDefault
filters
array · body
Conditions, shapes below≤ 40 conditions, all must match (AND)[]
include_types
string[] · body
Add these security types to the default universe of common stocksSubset of etf, etn, reit, preferred, dr[]
sort
object · body
Order of rows; null values sort lastindicator = any numeric key below; dir = asc / desc{"indicator": "market_cap", "dir": "desc"}
limit
int · body
Rows returned (total still counts every match)1–300300

Condition shapes in filters:

ConditionShapeMatches
Numeric{"indicator": "per", "operator_id": 4, "value": 15}operator_id 1 >, 2 <, 3 ≥, 4 ≤; a null value never matches
Market{"indicator": "market", "op": "in", "values": ["twse"]}op = in / not_in; values twse (上市), tpex (上櫃)
Industry{"indicator": "industry", "op": "in", "values": ["24", "28"]}Exchange industry codes (Notes)
Theme{"indicator": "theme", "op": "not_in", "values": ["ai"]}Concept-stock theme slugs (Notes)
Exclude{"indicator": "exclude", "values": ["disposal", "notice"]}Drops 處置股 in force today / 注意股 announced since the snapshot day

Set conditions take 1–50 values. An unknown indicator, operator or value is a 400 — nothing is skipped silently.

Numeric indicators (also the numeric columns of every row):

KeyUnitDescription
per×P/E: close ÷ trailing four-quarter EPS, as published by the exchange; null for loss-makers
pbr×P/B: close ÷ latest book value per share, as published by the exchange; null when the exchange publishes none (P/B ≤ 0)
dividend_yield%Trailing-year cash dividends ÷ close, as published by the exchange; null above 50% (not comparable)
roe_ttm%Trailing four-quarter net income ÷ average equity
gross_margin_q / operating_margin_q%Latest quarter; not reported by financials
eps_ttmTWDSum of the last four quarters
rev_yoy%Latest reported month's revenue vs the same month a year earlier
market_capTWD 100M (億)Close × shares outstanding
turnover_20dTWD 100M (億)Average daily traded value over the last 20 trading days
closeTWDLatest close
ret_5d / ret_20d / ret_60d%Dividend-adjusted return over 5 / 20 / 60 trading days
foreign_5d / foreign_20d / foreign_60dTWD 100M (億)Estimated foreign net buy over 5 / 20 / 60 trading days (daily net shares × that day's close); positive = net buy
trust_5d / trust_20d / trust_60dTWD 100M (億)Same for investment trusts (投信)

Example

Response

One object (no data wrapper).

FieldTypeDescription
as_ofstringSnapshot trading day
datesobjectAs-of day per source: price, per, market_cap, flows (flows can be one day before as_of)
totalintMatches before limit
columnsarrayThe result table's columns: the defaults (close, per, pbr, dividend_yield, roe_ttm, rev_yoy, market_cap) plus every filtered or sorted indicator. Each has key, name ({"zh", "en"}), value_format (x / pct / twd / twd_100m), value_decimals, signed, colored, family, window, filtered
sortobjectThe sort applied
rows[].stock_id / namestringCode, name
rows[].marketstringtwse or tpex (lowercase here)
rows[].sec_typestringcommon, etf, etn, reit, preferred, dr
rows[].industrystringExchange industry code; null when the exchange gives none
rows[].fin_quarterstringQuarter behind the ratio columns, e.g. 2026Q2 (differs by stock during filing season)
rows[].rev_monthstringMonth behind rev_yoy, e.g. 2026-09
rows[].adjboolfalse when the returns could not be dividend-adjusted
rows[].themesstring[]Theme slugs the stock belongs to
rows[].disposal / noticeboolUnder disposition today / attention notice since as_of; null when that data is unavailable
rows[].<numeric key>floatEvery numeric indicator above, rounded to 4 decimals; null when missing

Errors

StatusBodyWhen
400{"error": "<what is wrong>"}Invalid body, e.g. "body must be a JSON object", "limit must be an integer 1–300", "unknown indicator 'pe'"
503{"error": "Data temporarily unavailable. Please retry shortly."}Snapshot not available
503{"error": "themes_unavailable", "message": "..."}A theme condition while theme lists are not in effect — drop it or retry later
503{"error": "alerts_unavailable", "message": "..."}An exclude condition while attention / disposition data is unavailable — drop it or retry shortly

Notes

  • Universe: 上市 + 上櫃 (興櫃 excluded). Default is common stocks only; add other types with include_types.
  • All numbers come from one post-close snapshot; nothing is intraday. Check dates before comparing with other endpoints.
  • market is lowercase here (twse / tpex), unlike market_value/all (TWSE / TPEx).
  • Industry codes: 01 水泥工業, 02 食品工業, 03 塑膠工業, 04 紡織纖維, 05 電機機械, 06 電器電纜, 08 玻璃陶瓷, 09 造紙工業, 10 鋼鐵工業, 11 橡膠工業, 12 汽車工業, 14 建材營造, 15 航運業, 16 觀光餐旅, 17 金融保險, 18 貿易百貨, 19 綜合, 20 其他, 21 化學工業, 22 生技醫療, 23 油電燃氣, 24 半導體, 25 電腦及週邊設備, 26 光電, 27 通信網路, 28 電子零組件, 29 電子通路, 30 資訊服務, 31 其他電子, 32 文化創意, 33 農業科技, 34 電子商務, 35 綠能環保, 36 數位雲端, 37 運動休閒, 38 居家生活, 91 存託憑證.
  • Theme slugs: ai, silicon-photonics-cpo (矽光子/CPO), memory (記憶體), pcb-abf-substrate (PCB/ABF 載板), thermal-cooling (散熱), robotics (機器人).
  • per is null for loss-making companies, so per < 10 does not pick them up; a null never matches any numeric condition.
  • Results are computed on every request (not cached).