Skip to content

WebSockets · Options

Options trades stream

Every classified option print.
WS/v1/ws/options/tradeswsOptionsTrades
On this page

One event per print, with the quote at the print, the side classification and the contract's implied volatility and delta, delivered the moment the print is classified: no batching, no hold-back of sweep legs. Subscribe by option root (SPX also selects SPXW; use the root to select one) or with * for every print. A cancelled print is not retracted: cancels are not sent on the stream, so a print that is cancelled later stays delivered; reconcile through the REST trades endpoint, which leaves cancelled prints out.

Connect and subscribe

Open wss://api.ordermap.si/v1/ws/options/trades?symbols=SPXW with your key in the Authorization header, then send a subscribe message. Up to 100 symbols per connection, or * as the only subscription. 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/options/trades?symbols=SPXW", {
  headers: { Authorization: `Bearer ${process.env.ORDERMAP_API_KEY}` },
});

ws.on("open", () => ws.send(JSON.stringify({ action: "subscribe", symbols: ["SPXW"], filters: { min_premium: 100000 } })));
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","symbols":["SPXW"],"filters":{"min_premium":100000}}

Subscription parameters

6 parameters, none required. Send them in the query string of the upgrade request, or as the filters of a subscribe message.

ParameterType and limitsDescription
symbolsqueryoptionalarray<string>comma-separated in one parameter1 to 100 itemseach at most 128 characterspattern ^(\*|[A-Za-z][A-Za-z0-9.]{0,9})$Symbols to subscribe to (up to 100). * subscribes to every symbol.
contract_typequeryoptionalstringcallputOnly calls or only puts.
sidequeryoptionalarray<string>comma-separated in one parameterabove_askat_asknear_askmidnear_bidat_bidbelow_bidunknown1 to 8 itemsOnly prints classified on these sides of the quote.
min_sizequeryoptionalintegermin 1max 1000000000Minimum size in contracts.
min_premiumqueryoptionalnumbermin 0max 1000000000000Minimum premium in dollars.
max_premiumqueryoptionalnumbermin 0max 1000000000000Maximum premium in dollars.

Event

Each event is one message: {"type":"event","event_type":"options.trades","seq":N,"data":{...}}.

data of options.trades

  • asknumber | nullrequiredBest ask at the print; null without a valid quote.
  • bidnumber | nullrequiredBest bid at the print; null without a valid quote.
  • conditionsarray<integer>requiredTrade condition codes.
  • contract_typestringrequiredCall or put.callput
  • date_of_expirystringdaterequiredExpiration date.
  • deltanumber | nullrequiredDelta of the contract; null when unknown.
  • exchangeintegerrequiredNumeric id of the executing exchange.
  • exchange_namestringrequiredName of the executing exchange.
  • flagsarray<string>requiredPrint flags: iso, auction, cross, floor, complex, tied, implied, ext_hours, late, aggressor_hint, post_cash_close, vol_gt_oi, size_gt_oi.
  • idstringrequiredPrint id: ROOT:EXPIRY:STRIKE×1000:C|P:EVENT_DATE:SEQUENCE. A single print keeps this id in options.flow and options.unusual.
  • ivnumber | nullrequiredImplied volatility of the contract as a decimal (0.15 = 15%); null when unknown.
  • option_symbolstringrequiredOCC option symbol: root padded to six characters, YYMMDD, C or P and the strike in thousandths as eight digits.
  • premiumnumberrequiredPremium in dollars: price × size × 100.
  • pricenumberrequiredTrade price per contract in dollars.
  • sessionstring | nullrequiredTrading session of the print.rthgthcurbnull
  • sidestringrequiredWhere the print sits relative to the quote at the print; unknown when no valid quote was available.above_askat_asknear_askmidnear_bidat_bidbelow_bidunknown
  • sizeintegerrequiredContracts traded.
  • strikenumberrequiredStrike price in dollars.
  • timestampintegerunix-msrequiredTime of the print. Unix epoch milliseconds (UTC).
  • underlying_pricenumber | nullrequiredPrice of the underlying when the print was classified; null when unknown.
  • underlying_symbolstringrequiredOption root, for example SPXW (the weekly and daily SPX options) or SPY.

Example event

{
  "type": "event",
  "event_type": "options.trades",
  "seq": 1,
  "data": {
    "ask": 12.5,
    "bid": 12.4,
    "conditions": [
      95
    ],
    "contract_type": "call",
    "date_of_expiry": "2026-10-16",
    "delta": 0.5231,
    "exchange": 5,
    "exchange_name": "CBOE",
    "flags": [
      "iso"
    ],
    "id": "SPXW:20261016:5800000:C:20261016:99",
    "iv": 0.1523,
    "option_symbol": "SPXW  261016C05800000",
    "premium": 12500,
    "price": 12.5,
    "session": "rth",
    "side": "at_ask",
    "size": 10,
    "strike": 5800,
    "timestamp": 1792161000123,
    "underlying_price": 5801.27,
    "underlying_symbol": "SPXW"
  }
}

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.