Skip to main content

Get Candlestick Data

Frequency limit: 20 times/1s (IP)

Description

By default, 100 records are returned. If there is no data, an empty array is returned. The queryable data history varies depending on the k-line granularity.


The rules are as follows:
1m, 3m, and 5m can be checked for up to one month;
15m can be checked for up to 52 days;
30m can be searched for up to 62 days;
1H can be checked for up to 83 days;
2H can be checked for up to 120 days;
4H can be checked for up to 240 days;
6H can be checked for up to 360 days

HTTP Request

  • GET /api/v2/mix/market/candles
Request Example
curl "https://api.cointr.com/api/v2/mix/market/candles?symbol=BTCUSDT&granularity=5m&limit=100&productType=usdt-futures"

Request Parameters

ParameterTypeRequiredDescription
symbolStringYesTrading pair
productTypeStringYesProduct type
USDT-FUTURES USDT professional futures
COIN-FUTURES Mixed futures
USDC-FUTURES USDC professional futures
SUSDT-FUTURES USDT professional futures demo
SCOIN-FUTURES Mixed futures demo
SUSDC-FUTURES USDC professional futures demo
granularityStringYesK-line particle size
- 1m(1 minute)
- 3m(3 minutes)
- 5m(5 minutes)
- 15m(15 minutes)
- 30m(30 minutes)
- 1H( 1 hour)
- 4H(4 hours)
- 6H(6 hours)
- 12H(12 hours)
- 1D(1 day)
- 3D ( 3 days)
- 1W (1 week)
- 1M (monthly line)
- 6Hutc (UTC 6 hour line)
- 12Hutc (UTC 12 hour line)
- 1Dutc (UTC 1-day line)
- 3Dutc (UTC 3-day line)
- 1Wutc (UTC weekly line)
- 1Mutc (UTC monthly line)
startTimeStringNoThe start time is to query the k-lines after this time
According to the different time granularity, the corresponding time unit must be rounded down to be queried.
The millisecond format of the Unix timestamp, such as 1672410780000
Request data after this start time (the maximum time query range is 90 days)
endTimeStringNoThe end time is to query the k-lines before this time
According to the different time granularity, the corresponding time unit must be rounded down to be queried.
The millisecond format of the Unix timestamp, such as 1672410780000
Request data before this end time (the maximum time query range is 90 days)
kLineTypeStringNoCandlestick chart types: MARKET tick; MARK mark; INDEX index;
MARKET by default
limitStringNoDefault: 100, maximum: 1000
Response Example
{
"code": "00000",
"msg": "success",
"requestTime": 1695865615662,
"data": [
[
"1695835800000",
"26210.5",
"26210.5",
"26194.5",
"26194.5",
"26.26",
"687897.63"
],
[
"1695836100000",
"26194.5",
"26194.5",
"26171",
"26171",
"17.98",
"470618.72"
]
]
}

Response Parameters

ParameterTypeDescription
index[0]StringMilliseconds format of timestamp Unix, e.g. 1597026383085
index[1]StringEntry price
index[2]StringHighest price
index[3]StringLowest price
index[4]StringExit price. The latest exit price may be updated in the future. Subscribe to WebSocket to track the latest price.
index[5]StringTrading volume of the base coin
index[6]StringTrading volume of quote currency