Subscribe to token kline data

Description

  • Encoding:UTF-8

  • Path:ws://api.blockin.ai/ws/quot/subscribe/market

  • Description:Real-time push of the latest kline data

Request Header

Parameter
Required
Description

Content-Type

Y

application/json

AccessKey

Y

1bdb01c947c54919b64d1fc6794atest

Request Parameters

Parameter
Required
Description

function_name

Y

Request method name: SUBSCRIBE

params

N

Request parameters, eg: <address>@kline_<interval>. interval: 1m, 5m, 15m, 30m, 1h, 2h, 4h, 6h, 12h, 1d, 1w, 1mo

Response

Public Response

Parameter
Required
Type
Description

success

Y

Boolean

Success Boolean

data

Y

String

Response Content

error_code

N

String

Error code

error_msg

N

String

Error message

Data Content

Parameter
Required
Type
Description

function_name

Y

String

Request method name: SUBSCRIBE

params

N

String

Request parameters

Push Message

Parameter
Required
Type
Description

event_type

Y

String

Event type

event_time

Y

Long

Event time

data

Y

List

Push message

Data Content

Parameter
Required
Type
Description

address

Y

String

Token's address

chain_name

Y

String

Chain's name

symbol

Y

String

Token's symbol

interval

Y

String

Time interval

time

Y

Long

Timestamp

open

Y

BigDecimal

Opening price

close

Y

BigDecimal

Closing price

high

Y

BigDecimal

Highest price

low

Y

BigDecimal

Lowest price

volume

Y

BigDecimal

Volume

Request Sample

{ "function_name":"SUBSCRIBE", "params":["0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2@kline_15m", "0xdac17f958d2ee523a2206206994597c13d831ec7@kline_15m"] }

Successful Response Sample

{
    "success":true,
    "data":{
        "function_name":"SUBSCRIBE",
        "params":["0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2@kline_15m",
                  "0xdac17f958d2ee523a2206206994597c13d831ec7@kline_15m"]
    },
    "error_code":null,
    "error_msg":null
}

Successful Push Data Sample

{
    "event_type":"kline",
    "event_time":1695275427,
    "data":[
            {
                "address":"0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
                "symbol":"WETH",
                "interval":"15m",
                "time": 1695275100,
                "open": 1623.32758236833491436536584521452,
                "close": 1622.2332376755211569475559359162,
                "high": 1623.77350993027112918695675427066,
                "low": 1621.810495015157310435736759471287,
                "volume": 638415.661131,
                "chain_name":"Ethereum"
            },
            {
                "address":"0xdac17f958d2ee523a2206206994597c13d831ec7",
                "symbol":"USDT",
                "interval":"15m",
                "time": 1695275100,
                "open": 1.00505797281677852758369344703249225,
                "close": 0.998614633326150701050165452083875,
                "high": 1.0050985354531143341690283450927981,
                "low": 0.99861463332615070105016545208387584,
                "volume": 2.471446243884698196",
                "chain_name":"Ethereum"
            }
           ]
}

Last updated