KLine methods
Used to get data for charts.
List of KLine methods:
KLine Query- used for one-time data get requests.
KLine Subscribe - used to subscribe to receive real-time updates.
KLine Unsubscribe - used to unsubscribe from the KLine Subscribe method.
KLine Query method
Used for one-time data get requests.
Method
kline.query
Request "params" parameters
pair*
STRING
Any public pair
BTC_USDT
start*
NUMERIC
Start time in TimeStamp format
1727272000
end*
NUMERIC
Start time in TimeStamp format
1727276700
interval*
NUMERIC
Time interval (60 = 1 min, 900 = 15 min, 1800 = 30 min, 3600 = 1 h, 14400 = 4 h, 86400 = 1 d, etc)
3600
Request example
{
"method":"kline.query",
"params":
[
"BTC_USDT",
1727272000,
1727276700,
3600
],
"id":10
}
Response "result" parameters
time
NUMERIC
open
STRING
close
STRING
highest
STRING
lowest
STRING
volume
STRING
amount
STRING
market
STRING
Response example
{
"id": 10,
"params": [
"BTC_USDT",
1727272000,
1727276700,
3600
],
"result": [
[
1727276400, // time
"63936.5", // open (price)
"63876.99", // close (price)
"63999", // highest (price)
"63866.57", // lowest (price)
"4.19554334", // volume
"268265.681968204036662" // amount
"BTC_USDT" // market
]
],
"error": null
}
KLine Subscribe method
Used to subscribe to receive real-time updates.
Method
kline.subscribe
Request "params" parameters
pair*
STRING
Any public pair
BTC_USDT
interval*
NUMERIC
Time interval (60 = 1 min, 900 = 15 min, 1800 = 30 min, 3600 = 1 h, 14400 = 4 h, 86400 = 1 d, etc)
3600
Request example
{
"method":"kline.subscribe",
"params":
[
"BTC_USDT",
3600
],
"id":1
}
Response example (successfully subscribed)
{
"id": 1,
"params": [],
"result": {
"status": "success"
},
"error": null
}
Response "params" parameters ("kline.update")
time
NUMERIC
open
STRING
close
STRING
highest
STRING
lowest
STRING
volume
STRING
amount
STRING
market
STRING
Response example ("kline.update")
{
"id": null,
"method": "kline.update",
"params": [
[
1727262000, // time
"63630.45000000", // open (price)
"63574.00000000", // close (price)
"63647.95000000", // highest (price)
"63572.00000000", // lowest (price)
"0.42535636", // volume
"27060.5947980969293460", // amount
"BTC_USDT" // pair (name)
]
]
}
KLine unsubscribe method
Used to unsubscribe from the KLine Subscribe method.
Method
kline.unsubscribe
Request example
{
"method":"kline.unsubscribe",
"params":[],
"id":10
}
Response example (successfully unsubscribed)
{
"id": 10,
"params": [],
"result": {
"status": "success"
},
"error": null
}