WebSocket APITopics

Category changed

Receive
/ws
Server

Subscribe with predictCategoryChanged/{categoryId}. Refetch the category, or apply patch when the message carries one. Nothing is sent on subscribe.

Authorization

headerx-api-key<api-key>

The API key in the handshake's x-api-key header. Use this where you can.

Code Sample
const socket = new WebSocket("wss://ws.predict.fun/ws?apiKey=YOUR_API_KEY");socket.addEventListener("message", (event) => {  console.log(event.data);});

Messages

application/json
  1. payload
type*string
topic*string

The topic string the subscription was made with.

data*|
{  "type": "M",  "topic": "predictCategoryChanged/45",  "data": {    "kind": "categoryChanged",    "patchKind": null,    "tsMs": 1736696400000,    "categoryId": 45,    "slug": "politics"  }}