WebSockets · Options
Options flow stream
/v1/ws/options/flowwsOptionsFlowFinalized consolidated trades: sweeps and splits (several prints of one contract close together) and block prints. Subscribe by option root (SPX also selects SPXW). Every event is a finalized group (or a single block or unusual print); it is sent the moment the group closes.
Connect and subscribe
Open wss://api.ordermap.si/v1/ws/options/flow?symbols=SPXW with your key in the Authorization header, then send a subscribe message. Up to 100 symbols per connection. 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/flow?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
10 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). |
contract_queryoptional | stringcallput | Only calls or only puts. |
sidequeryoptional | array<string>comma-separated in one parameterabove_askaskmidbidbelow_bidunknown1 to 6 items | Only orders on these sides of the quote (the classes of GET /v1/options/flow: ask is at or near the ask, bid at or near the bid). |
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. |
trade_queryoptional | array<string>comma-separated in one parametersweepblocksplitsinglegolden1 to 5 items | Only these consolidated trade types. |
sentimentqueryoptional | array<string>comma-separated in one parameterbullishbearishneutralunknown1 to 4 items | Only this sentiment. |
min_queryoptional | integermin 0max 3650 | Minimum days to expiry. |
max_queryoptional | integermin 0max 3650 | Maximum days to expiry. |
Event
Each event is one message: {"type":"event","event_type":"options.flow","seq":N,"data":{...}}.
data of options.flow
blockbooleanrequiredThe trade meets the block rule (100 contracts and $50,000, or $250,000).contract_typestringrequiredCall or put.callputdate_of_expirystringdaterequiredExpiration date.deltanumber | nullrequiredDelta of the contract; null when unknown.dteintegerrequiredCalendar days to expiry.exchangesintegerrequiredDistinct exchanges involved.first_timestampintegerunix-msrequiredTime of the first leg. Unix epoch milliseconds (UTC).flagsarray<string>requiredFlags of the legs: iso, auction, cross, floor, complex, vol_gt_oi, size_gt_oi, ….goldenbooleanrequiredA sweep with a premium of $1,000,000 or more.idstringrequiredGroup id (ROOT:TRADING_DATE:N), or the print id of a single print.ivnumber | nullrequiredImplied volatility of the contract as a decimal; null when unknown.legsintegerrequiredPrints that make up the trade.option_symbolstringrequiredOCC option symbol: root padded to six characters, YYMMDD, C or P and the strike in thousandths as eight digits.otm_pctnumber | nullrequiredPercent out of the money (negative when in the money); null when unknown.premiumnumberrequiredTotal premium in dollars.pricenumberrequiredVolume-weighted average price per contract in dollars.sentimentstringrequiredBullish for bought calls and sold puts, bearish for the mirror, neutral at the mid.bullishbearishneutralunknownsessionstring | nullrequiredTrading session.rthgthcurbnullsidestringrequiredMost aggressive side of the legs relative to the quote, in the classes of GET /v1/options/flow: ask is at or near the ask, bid at or near the bid.above_askaskmidbidbelow_bidunknownsizeintegerrequiredTotal contracts.strikenumberrequiredStrike price in dollars.timestampintegerunix-msrequiredTime of the last leg. Unix epoch milliseconds (UTC).trade_typestringrequiredConsolidated trade type: golden is a sweep of $1,000,000 or more; block is a large print or group; single is a lone unusual print.sweepblocksplitsinglegoldenunderlying_pricenumber | nullrequiredUnderlying price when the trade closed; null when unknown.underlying_symbolstringrequiredOption root, for example SPXW (the weekly and daily SPX options) or SPY.unusualbooleanrequiredThe trade meets the unusual-activity rule.
Example event
{
"type": "event",
"event_type": "options.flow",
"seq": 1,
"data": {
"block": false,
"contract_type": "call",
"date_of_expiry": "2026-10-16",
"delta": 0.5,
"dte": 0,
"exchanges": 3,
"first_timestamp": 1792161000120,
"flags": [
"iso"
],
"golden": false,
"id": "SPXW:20261016:12",
"iv": 0.15,
"legs": 4,
"option_symbol": "SPXW 261016C05800000",
"otm_pct": -0.02,
"premium": 161750,
"price": 2.1567,
"sentiment": "bullish",
"session": "rth",
"side": "above_ask",
"size": 750,
"strike": 5800,
"timestamp": 1792161000124,
"trade_type": "sweep",
"underlying_price": 5801.25,
"underlying_symbol": "SPXW",
"unusual": false
}
}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.