WebSockets · Analytics
Analytics snapshots stream
/v1/ws/analyticswsAnalyticsSubscribe to any endpoint flagged streamable in GET /v1/catalog with the same query parameters as its REST route. Whenever the data of a subscribed endpoint changes the server sends its complete response (never a delta). Each subscription is refreshed at most once per the endpoint's minimum interval (interval_ms in the subscribed message). Client messages: {action: subscribe, id, route, params, interval_ms} and {action: unsubscribe, id}. The number of subscriptions is limited by the plan, and an account's subscriptions together may refresh at most 10 times a second (choose a longer interval_ms to fit more of them). Subscriptions to the same endpoint and parameters share one refresh. A paginated endpoint streams its first page: has_more is reported, next_cursor_id and next_url are null (page through REST). Under heavy load a refresh can be skipped and retried about one interval later, so a snapshot may arrive late; after several skipped refreshes in a row the server sends {type: status, state: degraded, reason: refresh_delayed, id}, and {state: live} when refreshes resume. Load never produces an error message.
Connect and subscribe
Open wss://api.ordermap.si/v1/ws/analytics with your key in the Authorization header, then send a subscribe message. One connection per account per stream; streams need API Pro. The protocol, limits and close codes are in WebSockets.
Node.js
import WebSocket from "ws";
const ws = new WebSocket("wss://api.ordermap.si/v1/ws/analytics", {
headers: { Authorization: `Bearer ${process.env.ORDERMAP_API_KEY}` },
});
ws.on("open", () => ws.send(JSON.stringify({ action: "subscribe", id: "levels", route: "/v1/options/levels", params: { underlying_symbol: "SPX" }, interval_ms: 5000 })));
ws.on("message", (raw) => {
const message = JSON.parse(raw.toString());
if (message.type === "event") console.log(message.seq, message.data);
if (message.type === "gap") console.warn("continuity lost: refetch the range over REST", message);
});
ws.on("close", (code, reason) => console.log("closed", code, reason.toString()));Subscribe message
{"action":"subscribe","id":"levels","route":"/v1/options/levels","params":{"underlying_symbol":"SPX"},"interval_ms":5000}Subscription parameters
This stream takes no parameters. Subscribe with a message after connecting.
Event
Each event is one message: {"type":"event","event_type":"analytics","seq":N,"data":{...}}.
data of analytics
idstringrequiredSubscription id chosen by the client.responseobjectrequiredThe endpoint's response envelope: data and meta.resyncbooleanrequiredTrue on the first snapshot after subscribing.revisionstringrequiredIncreases by one with every change of the data of this subscription.routestringrequiredEndpoint path.
Example event
{
"type": "event",
"event_type": "analytics",
"seq": 1,
"data": {
"id": "levels",
"response": {
"data": {},
"meta": {
"as_of": 1792161000123,
"coverage": {
"complete": true
},
"delay_ms": 0,
"delayed": false,
"request_id": "0198c0a2-0000-7000-8000-000000000000",
"source": "opra"
}
},
"resync": false,
"revision": "3",
"route": "/v1/options/levels"
}
}| Endpoint | Returns |
|---|---|
| / | Contracts of an underlying: those listed now, or those quoted on a past date. |
| / | The option chain: quotes, day statistics, open interest and Greeks of every contract. |
| / | Call and put premium, volume and net flow for each expiration. |
| / | Call and put premium and volume at every strike, by aggressor class. |
| / | Market share of option premium, volume and trades by exchange. |
| / | Underlyings or contracts leading option flow: top premium, bullish, bearish and movers. |
| / | Net call and put premium per bucket and cumulatively over the session. |
| / | Net premium or net volume per bucket for calls, puts and overall. |
| / | Overnight (global trading hours) option prints. |
| / | Cumulative signed premium of calls, puts and net sentiment over the session. |
| / | Put/call volume and premium ratios per bucket and cumulatively. |
| / | Premium, volume and trades of a filtered option print set, by contract type and aggressor side. |
| / | Executed premium and trade counts per strike (SPX and SPXW). |
| / | Modeled dealer gamma, delta, vanna or charm exposure by expiration. |
| / | Modeled dealer gamma, delta, vanna or charm exposure by strike. |
| / | Modeled levels repriced at intraday horizons with a statistical cone. |
| / | Strike by expiration grid of modeled exposure, open interest or flow. |
| / | Modeled exposure by strike at every interval of a session. |
| / | Modeled exposure repriced over a sweep of underlying prices, with zero crossings. |
| / | Dense strike by expiration surface of net modeled exposure for 3D views. |
| / | Key levels of the modeled dealer exposure: walls, gamma flip, largest cell, max pain, expected move. |
| / | Modeled exposure and executed flow by strike for SPX and SPXW. |
| / | Open interest by strike or by expiration. |
| / | Intraday implied volatility against adjusted realized volatility. |
| / | Implied volatility smile by strike and delta, with risk reversals and butterflies. |
| / | Implied volatility surface by strike and expiration. |
| / | One strike across expirations, or one expiration across strikes, of the volatility surface. |
| / | At-the-money implied volatility by expiration, constant-maturity points and forward volatilities. |
| / | The current displayed depth of a futures contract. |
| / | Spread and displayed liquidity of a futures contract. |
| / | Last trade, top of book and session OHLCV of a futures contract. |
| / | Cumulative volume delta of a futures session. |
| / | Buy, sell and net volume per bar. |
| / | Footprint bars: volume by price inside each bar, with imbalances. |
| / | Aggregated futures prints (order-flow bubbles) for a window. |
| / | Volume profile of the whole current trading session (POC, VAH, VAL). |
| / | Volume by price for a window, with point of control and value area. |
| / | Current value and session range of up to 50 indices. |
| / | Live basis, fair value and premium of up to 10 indices. |
| / | Top 20 gainers or losers of the day. |
| / | Current-day snapshot of up to 50 stocks. |
| / | One-call picture of the market: indexes, futures, volatility and breadth. |
| / | Trading state of the US equity market and health of the data areas. |
Before the upgrade
Errors before the upgrade are ordinary JSON errors; after it, problems arrive as messages and close codes (see WebSockets).
| Status | Meaning | Body |
|---|---|---|
101 | Switching protocols: WebSocket protocol ordermap.v1. | Switching protocols |
400 | Invalid handshake parameters. | Error object |
401 | Missing or invalid API key (Authorization, X-API-Key or, from a browser, the ordermap.key. subprotocol). | Error object |
403 | The plan has no streaming (streaming_not_in_plan), the dataset is not released, or the account is suspended. | Error object |
409 | stream_connection_limit: one live connection per account per event type.Retry-After | Error object |
426 | The request is not a WebSocket upgrade. | Error object |
429 | Rate limit or WebSocket cooldown.Retry-After | Error object |
503 | stream_unavailable: the stream is not enabled or its source is down; retry after Retry-After seconds.Retry-After | Error object |
Authenticated responses carry the X-RateLimit-* headers (see rate limits); 429 and 503 add Retry-After.