📊 Forex K-line Data API
Get forex 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/fx/kline |
| Request Method | GET |
| Data Format | JSON |
📋 Request Parameters
Required Parameters ✅
| Parameter | Type | Description | Example |
|---|---|---|---|
ticker | string | Forex pair symbol | GBP/USD, EUR/USD, AUD/USD |
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 |
|---|---|---|---|
ticker | string | Forex pair symbol | GBP/USD |
time | string | K-line timestamp | 2025-07-21 23:59:00 |
open | number | Opening price | 1.34886 |
high | number | Highest price | 1.34892 |
low | number | Lowest price | 1.34882 |
close | number | Closing price | 1.34887 |
volume | number | Trading volume | 320.3 |
quoteVolume | number | Trading amount | 432.042645 |
quote | number | Quote quantity | 0 |
version | number | Data version number | 1753142401257 |
📈 Response Example
Success Response
{
"code": 200,
"status": "success",
"message": "ok",
"data": [
{
"ticker": "GBP/USD",
"time": "2025-07-21 23:59:00",
"open": 1.34886,
"high": 1.34892,
"low": 1.34882,
"close": 1.34887,
"volume": 320.3,
"quoteVolume": 432.042645,
"quote": 0,
"version": 1753142401257
}
]
}🚀 Quick Start
Request Example
curl -X GET "https://api.dataapi.io/v1/fx/kline?ticker=GBP/USD&klineType=1d&token=your_token&limit=10"