Returns real-time spot data for A-Share stocks including price, change, volume, and valuation metrics.
Request
GET /api/v1/stock/spotHeaders
| Header | Value |
|---|---|
F-API-KEY | Your API key |
Query Parameters
| Parameter | Type | Required | Filter | Description |
|---|---|---|---|---|
code | string | No | exact | Stock code |
industry | string | No | exact | Industry name |
source | string | No | exact | Data source |
name | string | No | like | Stock name (fuzzy match) |
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 code) |
order | asc | desc | No | — | Sort direction (default asc) |
Example
curl -H "F-API-KEY: fk-xxxxx" \ "https://finance-api.xp-java.workers.dev/api/v1/stock/spot?industry=半导体&limit=10"Response
{ "code": 0, "message": "ok", "data": [ { "code": "688981", "name": "中芯国际", "latest_price": 58.35, "change_pct": 2.15, "change_amount": 1.23, "volume": 125000000, "amount": 7290000000, "amplitude": 3.82, "high": 59.10, "low": 56.88, "open": 57.20, "pre_close": 57.12, "volume_ratio": 1.45, "turnover": 3.2, "pe_ttm": 85.4, "pb": 3.12, "market_cap": 465000000000, "industry": "半导体", "source": "eastmoney", "updated_at": "2024-12-31T15:00:00Z" } ], "meta": { "total": 156, "limit": 10, "offset": 0, "has_more": true }}