AI agent?先讀 /llms.txt 取得全站索引。
市場與價格
指數成分股——每個指數的成分證券及其權重,由官方指數與市場資料解析而得。
GET /v2/datasets/index-constituentsindex-constituents 針對某指數的每檔成分證券回傳一列,含其權重。此為推導面:成分來自官方指數定義,權重由官方市場資料計算,成分清單可重現而非黑箱。每列附回溯上述輸入的 lineage。
| 欄位 | 型別 | 說明 |
|---|---|---|
index_code | string | 成分股所屬指數代碼。 |
symbol | string | 成分股股票代碼。 |
weight_pct | number | 成分股於指數中的權重(百分比,推導)。 |
as_of | string | 成分解析所依據的資料日期。 |
source_role | string | 正規來源角色(derived_index_constituents)。 |
| 列數 | 546 |
| 涵蓋起訖 | 2026-07-01(單日快照) |
| 分級 | 衍生 |
TODO —— 尚未擷取到此資料集的真實回應(需要有權限的 API 金鑰,或其必填參數尚未確認)。寧可留白,也不顯示未經實測的範例。
curl "https://api.twmarketdata.com/v2/datasets/index-constituents?symbol=2330" \ -H "X-API-Key: sk_live_..."| 參數 | 必填 | 型別 | 說明 |
|---|---|---|---|
symbol | 是 | string | 股票代碼,例如 2330。 |
start_date | 否 | string (YYYY-MM-DD) | 查詢起始日期。 |
end_date | 否 | string (YYYY-MM-DD) | 查詢結束日期。 |
limit | 否 | integer | 回傳筆數上限。 |
第一個呼叫:
import requests resp = requests.get( "https://api.twmarketdata.com/v2/datasets/index-constituents", params={"symbol": "2330"}, headers={"X-API-Key": "sk_live_..."},)resp.raise_for_status()print(resp.json())帶日期區間篩選:
import requests # The full verified example — the same call with every supported filter set.resp = requests.get( "https://api.twmarketdata.com/v2/datasets/index-constituents", params={"symbol": "2330"}, headers={"X-API-Key": "sk_live_..."},)resp.raise_for_status()print(resp.json())此端點為 GET /v2/datasets/index-constituents。完整機器可讀 schema(參數、認證、回應封裝)見 OpenAPI spec。