Skip to main content
The 4casters Orders API supports real-time order placement, cancellation, and session management over a raw WebSocket connection.

Endpoints

  • Orders API: wss://orders-api.4casters.io/orders/ws

Auth

The connection authenticates with a 4casters credential in the Authorization header on the WebSocket handshake: an API key (create one on your account page; the right choice for a program) or a login token from POST /user/login. The server derives the user from the credential — no username in the URL. A refused credential fails the handshake with a 401 or 403; see Authentication.

Connect

Message format

Every client request is a 2-tuple [messageType, payload]. Every payload should include a requestID that you generate; the server echoes it back so you can correlate responses.
Server responses are JSON objects with requestID plus either data (success) or error (failure):

Rate limits

Placing orders is limited per account, shared with REST. Enforced from 2026-11-02. Over the limit, you get error_type rate_limited with retryAfterMs, and the connection stays open. Cancels and heartbeats are never limited. See Rate limiting.