Returns constituent stocks and their weights for a given market index.
Request
GET /api/v1/index/constituentsHeaders
| Header | Value |
|---|---|
F-API-KEY | Your API key |
Query Parameters
| Parameter | Type | Required | Filter | Description |
|---|---|---|---|---|
index_code | string | No | exact | Index code |
stock_code | string | No | exact | Constituent stock code |
source | string | No | exact | Data source |
date_from | string | No | range | Start date |
date_to | string | No | range | End date |
limit | integer | No | — | Max rows per page (default 100, max 1000) |
offset | integer | No | — | Rows to skip (default 0) |
sort | string | No | — | Sort field (default update_date) |
order | asc | desc | No | — | Sort direction (default desc) |
Example
curl -H "F-API-KEY: fk-xxxxx" \ "https://finance-api.xp-java.workers.dev/api/v1/index/constituents?index_code=000001"Response
{ "code": 0, "message": "ok", "data": [ { "index_code": "000001", "stock_code": "600519", "stock_name": "贵州茅台", "weight": 5.82, "update_date": "2024-12-31", "source": "exchange", "updated_at": "2024-12-31T15:30:00Z" } ], "meta": { "total": 50, "limit": 100, "offset": 0, "has_more": false }}