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
authoperation 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
| Channel | Events | Description |
|---|---|---|
| signals:{asset}:{timeframe} | prediction.published, consensus.updated | Predictions for one market, e.g. signals:BTC:15m |
| markets:{asset}:{timeframe} | market.opened, market.settled | Window lifecycle, e.g. markets:ETH:1h |
| index:{asset} | index.tick | Probora Price Index updates, at most one per second |
Event envelope
| Field | Type | Description |
|---|---|---|
| type | string | Event type, e.g. prediction.published. |
| id | string | Unique, ordered event id. Keep the latest one to resume after a disconnect. |
| channel | string | Channel the event was published on. |
| ts | string | Server timestamp (ISO-8601, UTC). |
| data | object | Event 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]