Skip to main content

Endpoint

TLS is required; ws:// is not accepted. Send your key in the apikey header on the upgrade request. It is checked once, at connection time. After the socket is open no further authentication happens.
The browser WebSocket constructor cannot set custom headers, so the stream cannot be opened directly from browser code. Use a native client (Node.js, Python, Go, …) or proxy the connection through your own backend, which also keeps your key off the client.

Lifecycle

  1. The gateway authenticates the request and checks that the key is granted the stream.
  2. The server checks that your watchlist is not empty. An empty watchlist is rejected with 400 before the upgrade.
  3. The request upgrades with the standard 101 Switching Protocols handshake.
  4. The server pushes JSON text frames. Anything you send over the socket is read and discarded; there is no client-to-server protocol.
No heartbeat is sent. To detect a half-open connection (NAT timeout, an intermediary silently dropping the socket), track the time since the last message and reconnect once it exceeds your threshold. Five minutes is a reasonable default. On disconnect, from either side, no close-frame payload is sent. Treat any unexpected close as “reconnect with backoff”.

Errors

These are HTTP responses returned before the upgrade completes. After the upgrade, a message that fails to parse on your side should be logged and skipped; the server keeps streaming.

Reconnection strategy

Use exponential backoff starting at one second, capped at 30 seconds, reset on a successful open. A tight reconnect loop exhausts the rate limit in seconds and then locks you out for the rest of the minute.

Best practices

  1. One connection per process. A single socket covers your whole watchlist. Do not open one per event.
  2. Reconnect with backoff. See above.
  3. Filter client-side for everything except event_id and change_type.
  4. Treat event_infos as optional. It is omitted entirely when the platform does not expose metadata.
  5. Do not block in your message handler. Process notifications asynchronously so back-pressure never stalls the socket.
  6. Track time since the last message and reconnect after about five minutes of silence.