Docs/Market Data·API
Klines
Return historical klines for one compact ticker.
- Method
- GET
- Path
- /api/v1/market/klines
- Auth
- Bearer token
Overview
Queries historical klines for a single ticker, timeframe, and time range. Public docs use kline naming; bar is not a public payload type.
Common use cases
- - Load initial chart candles
- - Backfill a short time window
- - Combine with WebSocket kline updates
Request URL
Send the request to the base API URL with your product API key in the Authorization bearer header.
GET/api/v1/market/klines?ticker=EURUSD&timeframe=M1&from=1777100000&to=1777103600&limit=500
HTTP requestGET https://api.tickquote.com/api/v1/market/klines?ticker=EURUSD&timeframe=M1&from=1777100000&to=1777103600&limit=500
Authorization: Bearer <tkp_api_key>Parameter
Description
ticker
Required. Single compact ticker, for example EURUSD.
timeframe
Required. Supported values: M1, M5, M15, M30, H1, H4, D1, W1, MN1.
from
Recommended. Start time in Unix seconds.
to
Recommended. End time in Unix seconds.
limit
Optional. Row limit; the example uses 500.
Try It Out
Edit query parameters and send a demo or authenticated request from this endpoint page.
GET/api/v1/market/klines
Live sandboxUse demo_key to try it without an account.
Response
// Response will appear here after sending a request
Response
A successful REST response uses code 0 and message success. Always check code before reading data.
response.json
Sample payload{
"code": 0,
"message": "success",
"data": {
"ticker": "EURUSD",
"timeframe": "M1",
"from": 1777100000,
"to": 1777103600,
"count": 1,
"limit": 500,
"items": [
{
"type": "kline",
"ticker": "EURUSD",
"timeframe": "M1",
"time": 1777100000,
"open": 1.102,
"high": 1.103,
"low": 1.101,
"close": 1.1025,
"tick_volume": 120,
"real_volume": 0,
"spread": 20
}
]
}
}Examples
The examples below use compact tickers and the Authorization bearer header.
curl
cURLcurl "https://api.tickquote.com/api/v1/market/klines?ticker=EURUSD&timeframe=M1&from=1777100000&to=1777103600&limit=500" \
-H "Authorization: Bearer $TICKQUOTE_API_KEY"request.js
JavaScriptconst response = await fetch("https://api.tickquote.com/api/v1/market/klines?ticker=EURUSD&timeframe=M1&from=1777100000&to=1777103600&limit=500", {
headers: {
Authorization: `Bearer ${process.env.TICKQUOTE_API_KEY}`,
},
})
const payload = await response.json()
if (payload.code !== 0) {
throw new Error(payload.message)
}
console.log(payload.data)Field reference
Field
Sample
Description
type
kline
Always kline.
ticker
EURUSD
Compact ticker for this kline.
timeframe
M1
Kline timeframe.
time
1777100000
Kline open time in Unix seconds.
open
1.102
Open price.
high
1.103
High price.
low
1.101
Low price.
close
1.1025
Close price, or current value for an open candle.
tick_volume
120
Tick-count style value, not a real traded-volume commitment.
real_volume
0
May be 0 or null.
spread
20
Spread value for the kline.
Important notes
- - from and to use Unix seconds.
- - real_volume may be 0 or null and is not a real exchange volume commitment.
- - tick_volume is a tick-count style field, not true traded volume.