OptionData.io
  • Welcome!
    • Change Logs
  • Websocket Data API
    • Realtime Option Trades
  • Historical Data
    • Clickhouse Data Connection
Powered by GitBook
On this page
  1. REST DATA API

Smart Option Flow Data API(Deprecated)

This API will be deprecated. New customers will not have access to it, while existing customers can continue using it until October 30th, 2024.

Smart Option Flow Data API returns real-time and historical structured data for Unusual Options Activity(UOA), representing anomalies in the Options Order Flow. This API service will aggregate the sweep orders traded within a specific timeframe, which helps our customers detect the hidden behaviors behind the aggressive trading intention. Usually, the premium of Smart Flow Data trades will be no less than $25K. Data latency is generally within 1 minute.

In compliance with the Options Price Reporting Authority (OPRA) guidelines, please be advised that the "ask" and "bid" fields will no longer be included in our API responses, effective from January 25th, 2024.

We understand that changes to data accessibility can impact your processes, and we are committed to providing you with the support necessary to transition smoothly through this update.

Should you require any assistance or further information regarding this change, please feel free to contact our customer support team.

We thank you for your understanding and cooperation in maintaining regulatory compliance.

Get the Smart Flow Data via this API

POST https://api.optiondata.io/api-portal/s

Get the real-time or historical smart option flow data.

Headers

Name
Type
Description

API-KEY*

String

Your API key, an essential token for accessing our services, is available through optiondata.io. After submitting the application form, you will be emailed a trial API token valid for 14 days to explore our offerings. If you wish to test our API immediately, feel free to use test_key as a temporary API key at no cost. Be aware that the test_key API token only provides support for the tickers AAPL and SPY.

Request Body

Name
Type
Description

symbol

string

If you want to search for a specific stock symbol (e.g., TSLA), please provide the symbol. If you leave it blank, the start_date and end_date must be the same. However, if you provide a symbol, you can query multiple dates within the start_date and end_date range.

start_date*

string

The initial date of the specified search range, in the format of YYYY-MM-DD, ex: 2023-05-01. The start_date should be earlier than end_date.

end_date*

string

The end date of the specified search range, in the format of YYYY-MM-DD, ex: 2023-05-01.

The start_date should be earlier than end_date.

{
    "status": "SUCCESS",
    "data": [
        {
            "date": "2023-05-01",
            "bid": 0.83,
            "open_interest": 28706,
            "option_activity_type": "SWEEP",
            "theta": -0.07,
            "delta": 0.17,
            "symbol": "AAPL",
            "ask": 0.85,
            "time": "15:57:47",
            "iv": 0.26,
            "expiry_days": 18,
            "premium": 28559.999999999996,
            "strike_price": 180,
            "size": 340,
            "updated": 1682971068,
            "price": 0.84,
            "date_expiration": "2023-05-19",
            "put_call": "CALL",
            "gamma": 0.0245,
            "underlying_price": 169.8,
            "option_symbol": "AAPL230519C00180000",
            "side": "BID",
            "sentiment": "BEARISH",
            "moneyness": "OTM",
            "trade_count": 8
        },
        {
            "date": "2023-05-01",
            "bid": 6.45,
            "open_interest": 50068,
            "option_activity_type": "SWEEP",
            "theta": -0.08,
            "delta": 0.53,
            "symbol": "AAPL",
            "ask": 6.55,
            "time": "15:56:02",
            "iv": 0.26,
            "expiry_days": 46,
            "premium": 83850,
            "strike_price": 170,
            "size": 130,
            "updated": 1682970962,
            "price": 6.45,
            "date_expiration": "2023-06-16",
            "put_call": "CALL",
            "gamma": 0.0258,
            "underlying_price": 169.63,
            "option_symbol": "AAPL230616C00170000",
            "side": "BID",
            "sentiment": "BEARISH",
            "moneyness": "OTM",
            "trade_count": 4
        },
        {
            "date": "2023-05-01",
            "bid": 1.7,
            "open_interest": 14904,
            "option_activity_type": "SWEEP",
            "theta": -0.39,
            "delta": -0.28,
            "symbol": "AAPL",
            "ask": 1.71,
            "time": "15:53:08",
            "iv": 0.5,
            "expiry_days": 4,
            "premium": 34200,
            "strike_price": 165,
            "size": 200,
            "updated": 1682970788,
            "price": 1.71,
            "date_expiration": "2023-05-05",
            "put_call": "PUT",
            "gamma": 0.0398,
            "underlying_price": 169.3899,
            "option_symbol": "AAPL230505P00165000",
            "side": "ASK",
            "sentiment": "BEARISH",
            "moneyness": "OTM",
            "trade_count": 4
        },
        {
            "date": "2023-05-01",
            "bid": 13.5,
            "open_interest": 14998,
            "option_activity_type": "BLOCK",
            "theta": -0.04,
            "delta": -0.4,
            "symbol": "AAPL",
            "ask": 13.65,
            "time": "15:51:00",
            "iv": 0.27,
            "expiry_days": 263,
            "premium": 1353000,
            "strike_price": 170,
            "size": 1000,
            "updated": 1682970660,
            "price": 13.53,
            "date_expiration": "2024-01-19",
            "put_call": "PUT",
            "gamma": 0.0103,
            "underlying_price": 169.315,
            "option_symbol": "AAPL240119P00170000",
            "side": "BID",
            "sentiment": "BULLISH",
            "moneyness": "ITM",
            "trade_count": 1
        },
        {
            "date": "2023-05-01",
            "bid": 2.13,
            "open_interest": 42491,
            "option_activity_type": "SWEEP",
            "theta": -0.06,
            "delta": 0.27,
            "symbol": "AAPL",
            "ask": 2.15,
            "time": "15:50:19",
            "iv": 0.23,
            "expiry_days": 46,
            "premium": 54610,
            "strike_price": 180,
            "size": 254,
            "updated": 1682970619,
            "price": 2.15,
            "date_expiration": "2023-06-16",
            "put_call": "CALL",
            "gamma": 0.0229,
            "underlying_price": 169.48,
            "option_symbol": "AAPL230616C00180000",
            "side": "ASK",
            "sentiment": "BULLISH",
            "moneyness": "OTM",
            "trade_count": 4
        },
        {
            "date": "2023-05-01",
            "bid": 11.25,
            "open_interest": 1166,
            "option_activity_type": "SWEEP",
            "theta": -0.05,
            "delta": -0.53,
            "symbol": "AAPL",
            "ask": 11.35,
            "time": "15:47:51",
            "iv": 0.25,
            "expiry_days": 109,
            "premium": 82125,
            "strike_price": 175,
            "size": 73,
            "updated": 1682970471,
            "price": 11.25,
            "date_expiration": "2023-08-18",
            "put_call": "PUT",
            "gamma": 0.0179,
            "underlying_price": 169.597,
            "option_symbol": "AAPL230818P00175000",
            "side": "MID",
            "sentiment": "NEUTRAL",
            "moneyness": "ITM",
            "trade_count": 8
        },
        {
            "date": "2023-05-01",
            "bid": 1.25,
            "open_interest": 33811,
            "option_activity_type": "SWEEP",
            "theta": -0.34,
            "delta": 0.27,
            "symbol": "AAPL",
            "ask": 1.26,
            "time": "15:42:52",
            "iv": 0.45,
            "expiry_days": 4,
            "premium": 25000,
            "strike_price": 175,
            "size": 200,
            "updated": 1682970172,
            "price": 1.25,
            "date_expiration": "2023-05-05",
            "put_call": "CALL",
            "gamma": 0.0394,
            "underlying_price": 169.585,
            "option_symbol": "AAPL230505C00175000",
            "side": "BID",
            "sentiment": "BEARISH",
            "moneyness": "OTM",
            "trade_count": 4
        },
        {
            "date": "2023-05-01",
            "bid": 4.65,
            "open_interest": 19398,
            "option_activity_type": "SWEEP",
            "theta": -0.42,
            "delta": 0.61,
            "symbol": "AAPL",
            "ask": 4.7,
            "time": "15:42:28",
            "iv": 0.49,
            "expiry_days": 4,
            "premium": 94000,
            "strike_price": 167.5,
            "size": 200,
            "updated": 1682970148,
            "price": 4.7,
            "date_expiration": "2023-05-05",
            "put_call": "CALL",
            "gamma": 0.0457,
            "underlying_price": 169.54,
            "option_symbol": "AAPL230505C00167500",
            "side": "ASK",
            "sentiment": "BULLISH",
            "moneyness": "ITM",
            "trade_count": 3
        },
        {
            "date": "2023-05-01",
            "bid": 21.55,
            "open_interest": 33672,
            "option_activity_type": "BLOCK",
            "theta": -0.06,
            "delta": 0.88,
            "symbol": "AAPL",
            "ask": 21.65,
            "time": "15:39:45",
            "iv": 0.33,
            "expiry_days": 46,
            "premium": 32325,
            "strike_price": 150,
            "size": 15,
            "updated": 1682969985,
            "price": 21.55,
            "date_expiration": "2023-06-16",
            "put_call": "CALL",
            "gamma": 0.0105,
            "underlying_price": 169.51,
            "option_symbol": "AAPL230616C00150000",
            "side": "BID",
            "sentiment": "BEARISH",
            "moneyness": "ITM",
            "trade_count": 1
        },
        {
            "date": "2023-05-01",
            "bid": 51.4,
            "open_interest": 11212,
            "option_activity_type": "BLOCK",
            "theta": -0.02,
            "delta": 0.81,
            "symbol": "AAPL",
            "ask": 52,
            "time": "15:39:24",
            "iv": 0.32,
            "expiry_days": 627,
            "premium": 51500,
            "strike_price": 135,
            "size": 10,
            "updated": 1682969964,
            "price": 51.5,
            "date_expiration": "2025-01-17",
            "put_call": "CALL",
            "gamma": 0.0036,
            "underlying_price": 169.52,
            "option_symbol": "AAPL250117C00135000",
            "side": "BID",
            "sentiment": "BEARISH",
            "moneyness": "ITM",
            "trade_count": 1
        }
    ]
}
```

{
    "status": "ERROR",
    "errorMsg": "AUTHENTICATED_FAILURE"
}
/*
In case the query response becomes excessively large, 
it occurs when the date range specified by the start_date and end_date 
is too extensive.
*/
{
    "status": "ERROR",
    "errorMsg": "Query response is too large, please narrow down query parameters"
}
/*
If no symbol is provided, then the start_date and end date should be the same.
in order to avoid the query is too extensive.
*/
{
    "status": "ERROR",
    "errorMsg": "if symbol is empty, start_date and end_date should be the same"
}

Rate limit: The rate limit is the maximum number of 10 requests from a single account that are allowed in a one-minute period. This value is continually evaluated, and requests will be blocked with an HTTP error code429(TOO MANY REQUEST)once this limit is reached. The request is automatically unblocked after it falls below the limit.

What is Smart Option Flow?

Smart Option Flow returns real-time and historical structured data for Unusual Options Activity(UOA), representing anomalies in the Options Order Flow. Usually, the premium of Smart Flow Data trades will be no less than $25K. Data latency is generally within 1 minute. In general, unusual options activity can be classified into block and sweep order.

What is the difference between the order type of sweep and block?

Block is a single order with an abnormally high trading volume than the average level. Blocks can be counted both by dollar value and contract size. The catalyst of a block is a real hurry and strong money flow to get filled by market players. Those market players are often big institutions or what we call “insiders” who have a relative edge over trading information, money pool, and algo system.

Sweep is typically a large order that is broken into a number of different smaller orders that can then be filled more quickly on multiple exchanges. A sweep order instructs the broker to identify the best prices on the market, regardless of offer size, and fill the order piece-by-piece until the entire order has been filled. The catalyst for sweep orders is to hide intention from the executor and make those orders stay “irrelevant”. This can also be a track of smart money who might be certain on the next day's market volatility with an edge but would not like to be radared. The other aim of a sweep may be taking as many as available contracts at the best prices, which indicates an aggressive bet on the underlying asset market. Our real-time Smart Option Flow Data API tracks the multi-exchange footprints of “smart money” by consolidating the data into an easy-to-interpret format, then printing it directly into the main feed in real-time.

Request Body Examples

// Get the TSLA smart option flow data from the date of March 01, 2023
// to the date of March 11th, 2023
{
  "symbol": "TSLA",
  "start_date": "2023-03-01",
  "end_date": "2023-03-11" 
}
// Get the smart option flow data regardless of any symbols for the date of March 01, 2023
// If the symbol isn't provided, then the `start_date` and `end_date` should be the s
{
  "symbol": null,
  "start_date": "2023-03-01",
  "end_date": "2023-03-01" 
}
```

Response Schema

Name
Type
Description
required?
Nullable

date

string

The date the trade was created, eg: 2022-01-01

required

No

time

string

The time the trade was created

required

No

symbol

string

Ticker Symbol (TSLA, MSFT, etc...)

No

put_call

string

Indicates PUT or CALL

No

strike_price

float

Strike price of the option

No

date_expiration

string

The date on which the Option expires. The Option becomes invalid after this date and cannot be exercised ex: 2022-04-05

No

option_activity_type

string

Type of unusual option, BLOCK or SWEEP, BLCOK is the number of trades involved in the trade equals 1, SWEEP is the number of trades involved in the trade greater than 1.

No

open_interest

integer

The total number of this options contract that are still open.

No

updated

integer

The timestamp indicates the moment when this flow order is received and incorporated into the system.

Yes

size

integer

Total order size (either of the 1 trade, or the sum of trade sizes for a sweep)

No

price

float

Last price of a trade, or last price of last trade in a sweep.

No

premium

float

Cost in dollor of the entire sweep or block option trade

No

underlying_price

float

the price of the underlying asset when the order is executed.

No

sentiment

string

BULLISH, BEARISH, or NEUTRUAL The sentiment is estimated based on whether the trade was executed at the bid, ask, or mark price.

No

bid

float

Bid price at the time of the trade, or last trade in case of a sweep.

No

ask

float

Ask price at the time of the trade, or last trade in case of a sweep.

No

option_symbol

string

Option symbol, ex: SPY190826P00292000

No

trade_count

integer

Number of trades involved in the sweep.

NO

expiry_days

integer

The days left to expiration date.

No

delta

float

Delta is a measure of the change in an option's price

YES

theta

float

Theta measures an option's sensitivity to time.

YES

gamma

float

Gamma (Γ) indicates the amount that an option's option's delta would change in response to a $1 move in the underlying security.

YES

side

string

ASK means the trade was executed on the ask side which was more likely buyer-initiated. BID means the trade was executed on the bid side which was more likely seller-initiated. AASK means the trade was executed above the ask side which was more likely buyer urgently initiated. BBIDmeans the trade was executed below the bid side which was more likely the seller urgently initiated.

No

moneyness

string

Moneyness describes the intrinsic value of an option in its current state. ITM(In The Money) refers to an options contract where the strike price is greater than the current share price of the underlying asset. OTM(Out of the Money) refers to an options contract where the strike price is not yet greater than the current share price of the underlying asset. ATM(At the Money) refers to an options contract where the strike price is equal to the current share price of the underlying asset.

No

iv

float

Implied volatility (IV) is an estimate of the future volatility of the underlying stock based on options prices.

YES

curl --location 'https://api.optiondata.io/api-portal/s' \
--header 'API-KEY: test_key' \
--header 'Content-Type: application/x-www-form-urlencoded' \
--data-urlencode 'symbol=AAPL' \
--data-urlencode 'start_date=2023-05-01' \
--data-urlencode 'end_date=2023-05-01'
const axios = require('axios');
const qs = require('qs');
let data = qs.stringify({
  'symbol': 'TSLA',
  'start_date': '2023-03-01',
  'end_date': '2023-03-01' 
});
let config = {
  method: 'post',
maxBodyLength: Infinity,
  url: 'https://api.optiondata.io/api-portal/s',
  headers: { 
    'API-KEY': 'test_key', 
    'Content-Type': 'application/x-www-form-urlencoded'
  },
  data : data
};

axios(config)
.then((response) => {
  console.log(response.data);
})
.catch((error) => {
console.log(`111`);
  console.log(error);
});
```python
import requests

url = "https://api.optiondata.io/api-portal/s"

payload = 'symbol=AAPL&start_date=2023-05-01&end_date=2023-05-01'
headers = {
  'API-KEY': 'test_key',
  'Content-Type': 'application/x-www-form-urlencoded'
}

response = requests.request("POST", url, headers=headers, data=payload)

print(response.text)

```

You can also try our API on the Postman playground here:

Last updated 8 months ago

You can find the pricing table at . If you are interested in subscribing to the API, you can open the chatbot and reach out to us OptionData.io or send emails tosupport@optiondata.io, we can guide you on the next steps. Thanks!

https://www.optiondata.io
https://www.postman.com/crimson-star-798429/workspace/optiondata-io/example/30898839-e2e647c9-f606-48d8-b41b-3f96ad9432da