What are the limitations of the TWSE API, and how do you use the official OpenAPI?

Published

The official TWSE OpenAPI is free, needs no API key, and returns JSON on a plain GET. Three boundaries matter in practice: most endpoints serve the latest period as a snapshot rather than a queryable history, dates are ROC-calendar strings, and the listed and OTC markets name the same fields differently. If you are willing to poll and store it yourself, it is entirely sufficient.

First, the official OpenAPI is the first-hand source, and it is free

Both the Taiwan Stock Exchange (TWSE) and the Taipei Exchange (TPEx) publish open-data APIs. No registration, no API key: an HTTP GET returns a JSON array. This is the origin of all Taiwan market data, including ours. If the official endpoint has what you need and you are happy to do the downstream work, using it directly is the sensible choice.

curl "https://openapi.twse.com.tw/v1/opendata/t187ap05_L"

Boundary 1: most endpoints return the latest period, not a history range

This is the one people hit first. The listed-market monthly revenue endpoint, t187ap05_L, returns a full-market snapshot of the most recently published month — roughly a thousand rows when probed on 2026-07-31, all sharing the same reporting month — rather than a query you can point at a date range. Adding a date parameter does not change the response. Historical depth is therefore not something you query; it is something you accumulate by polling on a schedule and storing the results. If you start today, you do not have last year.

curl -s "https://openapi.twse.com.tw/v1/opendata/t187ap05_L?date=202401" | head -c 200
# identical to the call without the parameter: still the latest period

Boundary 2: ROC-calendar dates and Chinese field names

Dates come back looking like 1150730, meaning the 115th year of the ROC era, 30 July — 2026-07-30 in the Gregorian calendar, which you convert yourself. Field names on the TWSE side are largely Chinese strings, so your code either uses Chinese keys or carries a mapping layer. Numeric values arrive as strings and need casting, and some fields use a full-width dash to mean "no value". All of it is workable; it is simply work you repeat for every endpoint you add.

Boundary 3: listed and OTC are two separate APIs with different field names

The same logical dataset lives on openapi.twse.com.tw for listed companies and on www.tpex.org.tw for OTC ones, under different naming conventions. Company profiles are the clearest example: the listed endpoint t187ap03_L uses Chinese field names, while the OTC endpoint mopsfin_t187ap03_O uses English ones such as SecuritiesCompanyCode and Chairman. Whole-market analysis therefore needs a cross-market field mapping that you own and keep current as the official formats evolve.

Quotas and formats: follow the official announcements

The endpoints do not advertise explicit rate-limit headers, so the authoritative answer on request quotas, terms of use and format changes is whatever TWSE and TPEx publish. The practical approach is to throttle yourself, add retries and caching, and avoid assuming you can poll at high frequency.

When it is worth moving to a traceable API

The official endpoints fit well when you want current data, at modest volume, and are happy to run the fetching and cleaning. The build-it-yourself cost starts to outweigh the saving when you need multi-year history for backtests, cross-dataset questions (prices by revenue by institutional flows) answered in one query, per-row lineage and knowledge dates for point-in-time validation, or an AI agent that can discover the endpoints on its own.

# TW Market Data: one schema, cross-dataset, with a date rangecurl "https://api.twmarketdata.com/v2/datasets/monthly-revenue?symbol=2330" \  -H "X-API-Key: $TWMD_API_KEY"

Common questions

1Does the TWSE API need an API key?
No. The TWSE and TPEx open-data endpoints answer a plain HTTP GET with a JSON array — no registration and no key required.
2Can the TWSE OpenAPI return historical data?
Most open-data endpoints return a full-market snapshot of the latest period rather than a queryable date range. Probed on 2026-07-31, t187ap05_L (listed monthly revenue) returned identical content with and without a date parameter. Accumulating history means polling and storing it yourself.
3Does the TWSE API have a rate limit?
The responses do not carry explicit rate-limit headers, so quotas and terms of use are whatever TWSE and TPEx officially announce. In practice, throttle your own calls and add retries and caching rather than polling aggressively.
4Why is the date formatted as 1150730?
That is the ROC calendar: 1150730 is the 115th year of the ROC era, 30 July, or 2026-07-30 in the Gregorian calendar. Convert it before use.
5Can I query listed and OTC data together?
Not directly — the official endpoints sit on two domains and name their fields differently, so you merge and map them yourself. TW Market Data normalizes both into one schema so a single query spans them.
6Do I still need a paid Taiwan stock API?
It depends. For current data at modest volume, the official endpoints are enough. A paid layer earns its place when you need multi-year history, cross-dataset queries, source lineage and point-in-time validation, or direct AI-agent access — what you buy is the build and maintenance time.

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

Related articles