Skip to Content
🚀 Spot APISpot WebSocketK-line (UTC+0 Timezone)

K-line (UTC+0 Timezone)

Pushes updates for the requested K-line type (the latest K-line) every second. This update is based on the UTC+0 timezone.

Subscribe URL

wss://stream.bittap.com/endpoint?format=JSON

Subscribe Parameters

Stream Name: s_kline_<interval>@<symbol>

ParameterDescription
intervalInterval
symbolindicates the trading pair

Subscribing to K-lines requires providing an interval parameter, with the shortest being the minute line and the longest being the monthly line. The following intervals are supported: m -> minute; h -> hour; d -> day; w -> week; M -> month

  • 1m
  • 3m
  • 5m
  • 15m
  • 30m
  • 1h
  • 2h
  • 4h
  • 6h
  • 8h
  • 12h
  • 1d
  • 3d
  • 1w
  • 1M

Data Update

NameTypeDescription
eSTRINGTopic
ELONGEvent time
sSTRINGSymbol
tLONGStart time of this K-line
TLONGEnd time of this K-line
sSTRINGSymbol
iSTRINGK-line interval
fLONGFirst trade ID during this K-line
LLONGLast trade ID during this K-line
oSTRINGFirst trade price during this K-line
cSTRINGLast trade price during this K-line
hSTRINGHighest trade price during this K-line
lSTRINGLowest trade price during this K-line
vSTRINGVolume during this K-line
qSTRINGQuote asset volume during this K-line
nLONGNumber of trades during this K-line
xBOOLEANIs this K-line closed (has the next K-line started)

Subscribe Example

{ "method": "SUBSCRIBE", "params": [ "s_kline_15m@BTC-USDT" ], "id": "mbnmv2p" }

Subscribe Success Example

{ "code": 0, // 0 means success, non-0 means failure "msg":"", // failure reason, null when success "topic": ["", ""], // topics that failed to subscribe "id": 1 }

Data Update Example

{ "e": "s_kline_15m", // topic "E": 1762218910503, // Event time "s": "BTC-USDT", // Symbol "k": { "t": 1762218900000, // Start time of this K-line "T": 1762219799999, // End time of this K-line "s": "BTC-USDT", // Symbol "i": "15m", // K-line interval "f": 738449604345856, // First trade ID during this K-line "L": 738450289983488, // Last trade ID during this K-line "o": "106580.8", // First trade price during this K-line "c": "106610.66", // Last trade price during this K-line "h": "106624.14", // Highest trade price during this K-line "l": "106580.8", // Lowest trade price during this K-line "v": "0.16059", // Volume during this K-line "q": "17121.32099738", // Quote asset volume during this K-line "n": 5, // Number of trades during this K-line "x": false // Is this K-line closed (has the next K-line started) } }

Unsubscribe Example

{ "method": "UNSUBSCRIBE", "params": [ "s_kline_15m@BTC-USDT" ], "id": "mbnmv2p" }

Error Codes

No information available

Code Example

Last updated on: