Skip to main content

Connection

Connect to the Predict.fun WebSocket endpoint:
No authentication is required for WebSocket connections.

Subscribing to markets

Once connected, send a JSON message to subscribe using market_id:

Unsubscribing

Message types

Price messages

Orderbook messages

Trade messages

Full example

Important notes

  • No authentication required for WebSocket connections
  • Use market_id (Predict.fun market identifier) to subscribe
  • Messages are only sent for markets you have explicitly subscribed to
  • Multiple markets can be subscribed in a single message
  • Trades must be explicitly requested (not included in the default subscription)