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.
Docs
提供接近即時的價格快照,用於監控與即時策略流程。
股價資料
/v2/datasets/price-enhanced/realtime提供接近即時的價格快照,用於監控與即時策略流程。
此 endpoint 提供穩定的契約格式,可直接整合至資料管線、回測系統與自動化流程。
| Instruments | Start year | Update timing | Includes delisted |
|---|---|---|---|
| Not yet available (coming) | Not yet available (coming) | Not yet available (coming) | coming |
Figures are measured from the DB; unlisted fields defer to docs coverage (coming) — we don't fabricate cell by cell.
此 endpoint 常見使用情境:
建議接入步驟:
curl -X GET "https://api.twmarketdata.com/v2/datasets/price-enhanced/realtime?symbol=2330&limit=10" \ -H "X-API-Key: your_api_key_here"| 欄位 | 型別 | Required | 說明 |
|---|---|---|---|
| symbol | string | yes | 股票代碼,例如 2330。 |
| date | string | no | 指定日期(YYYY-MM-DD)。 |
| start_date | string | no | 查詢區間起始日期。 |
| end_date | string | no | 查詢區間結束日期。 |
| limit | integer | no | 回傳筆數上限。 |
| offset | integer | no | 分頁偏移量。 |
回應採統一 envelope,固定包含 dataset、source_role、freshness、lineage、data。
data 欄位會依 endpoint 性質回傳陣列或單一物件,但欄位命名與型別維持穩定。
{ "dataset": "realtime_prices", "source_role": "canonical", "freshness": "2026-04-21T10:30:00+08:00", "lineage": { "source": "TWSE/TPEx", "ingested_at": "2026-04-21T10:30:02+08:00", "trace_id": "realtime_prices_2330_20260421" }, "data": { "ticker": "2330", "as_of": "2026-04-21T10:25:00+08:00", "last": 813, "bid": 812, "ask": 813, "volume": 10982340 }}| 欄位路徑 | 型別 | 說明 |
|---|---|---|
| dataset | string | 資料集識別名稱。 |
| source_role | string | 來源角色(canonical / fallback / helper)。 |
| freshness | string | 資料時效與更新節點。 |
| lineage.trace_id | string | 追蹤識別,用於審計與排查。 |
| data | array | object | 實際資料內容。 |
| data[].ticker | string | 股票代碼。 |
| data[].date | string | 交易日期。 |
| data[].close | number | 收盤價。 |
| data[].volume | integer | 成交量。 |
此 API 屬於 TW Market Data 資料集目錄。 查看資料集總覽