In addition to regular stock IDs (4 digits), taiwan_stock_tick_snapshot also supports 91 index codes (3 digits) covering the broad market, sector indices, themed indices and leverage / inverse indices.
For example, data_id="001" is the TAIEX (weighted index), and data_id="101" is the OTC weighted index.
The tables below list all codes, grouped by purpose. Names are kept in the original Chinese as published by TWSE / TPEx (the official Taiwanese exchanges).
fromFinMind.dataimportDataLoaderapi=DataLoader()# api.login_by_token(api_token='token')df=api.taiwan_stock_tick_snapshot(stock_id="001")# TAIEX# Fetch multiple at once (stocks and indices can be mixed)df=api.taiwan_stock_tick_snapshot(stock_id=["001","101","2330"])# Fetch all snapshots in one call (only until 2027-01-31; per TWSE regulations, max 50 per request from 2027-02-01, so pass stock_id in batches)df=api.taiwan_stock_tick_snapshot()
importrequestsimportpandasaspdtoken=""# See login section to obtain a tokenheaders={"Authorization":f"Bearer {token}"}url="https://api.finmindtrade.com/api/v4/taiwan_stock_tick_snapshot"parameter={"data_id":"001",# TAIEX# "data_id": ["001", "101"], # TAIEX + OTC weighted, fetch multiple at once}resp=requests.get(url,headers=headers,params=parameter)data=pd.DataFrame(resp.json()["data"])print(data)