TSMC, Hon Hai (Foxconn), MediaTek, Delta Electronics: some of the most important companies in the global semiconductor and electronics supply chain trade in Taiwan. If you’re building a Taiwan stock app, a quant strategy, or a market monitor, the first thing you need is a reliable source of real-time data.

Infoway API now supports Taiwan stocks, covering about 2,350 stocks listed on the Taiwan Stock Exchange (TWSE) and traded on the Taipei Exchange (TPEx). This guide walks through the market rules that matter for developers, then shows you how to pull real-time trades, candlesticks, and order book data with Python, and how to stream live quotes over WebSocket.

1. Taiwan Market Rules to Know Before You Start

Taiwan’s market works differently from the US market in a few ways that directly affect how you handle the data:

ItemRule
ExchangesTaiwan Stock Exchange (TWSE, listed stocks) and Taipei Exchange (TPEx, OTC stocks)
Regular sessionMonday to Friday, 09:00–13:30 (UTC+8), with no lunch break
Call auctionsOpening 08:30–09:00, closing 13:25–13:30
Daily price limit±10%
Trading unit1 board lot = 1,000 shares; anything under 1,000 shares is an odd lot
CurrencyNew Taiwan dollar (TWD)

These rules come from TWSE’s trading system overview. The one that trips people up most is the trading unit. Local investors usually quote volume in lots, but Infoway API reports volume in shares, so convert as needed when you display it.

2. Two Ways to Get Real-Time Taiwan Stock Data

2.1 License the Data Directly from the Exchange

Anyone can view basic quotes on TWSE’s website for free, but putting real-time data into your own product requires a license. Under TWSE’s latest fee schedule (in Chinese), these are the main costs for applicants that aren’t securities or futures firms:

FeeAmount (TWD)
Transmission license fee60,000 per month
Information fee (internet delivery with auto-refreshing quotes, 0–5,000 users)100,000 per month
Information fee (above 5,000 users)12 per additional user per month
Non-display use license fee (trading, risk management, portfolio management, etc.)Announced separately

Take an app with auto-refreshing quotes as an example. These two fees alone come to NT$160,000 a month before you’ve built anything. That covers TWSE only. It doesn’t include TPEx data for OTC stocks, development, or dedicated lines, and you still have to sign a contract with the exchange. This route makes sense for larger institutions, but it’s out of reach for most individual developers and small teams.

2.2 Use a Third-Party Data Provider

TWSE also points users to a second option: getting real-time data through contracted information vendors. You don’t have to deal with the exchange yourself, and you can go live much faster.

Infoway API is a third-party data provider. A single API key gives you data for both TWSE and TPEx stocks, and the endpoints work the same way as they do for US, Hong Kong, and China A-shares. Paid plans start at 99 USDT a month, and there’s a 7-day free trial with no credit card required.

3. What Taiwan Stock Data Infoway API Provides

DataWhat’s includedHTTPWebSocket
Real-time tradesPrice, volume, turnover, trade directionYesYes
Candlesticks1-minute to yearly bars with OHLC, volume, turnover, change, and percent changeYesYes
Order book (level 1)Best bid and best ask price and sizeYesYes
Company profileCompany name, exchange, currency, EPS, dividend yield, sector, and moreYesNo
Trading calendar and hoursTaiwan trading days and session timesYesNo
Financial statementsQuarterly and annual statements, revenue breakdown, dividend history, and moreYesNo

Every Taiwan ticker uses the code.TW format, whether it’s listed on TWSE or TPEx:

CompanyTickerMarket
TSMC2330.TWTWSE
Hon Hai (Foxconn)2317.TWTWSE
MediaTek2454.TWTWSE
Delta Electronics2308.TWTWSE
GlobalWafers6488.TWTPEx

To tell TWSE and TPEx stocks apart, check the exchange field in the company profile endpoint (see section 4.6).

4. How to Use the Taiwan Stock API

First, sign up on the Infoway website to get your API key. Every HTTP request needs this key in the request header. The examples below use Python, so install the dependencies first:

pip install requests websockets

The examples use 2330.TW (TSMC), which is included in the free trial, so you can run them as soon as you sign up.

4.1 Get the List of Taiwan Tickers

You can download the ticker list from your account dashboard, or pull it from the API with the product type set to STOCK_TW:

import requests

url = "https://data.infoway.io/common/basic/symbols"
headers = {"apiKey": "YOUR_API_KEY"}

response = requests.get(url, headers=headers, params={"type": "STOCK_TW"})
symbols = response.json()["data"]

print(f"{len(symbols)} tickers")
print(symbols[:3])

The list is updated regularly as companies list and delist, so it’s a good idea to sync it on a schedule.

4.2 Get Real-Time Trades

Endpoint:

GET https://data.infoway.io/taiwan/batch_trade/{codes}

codes is the ticker. To query several stocks at once, separate them with commas, up to 100 per request.

import requests

url = "https://data.infoway.io/taiwan/batch_trade/2330.TW"
headers = {"apiKey": "YOUR_API_KEY"}

response = requests.get(url, headers=headers)
print(response.json())

Sample response:

{
  "ret": 200,
  "msg": "success",
  "traceId": "5817b491-36aa-4fd6-8725-d6371206e4da",
  "data": [
    {
      "s": "2330.TW",
      "t": 1793847506767,
      "p": "2265.00",
      "v": "1000.00",
      "vw": "2265000.00",
      "td": 0
    }
  ]
}
FieldDescription
sTicker
tTrade time, Unix timestamp in milliseconds
pTrade price
vVolume (shares)
vwTurnover (not the average price)
tdTrade direction: 0 = default, 1 = buy, 2 = sell

4.3 Get Candlestick Data

Endpoint:

POST https://data.infoway.io/taiwan/v2/batch_kline

Taiwan candlesticks are only available through POST, with the parameters in a JSON request body:

ParameterRequiredDescription
klineTypeYesCandle interval (see the table below)
klineNumYesNumber of candles. Up to 500 for a single stock, or 2 per stock when you query several
codesYesTickers as a comma-separated string, up to 100
timestampNoEnd time in seconds. If omitted, you get the latest data
klineTypeIntervalklineTypeInterval
11 minute74 hours
25 minutes8Daily
315 minutes9Weekly
430 minutes10Monthly
51 hour11Quarterly
62 hours12Yearly

Example: get the last 10 daily candles for TSMC.

import requests

url = "https://data.infoway.io/taiwan/v2/batch_kline"
headers = {"apiKey": "YOUR_API_KEY"}
payload = {"klineType": 8, "klineNum": 10, "codes": "2330.TW"}

response = requests.post(url, headers=headers, json=payload)
print(response.json())

Sample response:

{
  "ret": 200,
  "msg": "success",
  "traceId": "414f11b1-6c5f-43bc-a6fe-e3b839018bc0",
  "data": [
    {
      "s": "2330.TW",
      "respList": [
        {
          "t": "1793808000",
          "h": "2285.00",
          "o": "2250.00",
          "l": "2245.00",
          "c": "2265.00",
          "v": "17535000",
          "vw": "39690465000",
          "pc": "0.22%",
          "pca": "5.00"
        }
      ]
    }
  ]
}
FieldDescription
tCandle time, Unix timestamp in seconds (string)
o / h / l / cOpen / high / low / close
vVolume (shares)
vwTurnover
pcPercent change
pcaPrice change

Candles come back newest first. To page further back, take the t of the oldest candle on the current page, subtract 1, and pass it as timestamp in your next request:

import time

import requests

url = "https://data.infoway.io/taiwan/v2/batch_kline"
headers = {"apiKey": "YOUR_API_KEY"}
payload = {"klineType": 8, "klineNum": 500, "codes": "2330.TW"}

first_page = requests.post(url, headers=headers, json=payload).json()
candles = first_page["data"][0]["respList"]

time.sleep(1)  # The free trial allows 1 request per second
payload["timestamp"] = int(candles[-1]["t"]) - 1
second_page = requests.post(url, headers=headers, json=payload).json()
candles += second_page["data"][0]["respList"]

print(f"{len(candles)} candles")

4.4 Get the Order Book (Level 1)

Endpoint:

GET https://data.infoway.io/taiwan/batch_depth/{codes}

import requests

url = "https://data.infoway.io/taiwan/batch_depth/2330.TW"
headers = {"apiKey": "YOUR_API_KEY"}

response = requests.get(url, headers=headers)
depth = response.json()["data"][0]

print(f"Best ask: {depth['a'][0][0]}, size {depth['a'][1][0]}")
print(f"Best bid: {depth['b'][0][0]}, size {depth['b'][1][0]}")

Sample response:

{
  "ret": 200,
  "msg": "success",
  "traceId": "59462e85-1c92-433c-b2de-464d9922a6ef",
  "data": [
    {
      "s": "2330.TW",
      "t": 1793847512608,
      "a": [["2270.00"], ["208000.0"]],
      "b": [["2265.00"], ["169000.0"]]
    }
  ]
}

a is the ask side and b is the bid side. Each side holds two arrays: the first contains prices and the second contains order sizes.

4.5 Stream Real-Time Data over WebSocket

For live charts or trading signals, WebSocket is the better choice. Once you’re connected, the server pushes every update to you, so there’s no need to keep polling.

Taiwan WebSocket URL:

wss://data.infoway.io/ws?business=taiwan&apikey=YOUR_API_KEY

DataSubscribe codeAcknowledgment codePush code
Real-time trades100001000110002
Order book100031000410005
Candlesticks100061000710008

You also need to send a heartbeat (code 10010) every 30 seconds. The example below subscribes to TSMC’s trades, order book, and 1-minute candles, with a heartbeat and automatic reconnection:

import asyncio
import json
import uuid

import websockets

API_KEY = "YOUR_API_KEY"
WS_URL = f"wss://data.infoway.io/ws?business=taiwan&apikey={API_KEY}"
CODES = "2330.TW"


def build_message(code, data=None):
    message = {"code": code, "trace": uuid.uuid4().hex}
    if data is not None:
        message["data"] = data
    return json.dumps(message)


async def subscribe(ws):
    await ws.send(build_message(10000, {"codes": CODES}))
    await ws.send(build_message(10003, {"codes": CODES}))
    await ws.send(build_message(10006, {"arr": [{"type": 1, "codes": CODES}]}))


async def send_heartbeat(ws):
    while True:
        await asyncio.sleep(30)
        await ws.send(build_message(10010))


def handle_message(message):
    code = message.get("code")
    data = message.get("data")

    if code == 10002:
        print(f"Trade {data['s']}: price {data['p']}, volume {data['v']}")
    elif code == 10005:
        print(f"Order book {data['s']}: ask {data['a'][0][0]}, bid {data['b'][0][0]}")
    elif code == 10008:
        print(f"Candle {data['s']}: time {data['t']}, last {data['c']}")
    else:
        print(f"Other message: {message}")


async def main():
    while True:
        try:
            async with websockets.connect(WS_URL) as ws:
                print("Connected")
                await subscribe(ws)
                heartbeat = asyncio.create_task(send_heartbeat(ws))
                try:
                    async for raw in ws:
                        handle_message(json.loads(raw))
                finally:
                    heartbeat.cancel()
        except (OSError, websockets.exceptions.WebSocketException) as error:
            print(f"Connection error: {error}")

        print("Disconnected, reconnecting in 10 seconds")
        await asyncio.sleep(10)


if __name__ == "__main__":
    asyncio.run(main())

You need to resubscribe every time you reconnect, and the example above already does this for you.

4.6 Get Company Profiles, Trading Days, and Financial Statements

These endpoints all start with https://data.infoway.io/common/basic and use GET:

import time

import requests

base_url = "https://data.infoway.io/common/basic"
headers = {"apiKey": "YOUR_API_KEY"}

# Company profile: name, exchange, currency, EPS, sector, and more
info = requests.get(
    f"{base_url}/symbols/info",
    headers=headers,
    params={"type": "STOCK_TW", "symbols": "2330.TW"},
)
print(info.json())
time.sleep(1)  # The free trial allows 1 request per second

# Trading calendar
trading_days = requests.get(
    f"{base_url}/markets/trading_days",
    headers=headers,
    params={"market": "TW", "beginDay": "20260901", "endDay": "20260930"},
)
print(trading_days.json())
time.sleep(1)

# Quarterly income statement
income = requests.get(
    f"{base_url}/financial/income_statement",
    headers=headers,
    params={"symbol": "2330.TW", "type": "STOCK_TW", "period_type": "fq"},
)
print(income.json())

In the company profile response, an exchange value of TWSE means the stock is listed on the Taiwan Stock Exchange, and TPEX means it trades on the Taipei Exchange. For company names, use name_en (English) or name_local (Traditional Chinese). The name_cn field is currently empty for Taiwan stocks.

5. Tips for Developers

  • Candlesticks are POST only: Some markets still have a GET endpoint, but Taiwan only supports POST /taiwan/v2/batch_kline.
  • Use the right business value: Taiwan stocks require business=taiwan. If the business value doesn’t match the ticker, the subscription may report success but you won’t receive any data.
  • Timestamp units differ: For trades and the order book, t is an integer in milliseconds. For candlesticks, t is a string in seconds.
  • The percent change field has different names: It’s pc in HTTP responses and pfr in WebSocket pushes.
  • Update live candles in place: The same candle is pushed many times, and there’s no field that marks it as closed. Use s, ty, and t as a unique key and update the existing record instead of appending a new one each time.
  • msg: ok doesn’t mean data is on the way: A subscription acknowledgment only confirms that your request was received. It’s normal to get no pushes outside trading hours.
  • Watch your WebSocket request rate: Each connection can send up to 60 subscribe, unsubscribe, and heartbeat messages per minute. Go over that and the connection will be closed.

6. FAQ

6.1 Can I get Taiwan stock data on the free trial?

Yes. Every new account gets a 7-day free trial, no credit card required. During the trial, you can query 2330.TW (TSMC) for Taiwan, and the data is real-time. Requests for tickers outside the trial will return a permission error.

6.2 How do the plans differ?

PlanHTTP rate limitWebSocket subscriptionsWebSocket connections
Free trial1 request/sec101
Basic2 requests/sec2001
Advanced10 requests/sec8002
Pro20 requests/sec5,0009
Stock market plan20 requests/secAll stocks in the selected marketAssigned automatically

See the pricing page for prices and historical data coverage. All plans are priced and paid in USDT.

6.3 Are TPEx stocks supported?

Yes. TWSE and TPEx stocks use the same endpoints and the same .TW suffix. For example, GlobalWafers, which trades on TPEx, is 6488.TW.

6.4 Do you support Taiwan ETFs?

Not at the moment. The current ticker list mainly covers TWSE and TPEx stocks, plus a small number of REITs (such as 01001T.TW). ETFs like 0050.TW aren’t included. Check the latest ticker list for exact coverage.

6.5 How many order book levels are available?

Taiwan stocks currently come with level 1 data, meaning the best bid and best ask with their sizes.

6.6 Are newly listed stocks included?

Yes. The ticker list is updated regularly to add new listings and remove delisted stocks.

6.7 Where can I get more help?

For full endpoint details, see the Infoway API documentation. You can also reach our support team on Telegram.

7. More Markets Support by Infoway APi