WebSockets · Options
Options trades stream
/v1/ws/options/tradeswsOptionsTradesOne 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.
| Parameter | Type and limits | Description |
|---|---|---|
symbolsqueryoptional | array<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_queryoptional | stringcallput | Only calls or only puts. |
sidequeryoptional | array<string>comma-separated in one parameterabove_askat_asknear_askmidnear_bidat_bidbelow_bidunknown1 to 8 items | Only prints classified on these sides of the quote. |
min_queryoptional | integermin 1max 1000000000 | Minimum size in contracts. |
min_queryoptional | numbermin 0max 1000000000000 | Minimum premium in dollars. |
max_queryoptional | numbermin 0max 1000000000000 | Maximum 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.callputdate_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.rthgthcurbnullsidestringrequiredWhere the print sits relative to the quote at the print; unknown when no valid quote was available.above_askat_asknear_askmidnear_bidat_bidbelow_bidunknownsizeintegerrequiredContracts 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).
| 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.