Cookie settings
We use essential cookies to keep you signed in and secure, and analytics cookies to improve the product. We never use them for ad tracking.Learn more
Building an AI agent? Start with /llms.txt for the full site index.
Overview
三步驟,五分鐘拿到第一筆台股資料。
These 5 symbols work without a key: 2330 TSMC / 2317 Hon Hai / 2454 MediaTek / 0050 / 2603. Paste this to your AI or run curl directly:
curl "https://api.twmarketdata.com/v2/datasets/twse-daily-price?symbol=2330&limit=1"(Other stocks / other datasets need the API key below.)
Register in the dashboard and create an API key there. Put the key in the request header, not in the URL.
Every data endpoint is GET /v2/datasets/{資料集}, with the key passed in the X-API-Key header.
curl "https://api.twmarketdata.com/v2/datasets/twse-daily-price?symbol=2330&limit=10" \ -H "X-API-Key: $TWMD_API_KEY"import requests r = requests.get( "https://api.twmarketdata.com/v2/datasets/twse-daily-price", params={"symbol": "2330", "limit": 10}, headers={"X-API-Key": TWMD_API_KEY},)data = r.json()You get typed JSON, each record carrying its source; missing data is left empty rather than filled in. Field definitions are on each dataset page.
Next → Authentication