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
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
-
Showing 0 of max 100 trades
Realtime Option Data API
Request
WEBSOCKET
wss://ws.optiondata.ioParameters
| Name | Example | Required? | Description |
|---|---|---|---|
| token | cus_xxxxxxxxxx(Get Your API token here: optiondata.io) | Required | Get API token here: https://optiondata.io |
| aggregation_mode | AGGREGATED or RAW | Optional field, default value is AGGREGATED if leave blank | Determine 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. |
| symbols | SPY,TSLA,SPX or AAPL | Optional field, leave it blank means no filtering | A 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 filtering | The 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. |
| sentiment | BULLISH,BEARISH,NEUTRAL OR BULLISH | Optional field, leave it blank means no filtering | The 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_type | STOCK,ETF,INDEX or STOCK or ETF or INDEX | Optional field, leave it blank means no filtering | The 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 filtering | The 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] |
| moneyness | ITM,OTM,ATM or ITM | Optional field, leave it blank means no filtering | The 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 filtering | The 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_only | true | Optional field, leave it blank means no filtering | Only trades on stocks with upcoming earnings. AGGREGATED MODE only |
| put_call | CALL , or PUT | Optional field, leave it blank means no filtering | Filter to identify whether this option trade is PUT or CALL |
| side | ASK,AASK or ASK,BID | Optional field, leave it blank means no filtering | Price 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 filtering | Identity 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 filtering | The 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 filtering | Implied 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 filtering | OPRA 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 filtering | Number 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_only | true | Optional field, leave it blank means no filtering | Only 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 filtering | Filter 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 filtering | The 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 filtering | The 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_mode | true | Optional | Enable 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
| Name | Type | Description |
|---|---|---|
| id | string | unique id for this option trade record |
| symbol | string | Ticker Symbol (TSLA, MSFT, etc...) |
| date | string | the date the trade was executed, the date format is YYYY-MM-DD |
| time | string | The time the trade was created. Format is YYYY-MM-DD HH:MM:SS |
| put_call | string | Indicates whether this trade is PUT or CALL |
| strike | float | Strike price of the option trade |
| expiration_date | string | The date on which the Option expires. The Option becomes invalid after this date and cannot be exercised ex: 2022-04-05 |
| option_activity_type | string | OPRA trade condition code (e.g., AUTO, SLAN). AGGREGATED MODE only |
| underlying_type | string | Indicates underlying is Common Stock, ETF, ETN, etc. AGGREGATED MODE only |
| oi | integer | Open Interest. The total number of this options contract that are still open. |
| size | integer | Total order size (either of the 1 trade for the trade of SINGLE or REPEATED, or the sum of trade sizes for a AGGREGATED trade) |
| price | float | Last price of a trade, or last price of last trade in a sweep. |
| underlying_price | float | Current stock price of the underlying asset |
| bid | float | Option contract best bid |
| ask | float | Option contract best ask |
| iv | float | Implied volatility (IV) is an estimate of the future volatility of the underlying stock based on options prices. |
| premium | float | Cost in dollar of the entire sweep or block option trade |
| sentiment | string | BULLISH, BEARISH, or NEUTRAL The sentiment is estimated based on whether the trade was executed at the bid, ask, or spot price. |
| trade_count | integer | Number of trades involved in the sweep. In RAW mode, this is always 1. |
| expiry_days | integer | The days left to expiration date. |
| side | string | Price side: AASK (above ask), ASK, MID, BID, BBID (below bid) |
| moneyness | string | ITM (in the money), ATM (at the money), OTM (out of the money) |
| delta | float | Delta is a measure of the change in an option's price |
| gamma | float | Option gamma |
| dex | number | Delta exposure -- equivalent shares the dealer must hedge |
| dei | number | Delta exposure impact relative to daily stock volume |
| daily_volume | integer | Day volume for this option contract including this trade AGGREGATED MODE only |
| earning_date | string | Next earning date for the underlying asset AGGREGATED MODE only |
| updated_timestamp | number | UTC timestamp in milliseconds when this record was created |
| market_cap | number | Market capitalization in dollars (current share price × outstanding shares) AGGREGATED MODE only |
| option_symbol | string | Option 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"
}