Subscribe Index Kline Data

market.$contract_code.index.$period

Signature verification: Yes

Interface permission: Read

Rate Limit: For public interface to get market data such as Get Kline data, Get Market Data Overview, Get Contract Information,Get market in-depth data, Get premium index Kline, Get real-time forecast capital rate kline, Get basis data, Get the last Trade of a Contract and so on: For websocket: The rate limit for “req” request is 50 times at once. No limit for “sub” request as the data will be pushed by sever voluntarily.

Interface description: The interface supports cross margin mode and isolated margin mode.

Subscription Address

Environment
Address

Online

wss://api.sunx.io/ws/v1/index

Online (preferred by aws customers)

wss://api.sunx.io/ws/v1/index

Subscription Parameter

Parameter
Data Type
Required
Description
Value Range
Default Value

contract_code

string

true

index symbol

Case-Insenstive.Both uppercase and lowercase are supported.."BTC-USDT","ETH-USDT"...

period

string

true

kline type

1min, 5min, 15min, 30min, 60min,4hour,1day, 1mon

Notes: Pushed once the index data is changed. Periodical Push when the index data hasn't changed according to the kline period.

Data Update

Parameter
Data Type
Required
Description
Value Range

ch

string

false

Data channel,Format:market.$contract_code.index.$period

ts

long

false

Time of Respond Generation, Unit: Millisecond

<tick>

object array

false

id

string

false

index kline id,the same as kline timestamp,kline start timestamp

vol

string

false

Trade Volume. The value is 0.

count

decimal

false

count. The value is 0.

open

string

false

open index price

close

string

false

close index price

low

string

false

lowest index price

high

string

false

highest index price

amount

string

false

amount based on coins.

</tick>

false

Subscription Example

Example of a Successful Subscription

Example of a Data Update

Example of a Subscription Cancellation

Last updated