BTSE · AsyncAPI Specification
Spot WebSocket API
Version 3.2.0
Spot WebSocket streams for real-time market data and private user events. **OSS Endpoint (Orderbook):** `wss://ws.btse.com/ws/oss/spot` **Main Endpoint:** `wss://ws.btse.com/ws/spot` **Testnet OSS:** `wss://testws.btse.io/ws/oss/spot` **Testnet Main:** `wss://testws.btse.io/ws/spot` **Authentication:** Private topics require sending an `authKeyExpires` message with HMAC-SHA384 signature: `HMAC-SHA384(secret, "/ws/spot" + nonce)`
View Spec
View on GitHub
CompanyCryptocurrencyExchangeTradingDigital AssetsFuturesWebSocketAsyncAPIEventsWebSockets
Channels
ping
Ping
Send a plain text `ping` to keep the connection alive. The server responds with `pong`.
subscription
Subscribe / Unsubscribe
Subscribe or unsubscribe from any topic.
auth
WebSocket Authentication
Authenticate the session to access private topics (Notifications, User Trade Fills). Signature: `HMAC-SHA384(secret, "/ws/spot" + nonce)`
snapshotL1:{symbol}
Subscribe to the best bid / best ask (Level 1) for a market. **Topic format:** `snapshotL1:` (e.g. `snapshotL1:BTC-USD`) Each message is a full snapshot of the current best bid / best ask. The `bids` and `asks` arrays each contain a single `[price, size]` tuple representing the top of book, and the `type` field is always `snapshotL1`. Bids and asks are sent in `price` and `size` tuples as strings to preserve precision; clients should parse them with a high-precision type (e.g. `BigDecimal`, `decimal.js`) before performing arithmetic. Because every push is a full snapshot, clients can simply overwrite the local copy on each message — there is no sequence number, and no delta merging is required. If the connection drops, re-subscribe to the topic to resume receiving updates.
update:{symbol}_{grouping}
Subscribe to orderbook incremental updates through the `update` topic. **Topic format:** `update:_` (e.g. `update:BTC-USD_0`) The `_grouping` suffix represents the granularity of price-level aggregation. Valid values are `0` to `8`. If the suffix is omitted (e.g. `update:BTC-USD`), `_0` is used by default. Different grouping values produce independent topic subscriptions and caches. The first response received will be a snapshot of the current orderbook (indicated by the `type` field) with up to 50 levels. Incremental updates will be sent in subsequent packets with type `delta`. Bids and asks will be sent in `price` and `size` tuples. The size sent will be the new updated size for the price. If a value of `"0"` is sent, the price should be removed from the local copy of the orderbook. To ensure that the updates are received in sequence, `seqNum` indicates the current sequence and `prevSeqNum` refers to the packet before. `seqNum` will always be one after the `prevSeqNum`. If the sequence is out of order, unsubscribe and re-subscribe to the topic again. Also, if a [crossed orderbook](https://en.wikipedia.org/wiki/Order_book#Crossed_book) ever occurs (best bid is higher than or equal to best ask), unsubscribe and re-subscribe to the topic again.
tradeHistoryApi:{symbol}
Public Trade Fills
Real-time public trade feed for a market. **Topic:** `tradeHistoryApi:` — no authentication required.
notificationApiV3
Notifications
Real-time order status updates. Requires WebSocket authentication. **Topic:** `notificationApiV3` Includes both base and quote currency size fields (`originalOrderBaseSize`, `originalOrderQuoteSize`, `currentOrderBaseSize`, `currentOrderQuoteSize`, `filledBaseSize`, `totalFilledBaseSize`, `remainingBaseSize`, `remainingQuoteSize`) so that quote-denominated market orders are represented faithfully.
fills
User Trade Fills
Notification whenever an order is filled. Requires WebSocket authentication. **Topic:** `fills`
Messages
L1Subscribe
L1Subscribe
L1Unsubscribe
L1Unsubscribe
L2Subscribe
L2Subscribe
L2Unsubscribe
L2Unsubscribe
OrderbookSnapshot
OrderbookSnapshot
OrderbookDelta
OrderbookDelta
PublicTradeMessage
PublicTradeMessage
NotificationMessage
NotificationMessage
UserFillMessage
UserFillMessage
Servers
wss
oss-production
wss://ws.btse.com/ws/oss/spot
Production — Order Stream Service (orderbook data)
wss
oss-testnet
wss://testws.btse.io/ws/oss/spot
Testnet — Order Stream Service
wss
main-production
wss://ws.btse.com/ws/spot
Production — Main WebSocket (trades, auth, notifications)
wss
main-testnet
wss://testws.btse.io/ws/spot
Testnet — Main WebSocket
AsyncAPI Specification
Work with this as data
Every AsyncAPI spec here is available over the APIs.io API and to AI agents over MCP.