Skip to main content
Futuur delivers realtime data over its own WebSocket gateway: prices, order books, market status, comments, and your own balance, orders, and positions. Connect to:
The gateway speaks plain WebSocket with JSON text frames. You need no client library beyond a standard WebSocket client. Every message carries a sequence number, so you know when you missed an update and can resume after a reconnect. When you subscribe, you get a snapshot of the latest state, then updates.
Pusher is deprecated. Pusher keeps working unchanged until 2027-03-18. On that date Futuur stops delivering realtime data to API users through Pusher. After 2027-03-18 only the gateway delivers realtime data. If you use Pusher today, see Migrating from Pusher and move to the gateway before that date.
The gateway serves production (https://api.futuur.com). Channels and events are listed in Channels and events. Private channels need a token: see Authorization.

Connect

Open a WebSocket connection to wss://realtime.futuur.com/v1. Public channels need no key and no headers. All frames in both directions are text frames carrying one JSON object. A binary frame, a frame that is not valid JSON, or a frame that is not a JSON object closes the connection with code 4000. The server sends a WebSocket ping every 25 seconds and closes a connection that has not answered with a pong for 60 seconds. Standard WebSocket clients, including the browser WebSocket, Python websockets, and Node.js, answer pings automatically. You can also send the application-level {"op":"ping"} and get a pong back.

Client to server

Server to client

data is shortened to {} here. It carries the full payload of the event. A message has the same fields in a message frame and inside a snapshot:
Sequence numbers are per channel. The same update published on event and on event-{event_id} has a different seq on each channel. Track one seq per channel.

Snapshot on subscribe

A fresh subscribe (no since) answers with subscribed, then a snapshot, then live message frames. The snapshot holds the latest message of each state event, each with its own seq: Apply the snapshot messages like normal messages. The other events (new-comment, new-market, order-update, position-update, deposit-success) are never in a snapshot: you only get them live. The event channel always has an empty snapshot. The snapshot is a convenience, not a guarantee. It holds what was published in the last 24 hours and can be empty or partial, for example on a quiet event. For the authoritative state, use the REST API.

Resume with since

After a reconnect, subscribe to each channel again with since set to the last seq you processed on it.
  • If the server still holds every message after since, you get subscribed, then the missed messages as message frames, then live messages.
  • If it does not, you get subscribed followed by reset.
  • If since is equal to the latest seq, you get subscribed and nothing to replay.
The server keeps the most recent 500 messages of a channel for about 15 minutes. If you missed more than that, or since is higher than the channel’s latest seq, you get reset.

Reset: refetch over REST

reset means you may have missed messages that cannot be replayed. Reload the current state of that channel over the REST API (for example GET /events/{id}/ or GET /markets/{id}/book/), set your last seq for the channel to the seq in the reset, and continue with the messages that follow. reset also arrives without a request from you, for example when the gateway lost its own connection to the data source for a moment. Handle it at any time, not only after a subscribe.

Gaps

Keep the last seq per channel. If a message arrives with a seq other than your last seq + 1, you missed something. Subscribe to the channel again with since set to your last seq: you get the missed messages, or a reset if they are no longer available. Ignore a message whose seq is not higher than the last one you processed. A gap can also be real. If Futuur could not publish a message, the next message skips one number. Subscribing again with since then gives you a reset. Subscribing again to a channel you are already subscribed to is allowed and counts as one subscription. You do not need a new token for a private channel on the same connection.

Unsubscribe and ping

The replies are unsubscribed and pong, with the same id if you sent one.

Errors

An error frame has a code and a human-readable message. The connection stays open.

Close codes

Reconnect after a close or a network error with a jittered back-off, starting at 0.5 seconds and growing to 30 seconds, then resume with since. Reset the back-off once a subscribe succeeds.

Limits

The limits can change. Handle the error codes and close codes above instead of relying on the numbers. If you are closed with 4008, read faster or subscribe to fewer channels: prefer event-{event_id} for the events you trade over the global event channel, which carries the activity of every event.

Examples

The examples are complete scripts. They resume after a reconnect with since, detect gaps, and handle reset. For a private channel, see the example in Authorization.
The Python example uses the websockets library, version 14 or later (pip install websockets). Run it with channel names as arguments, for example python futuur_realtime.py event-123. Without arguments it subscribes to event. The JavaScript example runs in a browser and in Node.js 22 or later, which both have a global WebSocket. Do not put your private key in a browser: use it for public channels there, and request private-channel tokens from your own server.

Migrating from Pusher

Pusher is deprecated. Futuur stops delivering realtime data to API users through Pusher on 2027-03-18. Until then Pusher keeps working unchanged, so you can move at your own pace and run both side by side. After 2027-03-18 only the gateway delivers realtime data.

What stays the same

  • Channel names: event, event-{event_id}, and private-user-{user_id}.
  • Event names: best-prices-change, price-change, new-market, live-data-update, market-status-change, new-comment, order-book-update, balance-change, deposit-success, order-update, and position-update.
  • Payloads: the data of a gateway message is the payload Pusher delivered, field for field.
  • Who can subscribe to what: public channels need no authentication, and you can only subscribe to your own private-user-{user_id} channel.

What changes

Steps

1

Connect with a WebSocket

Replace the Pusher client with a WebSocket connection to wss://realtime.futuur.com/v1.
2

Subscribe to your channels

Send a subscribe operation for each channel you used with pusher.subscribe(...).
3

Replace the event bindings

Replace each channel.bind(eventName, callback) with a check on frame.event and a call with frame.data.
4

Move private channels to tokens

Request a token from POST /v2.0/realtime/auth/ and send it as auth in subscribe. Keep signing on your server. See Authorization.
5

Track sequence numbers

Track the last seq per channel. On a gap, resubscribe with since. On reset, refetch the state over REST. After a reconnect, resubscribe with since.
6

Follow only the events you need

Subscribe to event-{event_id} for the events you follow instead of the global event channel. price-change, new-market, live-data-update, and new-comment are now also published there.
7

Remove Pusher

Remove the Pusher client before 2027-03-18.

Pusher (deprecated)

Pusher delivery to API users ends on 2027-03-18. Use the gateway described above.
Until 2027-03-18, Pusher keeps delivering the same channels, events, and payloads. This section is kept for integrations that have not moved yet. For private channels, see the deprecated Pusher authorization in Authorization. Include the Pusher JS client:
Initialize Pusher and subscribe to a channel:

Next steps