Skip to main content
Open wss://api.raze.bot/ws (or wss://ws.raze.bot, the same socket) with the same key as REST (?apiKey= from a browser, x-api-key or Authorization: Bearer from a server). Send JSON ops, receive JSON frames.
A missing or unknown key answers 401 and a key over its limit 429, before the upgrade.

Ops

Fields a channel does not use are ignored.

Frames

Every data frame repeats what it belongs to, so one handler can route frames of many subscriptions. The parameters come back in their canonical form: chain as its id (sol for solana), an EVM token in lowercase, unit as usd or marketCap, and on launchpad a chain of null when you did not filter. Route on id.
Route frames on type and ignore a type you do not know; never treat it as a trade.

Errors

A refused op answers an error frame with the id it named (the assigned s1, s2, … when it named none; null when the frame was not JSON):
A refused subscribe opens nothing and holds no id. The messages are listed in Live errors; unsubscribe of an id that is not open answers no subscription with that id. A channel that cannot read its history sends an error frame of its own, with the channel’s fields like any data frame:
On token that ends the subscription; on candles the live candles still follow. See Channels. A subscription that ended keeps its id, and its place among the 200, until you unsubscribe it.

Subscribe on the URL

Query parameters of the upgrade URL subscribe one channel right away, with the same names as the op. That subscription’s id is s1:
Wrong parameters on the URL do not refuse the upgrade: the socket opens and answers an error frame for s1. More subscriptions can be added on the same socket with subscribe ops.

Lifecycle

  • Up to 200 subscriptions per socket. Past that a subscribe is refused (at most 200 subscriptions per socket): open a second socket.
  • Subscribes are paced per socket: 20 at once, then 10 per second. The ones beyond wait their turn, in order, and are never refused; an unsubscribe sent after them waits too. ping is not paced.
  • The server sends a WebSocket ping every 20 s; browsers and most libraries answer it on their own. {"op":"ping"} is an extra, application-level round trip.
  • A socket that sends nothing for 60 s, not even the answer to a ping, is closed. So is a socket that stops reading: a write still pending after 30 s closes it.
  • Closing the socket ends every subscription on it. To resume after a drop, reconnect and subscribe again: each subscription starts with a fresh snapshot.
  • While the server is at capacity, the upgrade of a new socket answers 503 (server_busy, Retry-After: 30) instead of 101. A browser only sees the connection fail, so reconnect with a backoff of at least 30 s. Open sockets keep running and can still subscribe.

A token page in one socket