Skip to content

WebSockets · Analytics

Analytics snapshots stream

Snapshots of streamable endpoints.
WS/v1/ws/analyticswsAnalytics
On this page

Subscribe 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"
  }
}
EndpointReturns
/v1/options/contractsContracts of an underlying: those listed now, or those quoted on a past date.
/v1/options/chainThe option chain: quotes, day statistics, open interest and Greeks of every contract.
/v1/options/flow/by-expirationCall and put premium, volume and net flow for each expiration.
/v1/options/flow/by-strikeCall and put premium and volume at every strike, by aggressor class.
/v1/options/flow/exchangesMarket share of option premium, volume and trades by exchange.
/v1/options/flow/leadersUnderlyings or contracts leading option flow: top premium, bullish, bearish and movers.
/v1/options/flow/net-driftNet call and put premium per bucket and cumulatively over the session.
/v1/options/flow/net-flowNet premium or net volume per bucket for calls, puts and overall.
/v1/options/flow/overnightOvernight (global trading hours) option prints.
/v1/options/flow/premium-driftCumulative signed premium of calls, puts and net sentiment over the session.
/v1/options/flow/put-call-ratioPut/call volume and premium ratios per bucket and cumulatively.
/v1/options/flow/statsPremium, volume and trades of a filtered option print set, by contract type and aggressor side.
/v1/options/flow/strike-activityExecuted premium and trade counts per strike (SPX and SPXW).
/v1/options/exposure/by-expirationModeled dealer gamma, delta, vanna or charm exposure by expiration.
/v1/options/exposure/by-strikeModeled dealer gamma, delta, vanna or charm exposure by strike.
/v1/options/exposure/forecastModeled levels repriced at intraday horizons with a statistical cone.
/v1/options/exposure/heatmapStrike by expiration grid of modeled exposure, open interest or flow.
/v1/options/exposure/intervalsModeled exposure by strike at every interval of a session.
/v1/options/exposure/profileModeled exposure repriced over a sweep of underlying prices, with zero crossings.
/v1/options/exposure/surfaceDense strike by expiration surface of net modeled exposure for 3D views.
/v1/options/levelsKey levels of the modeled dealer exposure: walls, gamma flip, largest cell, max pain, expected move.
/v1/options/market-mapModeled exposure and executed flow by strike for SPX and SPXW.
/v1/options/open-interestOpen interest by strike or by expiration.
/v1/options/volatility/driftIntraday implied volatility against adjusted realized volatility.
/v1/options/volatility/skewImplied volatility smile by strike and delta, with risk reversals and butterflies.
/v1/options/volatility/surfaceImplied volatility surface by strike and expiration.
/v1/options/volatility/surface-sliceOne strike across expirations, or one expiration across strikes, of the volatility surface.
/v1/options/volatility/term-structureAt-the-money implied volatility by expiration, constant-maturity points and forward volatilities.
/v1/futures/bookThe current displayed depth of a futures contract.
/v1/futures/liquiditySpread and displayed liquidity of a futures contract.
/v1/futures/snapshotLast trade, top of book and session OHLCV of a futures contract.
/v1/futures/cvdCumulative volume delta of a futures session.
/v1/futures/delta-barsBuy, sell and net volume per bar.
/v1/futures/footprintFootprint bars: volume by price inside each bar, with imbalances.
/v1/futures/order-flowAggregated futures prints (order-flow bubbles) for a window.
/v1/futures/session-profileVolume profile of the whole current trading session (POC, VAH, VAL).
/v1/futures/volume-profileVolume by price for a window, with point of control and value area.
/v1/indices/snapshotCurrent value and session range of up to 50 indices.
/v1/indices/basis/snapshotLive basis, fair value and premium of up to 10 indices.
/v1/stocks/moversTop 20 gainers or losers of the day.
/v1/stocks/snapshotCurrent-day snapshot of up to 50 stocks.
/v1/market/overviewOne-call picture of the market: indexes, futures, volatility and breadth.
/v1/market/statusTrading 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).

StatusMeaningBody
101Switching protocols: WebSocket protocol ordermap.v1.Switching protocols
400Invalid handshake parameters.Error object
401Missing or invalid API key (Authorization, X-API-Key or, from a browser, the ordermap.key. subprotocol).Error object
403The plan has no streaming (streaming_not_in_plan), the dataset is not released, or the account is suspended.Error object
409stream_connection_limit: one live connection per account per event type.Retry-AfterError object
426The request is not a WebSocket upgrade.Error object
429Rate limit or WebSocket cooldown.Retry-AfterError object
503stream_unavailable: the stream is not enabled or its source is down; retry after Retry-After seconds.Retry-AfterError object

Authenticated responses carry the X-RateLimit-* headers (see rate limits); 429 and 503 add Retry-After.