Skip to main content

Get Candlestick Data

Frequency limit: 20 times/1s (IP)

Description

Get Candlestick Data

HTTP Request

  • GET /api/v2/spot/market/candles
Request Example
curl "https://api.cointr.com/api/v2/spot/market/candles?symbol=BTCUSDT&granularity=1min&startTime=1659076670000&endTime=1659080270000&limit=100"

Request Parameters

ParameterTypeRequiredDescription
symbolStringYesTrading pair e.g.BTCUSDT
granularityStringYesTime interval of charts
For the corresponding relationship between granularity and value, refer to the list below.
minute: 1min,5min,15min,30min
hour: 1h,4h,6h,12h
day: 1day,3day
week: 1week
month: 1M
hour in UTC:6Hutc,12Hutc
day in UTC:1Dutc,3Dutc
week in UTC:1Wutc
month in UTC: 1Mutc
1m, 3m, 5m can query for one month,15m can query for 52 days,30m can query for 62 days,1H can query for 83 days,2H can query for 120 days,4H can query for 240 days,6H can query for 360 days.
startTimeStringNoThe time start point of the chart data, i.e., to get the chart data after this time stamp
Unix millisecond timestamp, e.g. 1690196141868
endTimeStringNoThe time end point of the chart data, i.e., get the chart data before this time stamp
Unix millisecond timestamp, e.g. 1690196141868
limitStringNoNumber of queries: Default: 100, maximum: 1000.
Response Example
{
"code": "00000",
"msg": "success",
"requestTime": 1695800278693,
"data": [
[
"1656604800000",
"37834.5",
"37849.5",
"37773.5",
"37773.5",
"428.3462",
"16198849.1079",
"16198849.1079"
],
[
"1656604800000",
"37834.5",
"37849.5",
"37773.5",
"37773.5",
"428.3462",
"16198849.1079",
"16198849.1079"
]
]
}

Response Parameters

ParameterTypeDescription
index[0]StringSystem timestamp, Unix millisecond timestamp, e.g. 1690196141868
index[1]StringOpening price
index[2]StringHighest price
index[3]StringLowest price
index[4]StringClosing price
index[5]StringTrading volume in base currency, e.g. "BTC" in the "BTCUSD" pair.
index[6]StringTrading volume in quote currency, e.g. "USD" in the "BTCUSD" pair.
index[7]StringTrading volume in USDT