Skip to main content

Get Kline Data

POST /papi/v1/ramp/connect/prime/info/klines

Request Body​

FieldTypeMandatoryRemarks
cryptoCurrencystringYesCryptocurrency trading pair symbol, e.g., BTC, ETH
intervalstringYesKline interval (see supported intervals below)
startTimelongYesStart time in milliseconds (UTC)
endTimelongYesEnd time in milliseconds (UTC)

Supported Kline Intervals​

IntervalValue
3 minutes3m
1 hour1h
1 day1d

Example​

{
"cryptoCurrency": "BTC",
"interval": "1h",
"startTime": 1704067200000,
"endTime": 1704153600000
}
curl -X POST https://{domain}/papi/v1/ramp/connect/prime/info/klines \
-H 'Content-Type: application/json' \
-H 'X-Tesla-ClientId: {your client id}' \
-H 'X-Tesla-SignAccessToken: {your access token}' \
-H 'X-Tesla-Timestamp: {now}' \
-H 'X-Tesla-Signature: {signature}' \
-d '{"cryptoCurrency":"BTC","interval":"1h","startTime":1704067200000,"endTime":1704153600000}'

Response Body​

The response is an array of kline data. Each kline is represented as an array of values:

IndexTypeRemarks
0longKline open time in milliseconds
1stringOpening price
2stringHighest price during the interval
3stringLowest price during the interval
4stringClosing price
5stringTrading volume (base asset)
6longKline close time in milliseconds
7stringTrading volume (quote asset)
8intNumber of trades during the interval
9stringTaker buy volume (base asset)
10stringTaker buy volume (quote asset)
11stringUnused field, can be ignored

Example​

[
[
1704067200000,
"42500.00",
"42800.50",
"42300.00",
"42650.25",
"1234.56789",
1704070799999,
"52456789.12",
8456,
"617.28394",
"26228394.56",
"0"
],
[
1704070800000,
"42650.25",
"42900.00",
"42550.00",
"42800.00",
"987.65432",
1704074399999,
"42123456.78",
6789,
"493.82716",
"21061728.39",
"0"
]
]

Notes​

  • startTime and endTime are required and must be provided in milliseconds (UTC).
  • Interval values are case-sensitive.
  • Klines are uniquely identified by their open time.