Skip to main content

Connection

Connect to the PredictIt WebSocket endpoint:

Subscribing to markets

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

Unsubscribing

Message types

Price messages

Full example

Important notes

  • Authentication required via api_key query parameter
  • Prices only — PredictIt does not provide orderbook depth or individual trade history
  • PredictIt data is sourced via REST polling (60-second intervals)
  • Only emits updates when market state changes (last trade price, best bid/ask)
  • Use market_id (PredictIt market identifier) to subscribe