WebSocket APITopics

Market status

Receive
/ws
Server

Subscribe with predictMarketStatus/{marketId}. The latest status 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*
resolved
{  "type": "M",  "topic": "predictMarketStatus/123",  "data": {    "kind": "marketStatusUpdate",    "tsMs": 1736696400000,    "marketId": 123,    "status": "RESOLVED",    "marketOutcomes": [      {        "label": "Yes",        "indexSet": 1,        "price": "1000000000000000000",        "onChainId": "4567890123456789012345678901234567890"      },      {        "label": "No",        "indexSet": 2,        "price": "0",        "onChainId": "9876543210987654321098765432109876543"      }    ]  }}