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
| Parameter | Type | Required? | Description |
|---|---|---|---|
| symbol | String | Yes | Trading pair |
| granularity | String | Yes | Candlestick interval[1m,5m,15m,30m,1h,4h,12h,1d,1w] |
| startTime | Long | No | The start time is to query the k-lines after this time Unix millisecond timestamp |
| endTime | Long | No | The end time is to query the k-lines before this time Unix millisecond timestamp |
| limit | Integer | No | The size of the data ranges from 1 to 100, with a default of 100 |
| priceType | String | No | Price 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
| Parameter | Type | Description |
|---|---|---|
| index[0] | String | Candlestick time Unix millisecond timestamp |
| index[1] | String | Opening price |
| index[2] | String | Highest price |
| index[3] | String | Lowest price |
| index[4] | String | Closing price |
| index[5] | String | Trading volume of the base coin |
| index[6] | String | Trading 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
]
]