Endpoint Details
- URL:
wss://pm-api-prod-eu.mobula.io - Event Type:
pm-market-price
Subscription Format
Subscribe to real-time price updates for a prediction market:Parameters
Platform name (e.g.,
polymarket).The platform-specific market identifier.
Mobula API key. Also accepts
apiKey as alias.Custom subscription ID for tracking. Auto-generated if not provided.
Subscription Confirmation
After subscribing, you’ll receive a confirmation message:Real-Time Updates
Price updates are pushed whenever the order book changes. Each message is a flat object with all fields at the top level:Response Field Definitions
| Field | Type | Description |
|---|---|---|
event | string | Always pm-market-price for price updates |
subscriptionId | string | Your subscription tracking ID |
platform | string | Platform name |
marketId | string | Market identifier |
outcomeId | string | Outcome token ID |
priceUSD | number | Mid price (0 to 1) |
bestBidUSD | number | Best bid price |
bestAskUSD | number | Best ask price |
spreadUSD | number | Bid-ask spread |
timestamp | number | Server timestamp in milliseconds |
Unsubscribe
To stop receiving updates, send:Integration Example
Ping / Pong Keepalive
Application-level keepalive: Send{ "event": "ping" } and receive { "event": "pong" }. Use this when you need explicit control over keepalive timing.
ping frames. Most WebSocket libraries handle these automatically. If no response is received within 30 seconds, the server closes the connection.
Requires an active API key with Growth or Enterprise plan. See Authentication for details.