📊 Index K-line Data API
Get index K-line/candlestick data, including OHLCV data such as open price, high price, low price, close price, and volume
🔗 API Information
| Item | Value |
|---|---|
| API Endpoint | https://api.dataapi.io/v1/indices/kline |
| Request Method | GET |
| Data Format | JSON |
📋 Request Parameters
Required Parameters ✅
| Parameter | Type | Description | Example |
|---|---|---|---|
ticker | string | Index symbol | SPX, DJI, IXIC |
klineType | string | K-line type | 1m, 5m, 1h, 1d, 1w, 1M |
token | string | API access token | your_api_token |
Optional Parameters ⚪
| Parameter | Type | Default | Description | Example |
|---|---|---|---|---|
startTime | string | Last 7 days | Start time, auto-calculated if not provided | 2024-01-01 or 2024-01-01 09:30:00 |
endTime | string | Current time | End time, uses current time if not provided | 2024-01-31 or 2024-01-31 16:00:00 |
limit | number | 50 | Return quantity limit, default 50 records | 50 (maximum 1000) |
📊 Response Parameters
Response Structure
| Field | Type | Description |
|---|---|---|
code | number | Response status code |
status | string | Response status |
message | string | Response message |
data | array | K-line data array |
Data Fields
| Field | Type | Description | Example |
|---|---|---|---|
time | string | K-line timestamp | 2025-07-25 20:02:00 |
ticker | string | Index symbol | SPX |
open | number | Opening price | 6388.65 |
close | number | Closing price | 6388.65 |
high | number | Highest price | 6388.65 |
low | number | Lowest price | 6388.65 |
volume | number | Trading volume | 8000000 |
quoteVolume | number | Trading amount | 51109200000 |
quote | number | Quote quantity | 0 |
version | number | Data version number | 1753620540705 |
📈 Response Example
Success Response
{
"code": 200,
"status": "success",
"message": "ok",
"data": [
{
"time": "2025-07-25 20:02:00",
"ticker": "SPX",
"open": 6388.65,
"close": 6388.65,
"high": 6388.65,
"low": 6388.65,
"volume": 8000000,
"quoteVolume": 51109200000,
"quote": 0,
"version": 1753620540705
}
]
}🚀 Quick Start
Request Example
curl -X GET "https://api.dataapi.io/v1/indices/kline?ticker=SPX&klineType=1d&token=your_token&limit=10"