Returns historical kline (OHLCV) data for ETFs.
Request
GET /api/v1/etf/klineHeaders
| Header | Value |
|---|---|
F-API-KEY | Your API key |
Query Parameters
| Parameter | Type | Required | Filter | Description |
|---|---|---|---|---|
code | string | No | exact | Fund code |
date | string | No | exact | Trade date (YYYY-MM-DD) |
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 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/etf/kline?code=510300&date_from=2024-01-01&date_to=2024-01-31"Response
{ "code": 0, "message": "ok", "data": [ { "code": "510300", "date": "2024-01-02", "open": 3.452, "close": 3.481, "high": 3.495, "low": 3.445, "volume": 12500000, "amount": 43500000, "change_pct": 0.85, "source": "exchange", "updated_at": "2024-01-02T15:30:00Z" } ], "meta": { "total": 22, "limit": 100, "offset": 0, "has_more": false }}