Get 50% off on all plans for the first year – contact sales for a promotional code.

Real-time Option Data API

Stream live option trades and market data via WebSocket

Real-time Access

WebSocket Data API

$599/ month
Real-time WebSocket data streaming
Advanced filtering & sentiment analysis
Option Greeks & market analytics
14-day free trial included
Technical support included

14-day free trial • 30-day money-back guarantee

Click to apply preset filters

WebSocket Demo

Disconnected

Connect to stream live option trades for 60 seconds. Requires an active subscription and market hours (9:30 AM – 4:00 PM ET). Enable Test mode for sample data anytime.

Off
-
WSSwss://ws.optiondata.io?aggregation_mode=AGGREGATED
iddatesizepricepremiumbidasktimesymbolput_callstrikeexpiration_dateunderlying_typeoption_activity_typeoiunderlying_pricesentimentexpiry_dayssidemoneynessivdeltaoption_symbolgammadaily_volumeearning_datetrade_countupdated_timestampmarket_cap

Not Connected

Click Connect to start receiving live data

Showing 0 of max 100 trades

Realtime Option Data API

Request

WEBSOCKET
wss://ws.optiondata.io

Parameters

NameExampleRequired?Description
token
cus_xxxxxxxxxx(Get Your API token here: optiondata.io)
RequiredGet API token here: https://optiondata.io
aggregation_modeAGGREGATED or RAWOptional field, default value is AGGREGATED if leave blankDetermine how the option trades are aggregated by our algorithm. In AGGREGATED mode, the modified real-time feed combines option trades executed simultaneously for the same option symbol. In contrast, RAW mode keep the option trades in their original form without any modifications. For more details, more details.
symbolsSPY,TSLA,SPX or AAPLOptional field, leave it blank means no filteringA list of symbols in upper case separated by comma. Using the * wildcard or don't provide it to subscribe to all symbols.
premium
[100000,250000]//min premium is $100000, max premium is 250000[100,null]//min premium is $100, no max limit
Optional field, leave it blank means no filteringThe filter for minimum premium. The first value represents the minimum premium, while the second value indicates the maximum premium. If not provided, [0,null] will be the default value.
sentimentBULLISH,BEARISH,NEUTRAL OR BULLISHOptional field, leave it blank means no filteringThe filter for sentiment includes potential values of BULLISH, BEARISH, and NEUTRAL. You can combine multiple selections by separating them with commas, such as NEUTRAL,BEARISH.
underlying_typeSTOCK,ETF,INDEX or STOCK or ETF or INDEXOptional field, leave it blank means no filteringThe filter for underlying_type includes potential values of INDEX, STOCK, and ETF. You can combine multiple selections by separating them with commas, such as INDEX,STOCK.
delta[-0.9,0.98] or [-1,0.9]Optional field, leave it blank means no filteringThe filter for delta has a default range of [-1, 1]. The first value represents the minimum delta, while the second value indicates the maximum delta. The range must remain within [-1, 1]
moneynessITM,OTM,ATM or ITMOptional field, leave it blank means no filteringThe filter for moneyness includes potential values of ITM, ATM, and OTM. You can combine multiple selections by separating them with commas, such as ITM,OTM.
expiry_days
[15,20]// minimum expiry days is 15, maximum expiry day is 20 days[0,null] // // minimum expiry days is 15, no maximum expiry days[null,30] // minimum expiry days is 0, maximum expiry day is 30 days
Optional field, leave it blank means no filteringThe days remaining until the expiration date. The first number represents the minimum expiration days, with a default value of 0 if null is provided. The second number is the maximum expiration days; if null is provided, there is no limit.
is_recent_earning_onlytrueOptional field, leave it blank means no filteringOnly trades on stocks with upcoming earnings.
AGGREGATED MODE only
put_callCALL , or PUTOptional field, leave it blank means no filteringFilter to identify whether this option trade is PUT or CALL
sideASK,AASK or ASK,BIDOptional field, leave it blank means no filteringPrice side of the trade. Values: AASK (above ask), ASK, MID, BID, BBID (below bid). Comma-separated for multiple.
strike
[15.5,20]// minimum strike price is $15.5, maximum strike price is $20[0,null] // // minimum expiry days is $0, no maximum limit on strike price.[null,30] // minimum strike price is $0, maximum strike price is $30.
Optional field, leave it blank means no filteringIdentity the range of the Strike price of the option trade. The first number represents the minimum strike price, with a default value of 0 if null is provided. The second number is the maximum strike price. if null is provided, there is no limit at the maximium strike price. default value is [0,null] with minimum strike price is $0, and no limit on the maximum strike price.
oi
[155,2000]// minimum open interest is 155, maximum open interest is 200[0,null] // // minimum open interest is 0, no maximum limit on open interest.[null,300] // minimum open interest is 0, maximum open interest is 300.
Optional field, leave it blank means no filteringThe total number of this options contract that are still open. The first number represents the minimum OI, with a default value of 0 if null is provided. The second number is the maximum OI. if null is provided, there is no limit at the maximium OI. default value is [0,null] with minimum OI is 0, and no limit on the maximum OI.
iv
[0.1,1.1]// minimum iv is 0.1, maximum iv is 1.1[0,null] // // minimum iv is 0, no maximum limit.[null,1.1] // minimum iv is 0, maximum iv is 1.1
Optional field, leave it blank means no filteringImplied Volatility which reflects the market's expectations of the future volatility of the underlying asset's price. The first number represents the minimum IV, with a default value of 0 if null is provided. The second number is the maximum IV. if null is provided, there is no limit at the maximium IV. default value is [0,null] with minimum IV is 0, and no limit on the maximum IV.
option_activity_type
AUTO // single choiceAUTO,SLAN,SLAI// multiple choices
Optional field, leave it blank means no filteringOPRA trade condition code. Values: AUTO (AutoExecution), SLAN (SingleLegAuctionNonISO), MLET (MultiLegAutoEx), MLAT (MultiLegAuction), ISOI (IntermarketSweep), MESL (MultiLegAutoSingleLeg), TLET (StockOptionAutoEx), SLFT (SingleLegFloor), MLFT (MultiLegFloor), CBMO (MultiLegFloorPropProduct).
AGGREGATED MODE only
trade_count
[1,1]//only block trads[2,null]//only aggregated trades[2,10]// aggregated trades that aggregates 2 to 10 trades
Optional field, leave it blank means no filteringNumber of trades involved in the sweep or trade. Use [1,1] to filter for block trades only, and [2,null] to filter for aggregated trades. In RAW mode, this is always 1.
is_opening_onlytrueOptional field, leave it blank means no filteringOnly opening trades (2 × size >= OI + daily volume).
AGGREGATED MODE only
size
[155,2000]// minimum size is 155, maximum open interest is 200[0,null] // // minimum size is 0, no maximum limit on size.[null,300] // minimum size is 0, maximum size is 300.
Optional field, leave it blank means no filteringFilter for the total order size. The first number represents the minimum size, with a default value of 0 if null is provided. The second number is the maximum size if null is provided, there is no limit at the maximium size. default value is [0,null] with minimum size is 0, and no limit on the maximum size.
dex
[100,500][1000,null]
Optional field, leave it blank means no filteringThe filter for Delta Exposure (DEX). The first value represents the minimum dex, while the second value indicates the maximum dex. If not provided, default is no filtering.
dei
[0.1,0.5]
Optional field, leave it blank means no filteringThe filter for Delta Impact (DEI). The first value represents the minimum dei, while the second value indicates the maximum dei. If not provided, default is no filtering.
test_modetrueOptionalEnable test snapshot mode: server sends pre-loaded sample data and then closes the connection. No authentication required. Use to validate filters and client parsing before going live.

Sample Code

// Some code
import WebSocket from 'ws';

const url = "wss://ws.optiondata.io?symbols=AAPL,SPX&token=cus_xxxx&premium=[300000,null]";

// Create a new WebSocket instance
const ws = new WebSocket(url);

// Event handler for connection open
ws.on('open', function open() {
  console.log('WebSocket connection opened');
});

// Event handler for incoming messages
ws.on('message', function incoming(data) {
  console.log('Received message:', data);
  // You can parse and handle the data here
  try {
    const receivedData = JSON.parse(data.toString());
    console.log('Parsed data:', receivedData);
    // Further processing of receivedData
  } catch (error) {
    console.error('Error parsing received data:', error);
  }
});

// Event handler for connection close
ws.on('close', function close() {
  console.log('WebSocket connection closed');
});

// Event handler for errors
ws.on('error', function error(err) {
  console.error('WebSocket error:', err);
});

Response

Schema

NameTypeDescription
idstringunique id for this option trade record
symbolstringTicker Symbol (TSLA, MSFT, etc...)
datestringthe date the trade was executed, the date format is YYYY-MM-DD
timestringThe time the trade was created. Format is YYYY-MM-DD HH:MM:SS
put_callstringIndicates whether this trade is PUT or CALL
strikefloatStrike price of the option trade
expiration_datestringThe date on which the Option expires. The Option becomes invalid after this date and cannot be exercised ex: 2022-04-05
option_activity_typestringOPRA trade condition code (e.g., AUTO, SLAN).
AGGREGATED MODE only
underlying_typestringIndicates underlying is Common Stock, ETF, ETN, etc.
AGGREGATED MODE only
oiintegerOpen Interest. The total number of this options contract that are still open.
sizeintegerTotal order size (either of the 1 trade for the trade of SINGLE or REPEATED, or the sum of trade sizes for a AGGREGATED trade)
pricefloatLast price of a trade, or last price of last trade in a sweep.
underlying_pricefloatCurrent stock price of the underlying asset
bidfloatOption contract best bid
askfloatOption contract best ask
ivfloatImplied volatility (IV) is an estimate of the future volatility of the underlying stock based on options prices.
premiumfloatCost in dollar of the entire sweep or block option trade
sentimentstringBULLISH, BEARISH, or NEUTRAL The sentiment is estimated based on whether the trade was executed at the bid, ask, or spot price.
trade_countintegerNumber of trades involved in the sweep. In RAW mode, this is always 1.
expiry_daysintegerThe days left to expiration date.
sidestringPrice side: AASK (above ask), ASK, MID, BID, BBID (below bid)
moneynessstringITM (in the money), ATM (at the money), OTM (out of the money)
deltafloatDelta is a measure of the change in an option's price
gammafloatOption gamma
dexnumberDelta exposure -- equivalent shares the dealer must hedge
deinumberDelta exposure impact relative to daily stock volume
daily_volumeintegerDay volume for this option contract including this trade
AGGREGATED MODE only
earning_datestringNext earning date for the underlying asset
AGGREGATED MODE only
updated_timestampnumberUTC timestamp in milliseconds when this record was created
market_capnumberMarket capitalization in dollars (current share price × outstanding shares)
AGGREGATED MODE only
option_symbolstringOption Contract Symbol, for example:TSLA240430P00508000, this refers to a put option contract with a strike price of $508 and an expiration date of April 30, 2024.

Sample response

// When WebSocket connected (one-time)
{
  "status": "SUCCESS",
  "msg": "Connection established with id: 159b4576-70ec-476f-8a1d-b061fdca0fb8",
  "data": {
    "connection_id": "1707123456789-a1b2c3d4e5f6"
  }
}

// When streaming data is received (each message is a plain trade object)
{
  "id": "13k7t4e",
  "date": "2025-05-02",
  "time": "2025-05-02 09:53:51",
  "symbol": "TSLA",
  "put_call": "CALL",
  "strike": 280,
  "expiration_date": "2025-05-02",
  "size": 7,
  "price": 4.44,
  "premium": 3109,
  "bid": 4.38,
  "ask": 4.5,
  "underlying_price": 281.77,
  "side": "MID",
  "sentiment": "NEUTRAL",
  "moneyness": "ITM",
  "expiry_days": 0,
  "option_symbol": "TSLA250502C00280000",
  "trade_count": 2,
  "dex": 413,
  "dei": 0.00239,
  "iv": 0.588,
  "delta": 0.589,
  "gamma": 0.0449,
  "vega": 0.551761,
  "theta": -0.018488,
  "rho": 0.412752,
  "oi": 14410,
  "daily_volume": 8352,
  "underlying_type": "STOCK",
  "option_activity_type": "SLAN",
  "earning_date": "2025-07-21",
  "exchange": "XISX",
  "ask_size": 4657,
  "bid_size": 2823,
  "market_cap": 900485935542,
  "updated_timestamp": 1746194031262
}

Response Error

{
  "status": "ERROR",
  "code": 401,
  "msg": "Unauthorized, please login to https://optiondata.io get a valid API subscription plan first"
}