Skip to main content
GET
/
v1
/
market
/
kline
K-line (Candlestick) Data
curl --request GET \
  --url https://api.tickdb.ai/v1/market/kline \
  --header 'X-API-Key: <api-key>'
{
  "code": 0,
  "message": "success",
  "data": [
    {
      "timestamp": 1703123456789,
      "open": "43000.00",
      "high": "43250.50",
      "low": "42800.00",
      "close": "43100.00",
      "volume": "1250.5"
    }
  ]
}

K-line (Candlestick) Data

GET /v1/market/kline

Overview

Retrieve historical candlestick (K-line) data for a trading symbol.

Multi-Market Examples

Crypto: BTCUSDT, ETHUSDT, ADAUSDT
US Stocks: AAPL.US, TSLA.US, MSFT.US
HK Stocks: 700.HK, 9988.HK, 3690.HK
Forex: EURUSD, GBPUSD, USDJPY
Metals: XAUUSD, XAGUSD

Supported Intervals

  • Minutes: 1m, 5m, 15m, 30m
  • Hours: 1h, 4h, 12h
  • Days: 1d, 1w, 1M

Example Request

curl -H "X-API-Key: YOUR_API_KEY" \
     "https://api.tickdb.ai/v1/market/kline?symbol=AAPL.US&interval=1m&limit=5"

Example Response

{
    "code": 0,
    "message": "success",
    "data": {
        "symbol": "AAPL.US",
        "interval": "1m",
        "klines": [
            {
                "time": 1768251300000,
                "open": "260.29",
                "high": "260.41",
                "low": "260.09",
                "close": "260.09",
                "volume": "129288",
                "quote_volume": "33640306.64"
            },
            {
                "time": 1768251360000,
                "open": "260.08",
                "high": "260.17",
                "low": "260.01",
                "close": "260.15",
                "volume": "124012",
                "quote_volume": "32256761.32"
            },
            {
                "time": 1768251420000,
                "open": "260.15",
                "high": "260.31",
                "low": "260.072",
                "close": "260.23",
                "volume": "111445",
                "quote_volume": "28998434.78"
            },
            {
                "time": 1768251480000,
                "open": "260.23",
                "high": "260.32",
                "low": "260.16",
                "close": "260.23",
                "volume": "127622",
                "quote_volume": "33211923.87"
            },
            {
                "time": 1768251540000,
                "open": "260.22",
                "high": "260.35",
                "low": "260.19",
                "close": "260.25",
                "volume": "285977",
                "quote_volume": "74429327.28"
            }
        ]
    }
}

Authorizations

X-API-Key
string
header
required

Query Parameters

symbol
string
required

Trading symbol

Example:

"BTCUSDT"

interval
enum<string>
required

K-line interval

Available options:
1m,
5m,
15m,
30m,
1h,
4h,
12h,
1d,
1w,
1M
Example:

"1h"

limit
integer
default:100

Number of records (default 100, max 1000)

Required range: 1 <= x <= 1000
Example:

24

start_time
integer

Start timestamp in milliseconds

Example:

1703123456789

end_time
integer

End timestamp in milliseconds

Example:

1703209856789

Response

200 - application/json

Successful response

code
integer
Example:

0

message
string
Example:

"success"

data
object[]