Skip to main content

Best Practices

  1. Connect first, subscribe second: after a successful handshake, you must send a subscribe message before any data will flow.
  2. Don’t skip required fields: every request needs code and trace; subscribe requests additionally need data (even if it’s just {}).
  3. Send api_key at least once: either in the URL, or in the subscribe request’s data.api_key.
  4. Subscribe only to what you need: only subscribe to products your plan actually includes — otherwise you’ll get 40301.
  5. Filtering to a single match: set match_id in the subscribe request’s data.
  6. Reconnecting drops subscriptions: subscription state isn’t preserved across reconnects — you’ll need to re-subscribe every time.
  7. Failed subscribes don’t kill the connection: after an error like 40301, the connection stays open — adjust your params and retry.
  8. Rate limiting: don’t send more than 60 messages/minute on a single connection, or you’ll get disconnected.
  9. Heartbeat: send 20010 roughly every 30 seconds.
  10. Connection limits: if you exceed your plan’s connection quota, the handshake may return 429.
  11. Reconnect strategy: use exponential backoff (1s → 2s → … capped at 30s); don’t hammer reconnects immediately after a 429.
  12. Connection stays open after unsubscribing: you can keep heartbeating, or subscribe to other products.
  13. Push field compatibility: business fields can be missing — don’t hard-code assumptions that every field will always be present.

FAQ

The connection succeeds but I’m not getting any data? You need to send the corresponding subscribe code (with required trace and data) and receive a success ack. Also double-check whether there are actually live matches with updates right now. Can I subscribe to multiple data products at once? Yes. Just send 20000 / 20200 / 20100 / 20300 separately over the same connection. How do I only receive data for a single match? Set "match_id": "your-match-id" in the subscribe request’s data. Does the connection drop if a subscribe request fails? No. You’ll get an error response like 40301, and you can retry. Does the heartbeat need a data field? No. The heartbeat only needs code=20010 and trace.