Skip to content

Query kline data

Query kline Data

Address/openApi/contract/kline

Received Parameters

Submission Method: GET

Example

curl -d /openApi/contract/kline

Submission Parameters

Parameter Name Required Type Example Description
symbol Yes string BTC-USDT Trading pair
period Yes string 1min Candlestick type: 1min, 5min, 15min, 30min, 1hour, 6hour, 12hour, 1day, 1week
size No int 150 Number to fetch, range: [1,2000]
start No int 16745631221 Start timestamp
end No int 16745631221 End timestamp

Return Parameters

Parameter Name Mandatory Type Example Description
errno Yes int 0 Status Code
errmsg Yes success success Status information
result Yes array See example Return result

result description

Parameter Name Required Type Example Description
ts Yes long 1499223904680 Data retrieval time
symbol Yes string BTC-USDT Trading pair
period Yes string 1min Candlestick Type: 1min, 5min, 15min, 30min, 60min, 1day, 1mon, 1week, 1year
data Yes array 见示例 kline data

result -> data description

Parameter Name Required Type Example Description
id Yes long 1499223904680 K-line ID
amount Yes string 37593.0266 Trading Volume
count Yes int 1 Number of transactions
open Yes string 1935.2000 Opening price
close Yes string 1879.0000 When the candlestick is the latest one, it's the latest transaction price
low Yes string 1856.0000 Minimum price
high Yes string 1940.0000 Highest price
vol Yes string 71031537.97866500 i.e., sum(each transaction price * transaction volume)

Return Example

JSON
{
    "errno": 0,
    "errmsg": "success",
    "result": {
        "symbol": "EOS-USDT",
        "period": "1min",
        "ts": "1499223904680",
        "data": [
            {
                "id": 1499184000,
                "amount": "37593.0266",
                "count": 0,
                "open": "1935.2000",
                "close": "1879.0000",
                "low": "1856.0000",
                "high": "1940.0000",
                "vol": "71031537.97866500"
            }
        ]
    }
}