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>
| Parameter | Description |
|---|---|
| interval | Interval |
| symbol | indicates 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
| Name | Type | Description |
|---|---|---|
| e | STRING | Topic |
| E | LONG | Event time |
| s | STRING | Symbol |
| t | LONG | Start time of this K-line |
| T | LONG | End time of this K-line |
| s | STRING | Symbol |
| i | STRING | K-line interval |
| f | LONG | First trade ID during this K-line |
| L | LONG | Last trade ID during this K-line |
| o | STRING | First trade price during this K-line |
| c | STRING | Last trade price during this K-line |
| h | STRING | Highest trade price during this K-line |
| l | STRING | Lowest trade price during this K-line |
| v | STRING | Volume during this K-line |
| q | STRING | Quote asset volume during this K-line |
| n | LONG | Number of trades during this K-line |
| x | BOOLEAN | Is 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: