Connection
Connect to the ForecastEx WebSocket endpoint:| Property | Value |
|---|---|
| Protocol | WebSocket (wss://) |
| Authentication | api_key query parameter |
| Keepalive | Ping every 54 seconds |
| Timeout | 60 seconds without pong |
| Max Message Size | 16 KB |
Subscribing to markets
Once connected, send a JSON message to subscribe usingmarket_id:
| Field | Type | Required | Description |
|---|---|---|---|
action | string | Yes | subscribe or unsubscribe |
market_ids | array | Yes | Array of ForecastEx market identifiers |
message_types | array | No | ["prices"], ["trades"], or both. Defaults to prices if omitted. No orderbook available. |
Unsubscribing
Message types
Price messages
Trade messages
Full example
Important notes
- Authentication required via
api_keyquery parameter - No orderbook data available — ForecastEx uses CSV-based data feeds
- ForecastEx data is sourced via CSV polling (10-minute intervals)
- Use
market_id(ForecastEx market identifier) to subscribe - Messages are only sent for markets you have explicitly subscribed to

