What is the TWSE OpenAPI? A guide to the common endpoints

Published

The TWSE OpenAPI is the Taiwan Stock Exchange's open-data interface — no registration, no API key, a plain HTTP GET returns a JSON array. OTC data comes from a separate set of TPEx endpoints. Two shared traits are worth knowing up front: dates are ROC-calendar strings, and most endpoints return a latest-period snapshot rather than a queryable history.

TWSE OpenAPI

The Taiwan Stock Exchange's open-data interface: no registration, no API key, a plain HTTP GET returns a JSON array. OTC data is served by the Taipei Exchange (TPEx) from a separate set of endpoints.

Common endpoints — what each returns, and its limit

EndpointReturnsLimit
t187ap03_LListed company profiles (full name, industry code, business number, officers)Latest snapshot only
mopsfin_t187ap03_OThe same for OTC issuers; field names are in EnglishLatest snapshot; English field names
t187ap05_LListed companies' monthly operating revenue, with prior-month and year-ago figuresLatest snapshot, no date range
tpex_mainboard_daily_close_quotesOTC mainboard daily closing quotes, with OHLC and traded volumeMost recent trading day
STOCK_DAY_ALLWhole listed market, one trading day of OHLC and volume?date= has no effect (measured 2026-09-14)
T86 (rwd host)Per-stock institutional net buyingAccepts a date — the opposite of the above (measured 2026-09-14)

Getting started

Endpoints look like https://openapi.twse.com.tw/v1/opendata/{code} and need no authentication. The response is a JSON array, one element per row. The OTC equivalents live at https://www.tpex.org.tw/openapi/v1/{code}. A useful first step is to save one response to a file and read the fields, because the naming is not consistent between the two markets.

curl -s "https://openapi.twse.com.tw/v1/opendata/t187ap03_L" | head -c 300

Commonly used endpoints

  • t187ap03_L — listed company profiles (full name, industry code, business number, officers). The OTC counterpart is mopsfin_t187ap03_O.
  • t187ap05_L — listed companies' monthly operating revenue, with prior-month and year-ago figures and percentage changes.
  • tpex_mainboard_daily_close_quotes (TPEx) — OTC mainboard daily closing quotes, with OHLC and traded volume.

First, separate the two: TWSE runs two different APIs

This is the thing worth knowing before anything else, and you can check it yourself. The Taiwan Stock Exchange serves two interfaces. openapi.twse.com.tw is the documented open-data API — probed on 2026-09-14, its swagger.json publishes 143 paths. www.twse.com.tw/rwd/... is a different set, and the T86 institutional-flow endpoint lives there. The practical difference is that the same date parameter is treated in opposite ways: the openapi host ignores it, the rwd host honours it and returns different data. That is also why T86 is absent from the swagger file — it was never part of that group. Treating the two as one API is how people reach the overly strong conclusion that TWSE offers no history at all.

# openapi host: the date makes no differencecurl -s "https://openapi.twse.com.tw/v1/exchangeReport/STOCK_DAY_ALL?date=20260601" | head -c 120 # rwd host: the date is honouredcurl -s "https://www.twse.com.tw/rwd/zh/fund/T86?date=20260601&response=json&selectType=ALL" | head -c 120

Three things every endpoint shares

  • ROC-calendar dates: a date field of 1150730 means the 115th ROC year, 30 July — add 1911 for the Gregorian year.
  • Snapshots, not history: most open-data endpoints return the whole market for the latest period, with no date parameter. History is accumulated by polling and storing.
  • Two separate APIs: listed and OTC data sit on different domains with different field-naming conventions, so cross-market analysis needs a mapping you maintain.

Terms of use and quotas

Request quotas, terms of use and any format changes are whatever TWSE and TPEx officially announce — that is the authoritative source. The responses carry no explicit rate-limit headers, so throttle your own calls and add retries and caching rather than polling aggressively.

Per-endpoint detail

Each page below carries runnable examples, the full field list, the limits observed when calling it directly, and what to do instead when you need history or both markets at once.

Common questions

1Does the TWSE OpenAPI require an account?
No. The endpoints answer a plain HTTP GET with no registration and no API key.
2Are the TWSE and TPEx APIs the same thing?
No. Listed-market data is served from openapi.twse.com.tw and OTC data from www.tpex.org.tw — two independent endpoint sets with different field-naming conventions.
3How much history can I get from the TWSE OpenAPI?
Most endpoints expose only the latest period, with no history parameter. Building a historical series means calling them on a schedule and storing every result.
4Why do the returned dates look a digit short?
They use the ROC calendar rather than the Gregorian one. 1150730 is ROC year 115, 30 July; add 1911 to get 2026.
5Is there an official Python package?
None is needed — the endpoints are ordinary HTTP JSON, so requests or any HTTP client works. What you do write yourself is the ROC date conversion, the string casting and the cross-market field mapping.

Want to query this data yourself? Create a free account.

Related articles