Skip to main content

Kline Data

Description

Real-time candlestick data is delivered as a subscription stream, not a request/response call. Connect to wss://api.prex.world/ws and subscribe to the kline:{symbol}:{interval} channel.

Supported intervals: 1m, 5m, 15m, 1h, 4h, 1d, 1w, 1M. Subscribing with any other interval is acknowledged but produces no data.

Upon subscribing, the server pushes a kline_snapshot message with the latest candle, then pushes kline updates in real time as the candle changes.

Subscribe

{
"type": "subscribe",
"channel": "kline:BTCUSDT:1h"
}

Push Example

{
"type": "kline",
"channel": "kline:BTCUSDT:1h",
"data": {
"time": 1711000000,
"open": "65400.00",
"high": "65500.00",
"low": "65350.00",
"close": "65432.10",
"volume": "123.456",
"quote_volume": "8074000.00",
"trade_count": 542,
"is_final": false
}
}
  • time — candle open time as a UNIX timestamp in seconds.
  • is_finaltrue when the candle period has closed.

See WebSocket API General Info for connection details. For historical candles, use GET /fapi/v1/klines.