WebSocket APITopics
Market status
Receive
Server
Subscribe with predictMarketStatus/{marketId}. The latest status is sent on subscribe.
header
x-api-key<api-key>The API key in the handshake's x-api-key header. Use this where you can.
const socket = new WebSocket("wss://ws.predict.fun/ws?apiKey=YOUR_API_KEY");socket.addEventListener("message", (event) => { console.log(event.data);});application/json
- payload
type*stringtopic*stringThe 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" } ] }}