AI agent?先讀 /llms.txt 取得全站索引。
市場與價格
個股市值權重
個股市值權重
衍生來源: TWSE·方案: pro·計費: 2 點·
GET /v2/datasets/market-value-weight個股市值權重是台灣市場資料集,來源為 TWSE,由 TW Market Data 以 GET /v2/datasets/market-value-weight 提供。
總覽
個股市值權重——每列粒度:ticker / as_of_date。
| 欄位 | 型別 | 說明 |
|---|---|---|
as_of_date | string | 資料日期 |
ticker | string | 股票代號 |
market | string | 市場別 |
weight_pct | number | 佔大盤市值權重(%) |
範例回應
此為本端點的真實回應。資料列位於 "data" 之下,來源資訊如下方所示;各資料集形狀不盡相同,請以本頁為準。
{ "dataset_id": "market_value_weight", "request_context": { "scope": "twse_market_cap_weight_only", "coverage_type": "derived_from_valuation_market_cap", "filters": { "as_of_date": null, "date_from": null, "date_to": null, "ticker": "1231", "market": null, "source_family": null, "limit": 50 }, "min_as_of_date": "2026-05-20", "max_as_of_date": "2026-07-31" }, "quality": { "row_count": 50, "ticker_count": 1, "sensitive_fields_exposed": false }, "lineage": { "source_families": [ "derived_valuation_market_cap_weight" ], "method": "100*market_cap/sum(market_cap) over (as_of_date, market); TWSE only" }, "error": null, "data": [ { "as_of_date": "2026-07-31", "ticker": "1231", "market": "TWSE", "weight_pct": 0.01717869, "source_family": "derived_valuation_market_cap_weight", "lineage": { "method": "100*market_cap/sum(market_cap) over (as_of_date,market)", "source_table": "valuation_data_items", "source_field": "market_cap", "market_scope": "TWSE_only", "tpex_status": "source_gap_no_market_cap", "constituents_in_denominator": 1080 } }, { "as_of_date": "2026-07-30", "ticker": "1231", "market": "TWSE", "weight_pct": 0.01865348, "source_family": "derived_valuation_market_cap_weight", "lineage": { "method": "100*market_cap/sum(market_cap) over (as_of_date,market)", "source_table": "valuation_data_items", "source_field": "market_cap", "market_scope": "TWSE_only", "tpex_status": "source_gap_no_market_cap", "constituents_in_denominator": 1080 } } ], "data_count": 50, "known_gaps": [ "twse_only", "tpex_pending_no_market_cap_source", "weight_relative_to_covered_valuation_universe" ], "warnings": [ "not_investment_advice" ], "envelope": { "dataset_id": "market_value_weight", "scope": "twse_market_cap_weight_only", "row_count": 50 }}擷取自 2026-07-20 的線上 API。
出處
以下欄位會隨資料一併回傳,記錄這一列的來源。它們屬於出處而非本資料集要講的事實,因此列在這裡而不進欄位表。
source_familylineage相關資料集
可與本資料集對齊的其他資料集。每組都標出可用來 join 的欄位,規劃跨表查詢時不必自己猜。
- 技術指標
可用 as_of_date + market + ticker 對齊
- 估值資料
可用 as_of_date + market + ticker 對齊
- GHG 碳揭露(範疇1/2/3)
可用 as_of_date + market + ticker 對齊
- 三大法人買賣
可用 as_of_date + market + ticker 對齊
- 融資融券
可用 as_of_date + market + ticker 對齊
快速開始
- 把你的金鑰放進 X-API-Key 標頭。
- 加上查詢參數(symbol、日期區間、limit)。
- 送出請求並讀取 data 陣列。
curl "https://api.twmarketdata.com/v2/datasets/market-value-weight?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 | 回傳筆數上限。 |
Python 範例
第一個呼叫:
import requests resp = requests.get( "https://api.twmarketdata.com/v2/datasets/market-value-weight", params={"symbol": "2330"}, headers={"X-API-Key": "sk_live_..."},)resp.raise_for_status()print(resp.json()["data"])帶日期區間篩選:
import requests # The full verified example — the same call with every supported filter set.resp = requests.get( "https://api.twmarketdata.com/v2/datasets/market-value-weight", params={"symbol": "2330"}, headers={"X-API-Key": "sk_live_..."},)resp.raise_for_status()for row in resp.json()["data"]: print(row)OpenAPI
此端點為 GET /v2/datasets/market-value-weight。完整機器可讀 schema(參數、認證、回應封裝)見 OpenAPI spec。