Get Klines
HTTP REQUEST
GET /api/v1/kline/query
Example
GET /api/v1/kline/query?symbol=.KXBT&granularity=480&from=1535302400000&to=1559174400000
REQUEST URL
This endpoint support Futures URL
REQUEST RATE LIMIT
Public weight
:3
PARAMETERS
Param | Type | Mandatory | Description |
---|---|---|---|
symbol | String | Yes | symbol |
granularity | int | Yes | Granularity (minute) |
from | long | No | Start time (milisecond) |
to | long | No | End time (milisecond) |
RESPONSES
{
"code": "200000",
"data": [
[
1575331200000, //Time
7495.01, //Entry price
8309.67, //Highest price
7250, //Lowest price
7463.55, //Close price
0 //Trading volume
],
[1575374400000, 7464.37, 8297.85, 7273.02, 7491.44, 0]
]
}
Explanation
The granularity (granularity parameter of K-line) represents the number of minutes, the available granularity scope is: 1,5,15,30,60,120,240,480,720,1440,10080. Requests beyond the above range will be rejected.
The maximum size per request is 500. If the specified start/end time and the time granularity exceeds the maximum size allowed for a single request, the system will only return 500 pieces of data for your request. If you want to get fine-grained data in a larger time range, you will need to specify the time ranges and make multiple requests for multiple times.
If you’ve specified only the start time in your request, the system will return 500 pieces of data from the specified start time to the current time of the system; If only the end time is specified, the system will return 500 pieces of data closest to the end time; If neither the start time nor the end time is specified, the system will return the 500 pieces of data closest to the current time of the system.