Skip to main content

Get Historical Candlestick

Description

Query all historical K-line data and return a maximum of 100 pieces of data.
When either startTime or endTime is invalid, the K-line data for the latest time period will be returned.
When both startTime and endTime are provided, the endTime will take precedence and the startTime will be ignored.

  • GET /capi/v2/market/historyCandles

Weight(IP): 5

Request parameters

ParameterTypeRequired?Description
symbolStringYesTrading pair
granularityStringYesCandlestick interval[1m,5m,15m,30m,1h,4h,12h,1d,1w]
startTimeLongNoThe start time is to query the k-lines after this time
Unix millisecond timestamp
endTimeLongNoThe end time is to query the k-lines before this time
Unix millisecond timestamp
limitIntegerNoThe size of the data ranges from 1 to 100, with a default of 100
priceTypeStringNoPrice Type : LAST latest market price; MARK mark; INDEX index;
LAST by default

Request example

curl "https://api-contract.weex.com/capi/v2/market/historyCandles?symbol=cmt_bchusdt&granularity=1m"

Response parameters

ParameterTypeDescription
index[0]StringCandlestick time
Unix millisecond timestamp
index[1]StringOpening price
index[2]StringHighest price
index[3]StringLowest price
index[4]StringClosing price
index[5]StringTrading volume of the base coin
index[6]StringTrading volume of quote currency

Response example

[
[
"1716707460000",//Candlestick time
"69174.3",//Opening price
"69174.4",//Highest price
"69174.1",//Lowest price
"69174.3",//Closing price
"0", //Trading volume of the base coin
"0.011" //Trading volume of quote currency
]
]