Latest K-line Data
curl --request GET \
--url https://api.tickdb.ai/v1/market/kline/latest \
--header 'X-API-Key: <api-key>'import requests
url = "https://api.tickdb.ai/v1/market/kline/latest"
headers = {"X-API-Key": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'X-API-Key': '<api-key>'}};
fetch('https://api.tickdb.ai/v1/market/kline/latest', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.tickdb.ai/v1/market/kline/latest",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"X-API-Key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.tickdb.ai/v1/market/kline/latest"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("X-API-Key", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.tickdb.ai/v1/market/kline/latest")
.header("X-API-Key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.tickdb.ai/v1/market/kline/latest")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["X-API-Key"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"code": 0,
"message": "success",
"data": [
{
"symbol": "AAPL.US",
"interval": "3m",
"klines": [
{
"time": 1773259020000,
"open": "260.86",
"high": "261.05",
"low": "260.7",
"close": "260.81",
"volume": "963419",
"quote_volume": "251311057.55"
}
]
},
{
"symbol": "00700.HK",
"interval": "3m",
"klines": [
{
"time": 1773293400000,
"open": "542.5",
"high": "544.5",
"low": "542",
"close": "544.5",
"volume": "80300",
"quote_volume": "43656433.33"
}
]
}
]
}{
"code": 400,
"message": "Invalid parameters"
}{
"code": 401,
"message": "Unauthorized"
}Market Data APIs
Real-time K-Line
Get real-time K-line data for the current time period that is being formed and updated.
GET
/
v1
/
market
/
kline
/
latest
Latest K-line Data
curl --request GET \
--url https://api.tickdb.ai/v1/market/kline/latest \
--header 'X-API-Key: <api-key>'import requests
url = "https://api.tickdb.ai/v1/market/kline/latest"
headers = {"X-API-Key": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'X-API-Key': '<api-key>'}};
fetch('https://api.tickdb.ai/v1/market/kline/latest', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.tickdb.ai/v1/market/kline/latest",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"X-API-Key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.tickdb.ai/v1/market/kline/latest"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("X-API-Key", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.tickdb.ai/v1/market/kline/latest")
.header("X-API-Key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.tickdb.ai/v1/market/kline/latest")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["X-API-Key"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"code": 0,
"message": "success",
"data": [
{
"symbol": "AAPL.US",
"interval": "3m",
"klines": [
{
"time": 1773259020000,
"open": "260.86",
"high": "261.05",
"low": "260.7",
"close": "260.81",
"volume": "963419",
"quote_volume": "251311057.55"
}
]
},
{
"symbol": "00700.HK",
"interval": "3m",
"klines": [
{
"time": 1773293400000,
"open": "542.5",
"high": "544.5",
"low": "542",
"close": "544.5",
"volume": "80300",
"quote_volume": "43656433.33"
}
]
}
]
}{
"code": 400,
"message": "Invalid parameters"
}{
"code": 401,
"message": "Unauthorized"
}Notes
- This endpoint returns K-line data for the current period being formed, data updates continuously with trades
- Suitable for real-time chart display, current price monitoring, and intraday dynamic updates
- Not recommended for historical backtesting, technical indicator statistics, or fixed data storage
- For completed period data, use Historical K-Line:
/v1/market/kline
Supported Markets
Forex, Metals, Indices, US Stocks, HK Stocks, A-Shares, China Futures, Crypto Examples:- Forex: EURUSD, GBPUSD, USDJPY
- Metals: XAUUSD, XAGUSD
- Indices: SPX, NDX, DJI
- US Stocks: AAPL.US, TSLA.US, MSFT.US
- HK Stocks: 700.HK, 9988.HK, 3690.HK
- A-Shares: 600519.SH, 000001.SZ, 920186.BJ
- China Futures: BU2609, IC2606, AP8888
- Crypto: BTCUSDT, ETHUSDT, ADAUSDT
Request Parameters
| Parameter | Required | Description |
|---|---|---|
| symbols | Yes | Trading symbol codes, comma-separated, e.g., AAPL.US,00700.HK |
| interval | Yes | K-line period, options: 1m, 3m, 5m, 15m, 30m, 1h, 2h, 4h, 1d, 1w, 1M |
| type | No | Symbol type, optional. Not required when the symbol is unambiguous; if the API returns an AMBIGUOUS_SYMBOL error, pass the value as indicated. Values: stock, indices, crypto, forex, futures |
Response Fields
| Field | Description |
|---|---|
| symbol | Trading Symbol |
| type | Product type |
| interval | K-line period |
| klines | K-line data array |
| └─ time | K-line timestamp (milliseconds) |
| └─ open | Opening price |
| └─ high | Highest price |
| └─ low | Lowest price |
| └─ close | Closing price |
| └─ volume | Trading volume |
| └─ quote_volume | Trading amount; normally omitted for futures |
| └─ open_interest | Open interest; returned for futures |
Authorizations
Query Parameters
Comma-separated symbols (e.g., AAPL.US,00700.HK)
Example:
"AAPL.US,00700.HK"
K-line interval
Available options:
1m, 3m, 5m, 15m, 30m, 1h, 2h, 4h, 1d, 1w, 1M Example:
"3m"
Symbol type, optional. Not required when the symbol is unambiguous; if the API returns an AMBIGUOUS_SYMBOL error, pass the value as indicated
Available options:
stock, indices, crypto, forex, futures Example:
"stock"
Response
Successful response
Example:
0
Example:
"success"
Show child attributes
Show child attributes
Example:
[
{
"symbol": "AAPL.US",
"interval": "3m",
"klines": [
{
"time": 1773259020000,
"open": "260.86",
"high": "261.05",
"low": "260.7",
"close": "260.81",
"volume": "963419",
"quote_volume": "251311057.55"
}
]
},
{
"symbol": "00700.HK",
"interval": "3m",
"klines": [
{
"time": 1773293400000,
"open": "542.5",
"high": "544.5",
"low": "542",
"close": "544.5",
"volume": "80300",
"quote_volume": "43656433.33"
}
]
}
]
