Get Kline Data
POST /papi/v1/ramp/connect/prime/info/klines
Request Body
| Field | Type | Mandatory | Remarks |
|---|---|---|---|
| cryptoCurrency | string | Yes | Cryptocurrency trading pair symbol, e.g., BTC, ETH |
| interval | string | Yes | Kline interval (see supported intervals below) |
| startTime | long | Yes | Start time in milliseconds (UTC) |
| endTime | long | Yes | End time in milliseconds (UTC) |
Supported Kline Intervals
| Interval | Value |
|---|---|
| 3 minutes | 3m |
| 1 hour | 1h |
| 1 day | 1d |
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:
| Index | Type | Remarks |
|---|---|---|
| 0 | long | Kline open time in milliseconds |
| 1 | string | Opening price |
| 2 | string | Highest price during the interval |
| 3 | string | Lowest price during the interval |
| 4 | string | Closing price |
| 5 | string | Trading volume (base asset) |
| 6 | long | Kline close time in milliseconds |
| 7 | string | Trading volume (quote asset) |
| 8 | int | Number of trades during the interval |
| 9 | string | Taker buy volume (base asset) |
| 10 | string | Taker buy volume (quote asset) |
| 11 | string | Unused 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
startTimeandendTimeare required and must be provided in milliseconds (UTC).- Interval values are case-sensitive.
- Klines are uniquely identified by their open time.