24hr Ticker Statistics
{{WSS_SERVER}}/ws
Modified at: 8 个月前
Ticker Statistics is used to subscribe to real-time updates on symbol statistics for a specific trading pair on our platform.
Update Speed
5000ms
Message Structure
Send Message
- type: Specifies the type of WebSocket message.
- Type: String.
- Value: "subscribe"
- channel: Indicates the type of data to subscribe to (e.g., symbol stats updates).
- Type: String.
- Value: "symbol_stats"
- id: A unique identifier for the subscription request. Write randomly or use any unique identifier.
- Type: String.
- Example. "random string 001"
Subscribe Example
{
"type": "subscribe",
"channel": "symbol_stats",
"id": "random string"
}
Unsubscribe Example
{
"type": "unsubscribe",
"channel": "symbol_stats",
"id": "random string"
}
Initial Message
- error: Indicates whether the WebSocket message is reporting an error.
- Type: Boolean
- Value: true if there is an error, false otherwise.
- id: Represents a unique identifier associated with the WebSocket message, typically used for tracking or matching responses.
- Type: String
- Example: "random string"
- type: Specifies the type of WebSocket message.
- Type: String
- Value: "init"
- channel: Indicates the type of data being updated (e.g., symbol_stats updates).
- Type: String
- Value: "symbol_stats"
- timestamp: Specifies the timestamp of the 24h ticker statistics is subscribed.
- Type: Integer (UNIX timestamp in milliseconds & UTC)
- Example: 1704433004692
- data: An object containing information about various trading pairs. Each trading pair is represented by its symbol (e.g., "ETHUSDT", "WBTCUSDT").
- openTime: The opening time of the candlestick.
- Type: Integer (UNIX timestamp in milliseconds & UTC)
- openPrice: The opening price of the last 24 hours.
- Type: String
- highPrice: The highest price reached during the last 24 hours.
- Type: String
- lowPrice: The lowest price reached during the last 24 hours.
- Type: String
- closePrice: The closing price of the last 24 hours.
- Type: String
- volume: The total traded volume during the last 24 hours.
- Type: String
- trades: The number of trades executed during the last 24 hours.
- Type: Integer
- closeTime: The closing time of the last 24 hours.
- Type: Integer (UNIX timestamp in milliseconds & UTC)
- quoteVolume: The total quoted volume during the candlestick's duration.
- Type: String
- takerBuyBaseVolume: The volume of the asset bought by takers during the last 24 hours.
- Type: String
- takerBuyQuoteVolume: The volume of the quoted asset bought by takers during the last 24 hours.
- Type: String
- openTime: The opening time of the candlestick.
Response Example
{
"error": false,
"id": "random string",
"type": "init",
"channel": "symbol_stats",
"timestamp": 1704706670000,
"data": {
"WBTCUSDT": {
"openTime": 1704621600000,
"openPrice": "43934.94000000",
"highPrice": "44480.58000000",
"lowPrice": "43206.54000000",
"closePrice": "43800.00000000",
"volume": "138.58620000",
"trades": 2185,
"closeTime": 1704707999999,
"quoteVolume": "6099235.44480000",
"takerBuyBaseVolume": "82.37620000",
"takerBuyQuoteVolume": "2472668.32050000"
},
"WBTCUSDC": {
"openTime": 1704621600000,
"openPrice": "43958.18000000",
"highPrice": "44499.56000000",
"lowPrice": "43255.86000000",
"closePrice": "43817.05000000",
"volume": "167.56000000",
"trades": 2718,
"closeTime": 1704707999999,
"quoteVolume": "7368593.26080000",
"takerBuyBaseVolume": "71.73000000",
"takerBuyQuoteVolume": "4213810.76330000"
}
}
}
Update Message
- Type: Specifies the type of WebSocket message.
- Type: String
- Value: "update"
- Channel: Indicates the type of data being updated (e.g., symbol_stats updates).
- Type: String
- Value: "symbol_stats"
- Data: An object containing information about various trading pairs. Each trading pair is represented by its symbol (e.g., "ETHUSDT", "WBTCUSDT").
- Open Time: The opening time of the last 24 hours.
- Type: Integer (UNIX timestamp in milliseconds & UTC)
- Open Price: The opening price of the last 24 hours.
- Type: String
- High Price: The highest price reached during the last 24 hours.
- Type: String
- Low Price: The lowest price reached during the last 24 hours.
- Type: String
- Close Price: The closing price of the last 24 hours.
- Type: String
- Volume: The total traded volume during the last 24 hours.
- Type: String
- Trades: The number of trades executed during the last 24 hours.
- Type: Integer
- Close Time: The closing time of the last 24 hours.
- Type: Integer (UNIX timestamp in milliseconds)
- Quote Volume: The total quoted volume during the last 24 hours.
- Type: String
- Taker Buy Base Volume: The volume of the asset bought by takers during the last 24 hours.
- Type: String
- Taker Buy Quote Volume: The quoted volume of the asset bought by takers during the last 24 hours.
- Type: String
Update Example
{ "type": "update", "channel": "symbol_stats", "data": { "ETHUSDT": { "openTime": 1700784000000, "openPrice": "1780.00000000", "highPrice": "1789.11000000", "lowPrice": "1777.23000000", "closePrice": "1779.00000000", "volume": "10.00000000", "trades": 7, "closeTime": 1700870399999, "quoteVolume": "17810.63000000", "takerBuyBaseVolume": "6.10000000", "takerBuyQuoteVolume": "10850.00000000" }, "WBTCUSDT": { "openTime": 1700784000000, "openPrice": "31553.74000000", "highPrice": "35576.47000000", "lowPrice": "31500.23000000", "closePrice": "34113.78000000", "volume": "482.74000000", "trades": 8737, "closeTime": 1700870399999, "quoteVolume": "15869889.72740000", "takerBuyBaseVolume": "378.04000000", "takerBuyQuoteVolume": "3436346.97570000" } ] }
- Type: String
- Open Time: The opening time of the last 24 hours.
请求参数
无
Modified at 8 个月前