跳到主要内容

24h价格变动情况

接口描述​

24小时行情统计以订阅推送流方式提供,而不是请求/响应式调用。连接 wss://api.ztdxtest.xyz/ws 并订阅 ticker:{symbol} 频道。

订阅成功后,服务器会立即推送一次快照,随后每 2 秒推送一次更新。

订阅​

{
"type": "subscribe",
"channel": "ticker:BTCUSDT"
}

推送示例​

{
"type": "ticker",
"channel": "ticker:BTCUSDT",
"symbol": "BTCUSDT",
"last_price": "63507.5",
"mark_price": "63512.1",
"index_price": "63534.86195652",
"price_change_24h": "-1100.2",
"price_change_percent_24h": "-1.7028929988221218",
"high_24h": "64909.4",
"low_24h": "62372.7",
"volume_24h": "1234567.89",
"open_interest": "2794.819330769230769232",
"funding_rate": "0.000080445034097260",
"next_funding_time": 1795075200,
"last_price_source": "internal",
"volume_source": "internal",
"reference_provider": "binance",
"reference_updated_at": 1795070678003,
"reference_available": true,
"reference_volume": null,
"reference_open_interest": null,
"reference_24h": null,
"server_time": 1795070678675,
"timestamp": 1795070678675
}

连接方式参见 WebSocket API 基本信息。如需 REST 快照,请使用 GET /fapi/v1/ticker/24hr。