Skip to content
OptionData
50% Off First Year
Save 50% on your first year after a 14-day free trial. Create an account to begin; an invitation is required to qualify. Contact Sales for the promotion code, then apply it on Billing.

Realtime Option Trades API

Preparing your API workspace…

API overview and examples
Real-time options data API

Real-Time Options Data API over WebSocket

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.

real time options dataoptions data apioptions flow apioptions market datastock options api

Ask ChatGPT or Claude Code

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:

Server-side option flow filters

Filter by symbols, premium, sentiment, expiry, and contract details before the stream reaches your application.

Trade-level Greeks and IV

Every qualifying print can include Greeks, implied volatility, premium, and side context. See the realtime docs for the current field list.

One key for live products

Use one signed API key for realtime flow monitors, customer-facing dashboards, alerts, and internal trading tools.

Best for

  • Unusual options activity scanners
  • Real-time options flow dashboards
  • Premium and sweep alerts
  • Intraday quant research pipelines

Common API questions

Realtime option trades API reference

Does OptionData provide real-time options data?

Yes. The realtime API streams U.S. option trades over WebSocket during market hours, with sample responses available for evaluation and docs review.

Can I filter the options stream before receiving data?

Yes. You can apply server-side filters such as symbol, premium, expiry, sentiment, and mode so clients receive only relevant option flow.

What is AGGREGATED mode?

AGGREGATED mode consolidates same-instant, same-contract prints into cleaner events. RAW mode keeps the original trade prints.

How the realtime WebSocket works

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.

Realtime option trades API reference → · All API docs

Example: stream large AAPL and SPY premium
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);
});

Request and response schema

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.

Realtime option trades API reference →