跳到主要内容

K Chart

危险

Poloniex futures v1/v2 API will be officially offline on November 30, 2024. You can access the V3 API to provide you with a better trading experience.

Get K Line Data of Contract

HTTP Request

GET https://futures-api.poloniex.com/api/v1/kline/query

Example

GET https://futures-api.poloniex.com/api/v1/kline/query?symbol=.PXBT&granularity=480&from=1535302400000&to=1559174400000

Parameters

ParamTypeDescription
symbolString[Required]Symbol
granularityint[Required]Granularity (minute)
fromlong[Optional]Start time (millisecond)
tolong[Optional]End time (millisecond)

Response

{
"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
]
]
}

Notice

  1. The granularity (granularity parameter of K-line) represents the number of minutes, and the available granularity scope is: 1,5,15,30,60,120,240,480,720,1440,10080. Requests beyond the above range will be rejected.

  2. The maximum size per request is 200. If the specified start/end time and the time granularity exceeds the maximum size allowed for a single request, the system will only return 200 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.

  3. If you’ve specified only the start time in your request, the system will return 200 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 200 pieces of data closest to the end time; If neither the start time nor the end time is specified, the system will return the 200 pieces of data closest to the current time of the system.