Server-side option flow filters
Filter by symbols, premium, sentiment, expiry, and contract details before the stream reaches your application.
Preparing your API workspace…
Real-time options data API for U.S. equity option trades: WebSocket stream with server-side filters, Greeks, implied volatility, premium, sentiment, and RAW or AGGREGATED modes. Use it for options flow scanners, alerts, and dashboards.
Copy this prompt, paste it into ChatGPT, Claude, Claude Code, Cursor, or Codex, then add your question. It tells the model to read our public docs first — no API key needed for that step.
You are helping me use OptionData (https://www.optiondata.io/), an OPRA-licensed U.S. equity options data API.
Before answering, fetch these public files (no login required) and treat them as the source of truth:
- https://www.optiondata.io/llms.txt — short product map (same content as https://www.optiondata.io/llm.txt)
- https://www.optiondata.io/llms-full.txt — full API reference
- https://www.optiondata.io/openapi.json — HTTP OpenAPI
Do not invent endpoints, fields, tables, or limits. Prefer `Authorization: Bearer apikey_…` for HTTP APIs. Realtime uses `wss://ws.optiondata.io` with a `token` query parameter.
Products:
- Realtime trades WebSocket: wss://ws.optiondata.io
- Historical SQL: POST https://www.optiondata.io/api/historical/sql
- Option chain: POST https://www.optiondata.io/api/option-chain
- Market structure: GET https://www.optiondata.io/api/v1/market-structure/{symbol}
I am asking about: Realtime Option Trades API
- Product / playground page: https://www.optiondata.io/realtime_data/
- Markdown: https://www.optiondata.io/md/realtime-option-trades-api/
- HTML docs: https://www.optiondata.io/docs/realtime-option-trades-api/
My question:
Filter by symbols, premium, sentiment, expiry, and contract details before the stream reaches your application.
Every qualifying print can include Greeks, implied volatility, premium, and side context. See the realtime docs for the current field list.
Use one signed API key for realtime flow monitors, customer-facing dashboards, alerts, and internal trading tools.
Realtime option trades API reference
Yes. The realtime API streams U.S. option trades over WebSocket during market hours, with sample responses available for evaluation and docs review.
Yes. You can apply server-side filters such as symbol, premium, expiry, sentiment, and mode so clients receive only relevant option flow.
AGGREGATED mode consolidates same-instant, same-contract prints into cleaner events. RAW mode keeps the original trade prints.
Connect to wss://ws.optiondata.io with your API token (cus_… or apikey_…). During U.S. equity options hours the server streams OPRA-licensed trade prints; after the close the socket stays open with heartbeats and resumes automatically next session.
Filter server-side with query params: symbols, premium ranges, put_call, delta, expiry_days, sentiment, side, aggregation_mode (RAW or AGGREGATED), and more. AGGREGATED collapses same-second, same-contract prints for block/sweep visibility; RAW is one message per exchange print.
Each trade can carry 30+ fields including premium, size, Greeks, IV, open interest context, and side. Use test_mode=true for filter validation without live market data. The field list is in the realtime docs, not on this page.
import WebSocket from 'ws';
const ws = new WebSocket(
'wss://ws.optiondata.io?token=YOUR_API_KEY&symbols=AAPL,SPY&premium=[100000,null]&aggregation_mode=AGGREGATED'
);
ws.on('message', (raw) => {
const trade = JSON.parse(raw.toString());
console.log(trade.symbol, trade.premium, trade.delta);
});Field names, types, filters, limits, and error codes live in the public API reference. This product page does not keep a second copy of the schema.