TW Market Data LogoTW Market Data

核心資料

市場與價格

TWSE / TPEx 日線、還原價格、指數與市場廣度

財務與成長

月營收、財報三表、財務指標與估值資料

籌碼與資金

三大法人與融資融券資料

公司與結構

公司與事件

公司基本資料、公告、事件、公司行動與股利

分類與結構

主題分類、指數分類與跨資料集 mapping

策略與量化

Features、Factor Data、Time Alignment 與 Screener

平台能力

API 存取

REST API、認證與第一個 request

查詢與工具

Search API、Query API、欄位清單與查詢範例

Tools / MCP

Agent workflow、MCP tools 與 OpenAPI 入口

方案價格文件觀點文章
隱私政策|服務條款|聯絡我們|TW Market Data © 2026

文件總覽

Overview

總覽快速開始認證來源政策資料血緣API 模型Tools / MCPSupport

APIs

主題分類指數分類

Guides

查看公司基本面看籌碼看市場狀態快速查資料做策略 / AI

分類與結構

指數分類

提供 deterministic 指數分類欄位,適合市場結構分析與指數維度整理。

GET/v2/datasets/index-classification

Overview#

指數分類 API 提供指數層級的分類事實欄位(type/sector/industry/theme flags),適合做市場分類視角分析與索引維度整理。

此 endpoint 對應 `index_classification` live route,不是 AI 分群或動態評分模型。

  • 查單一指數(index_code)分類屬性與旗標欄位。
  • 建立市場分類清單,作為 dashboard 或研究分群維度。
  • 搭配 index-data / market-breadth 進行市場結構與盤勢分析。

Request#

至少需要提供一個 filter(index_code、market、index_type、sector、industry 任一),未提供時會回傳 `missing_required_filter`。

Query Parameters#

欄位型別Required說明
index_codestringno指數代碼。
marketstringno市場代碼。
index_typestringno指數類型(如 broad_market / sector)。
sectorstringno產業分類條件。
industrystringno產業細分類條件。
limitintegerno回傳筆數限制(1..1000)。
offsetintegerno分頁偏移。
sort_bystringno排序欄位:as_of_date 或 index_code。
sort_orderstringno排序方向:asc 或 desc。

Response Shape#

回應採 canonical envelope,頂層包含 query/meta,實際分類資料位於 envelope.data。

contract 僅包含 deterministic 分類欄位,不包含信心分數與動態 ranking。

{
  "api_version": "v2",
  "endpoint": "/v2/datasets/index-classification",
  "request_id": "req_idxcls_9f8e7d6c",
  "plan_id": "developer",
  "dataset": "index_classification",
  "query": {
    "index_code": "TWSE_TAIEX",
    "market": null,
    "index_type": null,
    "sector": null,
    "industry": null,
    "limit": 20,
    "offset": 0,
    "sort_by": "as_of_date",
    "sort_order": "desc"
  },
  "meta": {
    "rows_returned": 1
  },
  "envelope": {
    "dataset": "index_classification",
    "ticker": "TWSE_TAIEX",
    "as_of_date": "2026-04-22",
    "data": [
      {
        "index_code": "TWSE_TAIEX",
        "market": "TWSE",
        "as_of_date": "2026-04-22",
        "classification_version": "v1",
        "index_name": "發行量加權股價指數",
        "index_type": "broad_market",
        "sector": null,
        "industry": null,
        "parent_index_code": null,
        "is_sector_index": false,
        "is_broad_market_index": true,
        "theme_primary": null,
        "theme_secondary": null,
        "classification_source": "index_code_mapping_v1",
        "provider": "twse_official",
        "source_role": "canonical"
      }
    ]
  }
}

Field 說明#

欄位路徑型別說明
datasetstring固定為 index_classification。
meta.rows_returnedinteger回傳筆數。
envelope.data[].index_codestring指數代碼。
envelope.data[].marketstring市場代碼。
envelope.data[].as_of_datestring資料日期。
envelope.data[].index_namestring|null指數名稱。
envelope.data[].index_typestring|null指數類型。
envelope.data[].is_broad_market_indexboolean|null是否為大盤型指數。
envelope.data[].is_sector_indexboolean|null是否為產業型指數。
envelope.data[].theme_primarystring|null主題主分類。
envelope.data[].classification_sourcestring|null分類映射來源。
envelope.data[].source_rolestring|null來源角色。

Usage Notes / 使用建議#

  • 此主題對外路由為 `/v2/datasets/index-classification`。
  • 若需要指數點位與漲跌等行情欄位,請搭配 `/v2/datasets/index-data`。
  • 查無資料通常回 200 空集合,建議依 `meta.rows_returned` 判斷結果。

Plan Requirement#

  • Route:/v2/datasets/index-classification
  • 實際可用範圍與配額以控制台方案顯示為準

請求與回應

請求範例

curl --request GET \
  --url "https://api.twmarketdata.com/v2/datasets/index-classification?index_code=TWSE_TAIEX&limit=20" \
  --header "X-API-Key: your_api_key_here"

狀態碼

成功回傳指數分類資料

JSON
{
  "api_version": "v2",
  "endpoint": "/v2/datasets/index-classification",
  "request_id": "req_idxcls_9f8e7d6c",
  "plan_id": "developer",
  "dataset": "index_classification",
  "query": {
    "index_code": "TWSE_TAIEX",
    "market": null,
    "index_type": null,
    "sector": null,
    "industry": null,
    "limit": 20,
    "offset": 0,
    "sort_by": "as_of_date",
    "sort_order": "desc"
  },
  "meta": {
    "rows_returned": 1
  },
  "envelope": {
    "dataset": "index_classification",
    "ticker": "TWSE_TAIEX",
    "as_of_date": "2026-04-22",
    "data": [
      {
        "index_code": "TWSE_TAIEX",
        "market": "TWSE",
        "as_of_date": "2026-04-22",
        "classification_version": "v1",
        "index_name": "發行量加權股價指數",
        "index_type": "broad_market",
        "sector": null,
        "industry": null,
        "parent_index_code": null,
        "is_sector_index": false,
        "is_broad_market_index": true,
        "theme_primary": null,
        "theme_secondary": null,
        "classification_source": "index_code_mapping_v1",
        "provider": "twse_official",
        "source_role": "canonical"
      }
    ]
  }
}