Websocket for ticker data
Description
Interval: 500ms
Request
{"event": "subscribe", "arg": [{ "channel": "ticker", "sym":"OKX_SPOT_BTC_USDT" }]}
| Field name | Type | Necessary | Remarks |
|---|---|---|---|
| event | String | Y | subscribe / unsubscribe |
| args | Array | Y | Subscribe param. There can be no more than 50 sym parameters per subscribe. |
| > channel | String | Y | Channel name: ticker |
| > sym | String | Y | Unique identifier |
Response
{"event":"subscribe","arg":[{"channel":"ticker","sym":"OKX_SPOT_BTC_USDT"}],"code":0,"message":"Success"}
| Field | Type | Remarks |
|---|---|---|
| event | String | subscribe / unsubscribe |
| code | String | Error Code |
| msg | String | Error Message |
| args | Array | Subscribe param |
| > channel | String | Channel name: ticker |
| > sym | String | Unique identifier |
Data Sample:
{
"arg":{
"channel":"ticker",
"sym":"OKX_SPOT_BTC_USDT"
},
"data":{
"last":"93166.6",
"low24h":"90986.9",
"high24h":"93888",
"open24h":"91860.2",
"vol24h":"1207371025.181592114",
"vol24v":"13078.22438585",
"chg":"0.014222",
"ts":"1732093591811"
}
}
| Field | Type | Remarks |
|---|---|---|
| > channel | String | ticker |
| sym | String | Unique identifier |
| data | Array | Data |
| > sym | String | Unique identifier |
| > last | String | Last Traded Price |
| > lastSz | String | Last Traded Quantity, 0 stands for non-traded |
| > low24h | String | Lowest Price in 24hrs |
| > open24h | String | Open Price in 24hrs |
| > high24h | String | Highest Price in 24hrs |
| > vol24h | String | Trading Quantity in 24hrs |
| > vol24v | String | Trading Volume (USDT) in 24hrs |
| > chg | String | Change percentage |
| > ts | String | Timestamp, in Unix millionsecond. e.g. 1732093591811 |
