Skip to content

GET /api/v1/index/price

Index price and daily return history.

Returns historical price and daily return data for market indices.

Request

GET /api/v1/index/price

Headers

HeaderValue
F-API-KEYYour API key

Query Parameters

ParameterTypeRequiredFilterDescription
index_codestringNoexactIndex code
trade_datestringNoexactTrade date (YYYY-MM-DD)
sourcestringNoexactData source
date_fromstringNorangeStart date
date_tostringNorangeEnd date
limitintegerNoMax rows per page (default 100, max 1000)
offsetintegerNoRows to skip (default 0)
sortstringNoSort field (default trade_date)
orderasc | descNoSort direction (default desc)

Example

Terminal window
curl -H "F-API-KEY: fk-xxxxx" \
"https://finance-api.xp-java.workers.dev/api/v1/index/price?index_code=000001&date_from=2024-01-01&date_to=2024-01-31"

Response

{
"code": 0,
"message": "ok",
"data": [
{
"index_code": "000001",
"trade_date": "2024-01-02",
"close": 2962.28,
"daily_return_pct": 0.15,
"source": "exchange",
"updated_at": "2024-01-02T15:30:00Z"
}
],
"meta": {
"total": 22,
"limit": 100,
"offset": 0,
"has_more": false
}
}