Skip to main content
4casters exposes three APIs that share the same credentials and the same underlying account / orderbook / settlement engine. Pick the one that matches what you’re building, or mix-and-match — most integrations use REST for setup + history and a WebSocket for live trading.

Choose your API

REST API

Request / response over HTTPS. Use for login, account state, history, market lookups, and batch place / edit / cancel.

Orders WebSocket

Persistent low-latency channel for placing and cancelling orders. Use when you care about round-trip latency.

Streaming WebSocket

Push feeds for orderbook ticks and per-account fills / settles. Use to keep state in sync without polling.

When to use which

Authentication

All three APIs take one credential in the Authorization header (REST requests and WebSocket handshakes alike). There are two kinds:
  • An API key, created once on your account page. For programs: no login step, no rotation, optional IP ranges (IPv4 or IPv6) and expiry, revocable on its own.
  • A login token, from POST /user/login with your username and password. What the website uses; valid 30 days, then rotated in place.
If you are reading these docs to write code, use a key. Authentication compares the two and covers token lifetime, errors and credential hygiene.

Conventions

  • Transport: HTTPS / WSS only.
  • Encoding: JSON everywhere.
  • Response envelope (REST): { "data": <payload> } on success; { "error": "<message>" } on HTTP errors.
  • Identifiers: Game ids, participant ids, and order ids are MongoDB ObjectID strings (24-char hex).
  • Odds: American format (negative for favorites, positive for underdogs) unless noted.
  • Time: ISO 8601 with Z (UTC).

A typical integration

Most non-trivial clients combine all three:
  1. REST — with your API key, call GET /user/getMe and GET /games/v2/leagues to bootstrap state.
  2. Streaming WebSocket — open the price feed for the markets you care about and the user feed to react to your own fills / settles.
  3. Orders WebSocket — open a persistent connection and place / cancel orders with low latency, correlating responses by requestID.
  4. REST — fall back to POST /myBets/getMatchedBets, /myBets/getOrdersForGame, etc. for history and reconciliation.

Need the old docs?

The previous documentation lived as a Postman collection. It’s preserved for reference, but these Mintlify docs are now the source of truth — the Postman collection may lag behind for new endpoints, parameters, or response shapes.

4Casters API — Postman collection

View the legacy Postman documentation