Skip to content
PROBORA

WebSockets

WebSocket feed

Receive predictions, consensus updates and settlements the moment they happen.

Coming Soon

Coming soon

The WebSocket feed is in development. This reference describes the v1 protocol so you can build against it today; it will be available on the Trader plan and above. Until launch, poll the REST endpoints once per window.

Endpoint

WebSocket URL
wss://api.probora.xyz/v1/signals

One connection can subscribe to many channels. Concurrent connections are limited by plan: Trader 1 · API 5 · Enterprise custom.

Authentication

Authenticate with the same secret key you use for REST, in one of two ways:

  • Server-side clients (recommended): send Authorization: Bearer prb_live_… in the HTTP upgrade request.
  • First message: connect, then send an auth operation before anything else. The connection closes if no valid auth arrives within 5 seconds.
Client → server
{
  "op": "auth",
  "api_key": "prb_live_…"
}

Avoid keys in URLs

A ?token= query parameter is accepted for constrained environments but is discouraged: URLs end up in logs, proxies and browser history. Never connect from a browser with a secret key. Relay events through your backend instead.

Subscribing to channels

Client → server
{
  "op": "subscribe",
  "channels": [
    "signals:BTC:15m",
    "markets:BTC:15m"
  ]
}
Server → client
{
  "type": "subscribed",
  "channels": [
    "signals:BTC:15m",
    "markets:BTC:15m"
  ]
}

Unsubscribe with {"op":"unsubscribe","channels":[…]}. Subscribing to a channel you already follow is a no-op, so it is safe to resend your full subscription list after reconnecting.

Channels

ChannelEventsDescription
signals:{asset}:{timeframe}prediction.published, consensus.updatedPredictions for one market, e.g. signals:BTC:15m
markets:{asset}:{timeframe}market.opened, market.settledWindow lifecycle, e.g. markets:ETH:1h
index:{asset}index.tickProbora Price Index updates, at most one per second

Event envelope

FieldTypeDescription
typestringEvent type, e.g. prediction.published.
idstringUnique, ordered event id. Keep the latest one to resume after a disconnect.
channelstringChannel the event was published on.
tsstringServer timestamp (ISO-8601, UTC).
dataobjectEvent payload, using the same field names as the REST API.

Client examples

import WebSocket from "ws";

const ws = new WebSocket("wss://api.probora.xyz/v1/signals", {
  headers: { Authorization: `Bearer ${process.env.PROBORA_API_KEY}` },
});

ws.on("open", () => {
  ws.send(JSON.stringify({ op: "subscribe", channels: ["signals:BTC:15m", "markets:BTC:15m"] }));
});

ws.on("message", (raw) => {
  const event = JSON.parse(raw.toString());
  if (event.type === "prediction.published") {
    const { agent_slug, direction, up_probability } = event.data;
    console.log(agent_slug, direction, up_probability);
  }
});

Production clients should also handle heartbeats and reconnection. See Reconnection.

Questions or feedback on the API? [email protected]