# Realtime Option Data API

<figure><img src="/files/7DnvnRGbCsOUkjgQJHV4" alt=""><figcaption></figcaption></figure>

## Request

<mark style="color:green;">`WEBSOCKET`</mark>` `**`wss://ws.optiondata.io`**

### **Parameters**

<table data-full-width="true"><thead><tr><th>Name</th><th>Example</th><th>Required?</th><th>Description</th></tr></thead><tbody><tr><td>token</td><td><code>cus_xxxxxxxxxx</code>(Get Your API token here: <a href="https://portal.optiondata.io/">portal.optiondata.io</a> )</td><td>Required</td><td> Get API token here: <a href="https://accounts.optiondata.io/sign-up">https://</a><a href="https://portal.optiondata.io/">portal.optiondata.io</a></td></tr><tr><td>aggregation_mode</td><td><code>AGGREGATED</code> or <code>RAW</code></td><td>Optional field, default value is <code>AGGREGATED</code> if leave blank</td><td>Determine how the option trades are aggregated by our algorithm. In <strong>AGGREGATED</strong> mode, the modified real-time feed combines option trades executed simultaneously for the same option symbol. In contrast, <strong>RAW</strong> mode keep the option trades in their original form without any modifications. For more details, more details.</td></tr><tr><td>symbols</td><td><code>SPY,TSLA,SPX or AAPL</code></td><td><p>Optional field,</p><p>leave it blank means no filtering</p></td><td>A list of symols in upper case seperated by comma.  Using the <code>*</code>  wildcard or don't provide it to subscribe to all symbols.</td></tr><tr><td>premium</td><td><p>[<code>100000,250000]//min premium is $100000, max premium is 250000</code></p><p><code>[100,null]//min premium is $100, no max limit</code></p></td><td><p>Optional field,</p><p>leave it blank means no filtering</p></td><td>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.</td></tr><tr><td>sentiment</td><td><code>BULLISH,BEARISH,NEUTRUAL</code> OR <code>BULLISH</code> </td><td><p>Optional field,</p><p>leave it blank means no filtering</p></td><td>The filter for sentiment includes potential values of <code>BULLISH</code>, <code>BEARISH</code>, and <code>NEUTRUAL</code>. You can combine multiple selections by separating them with commas, such as <code>NEUTRUAL,BEARISH</code>.</td></tr><tr><td>underlying_type</td><td><code>STOCK,ETF,INDEX</code> or <code>STOCK</code> or <code>ETF</code> or <code>INDEX</code></td><td><p>Optional field,</p><p>leave it blank means no filtering</p></td><td>The filter for underlying_type includes potential values of <code>INDEX</code>, <code>STOCK</code>, and <code>ETF</code>. You can combine multiple selections by separating them with commas, such as <code>INDEX,STOCK</code>.</td></tr><tr><td>delta</td><td><code>[-0.9,0.98]</code> or <code>[-1,0.9]</code></td><td><p>Optional field,</p><p>leave it blank means no filtering</p></td><td>The filter for delta has a default range of <code>[-1, 1]</code>. The first value represents the minimum delta, while the second value indicates the maximum delta. The range must remain within <code>[-1, 1]</code></td></tr><tr><td>moneyness</td><td><code>ITM,OTM,ATM</code> or <code>ITM</code></td><td><p>Optional field,</p><p>leave it blank means no filtering</p></td><td>The filter for moneyness includes potential values of <code>ITM</code>, <code>ATM</code>, and <code>OTM</code>. You can combine multiple selections by separating them with commas, such as <code>ITM,OTM</code>.</td></tr><tr><td>expiry_days</td><td><p><code>[15,20]</code>// minimum expiry days is 15, maximum expiry day is 20 days</p><p><code>[0,null]</code> // // minimum expiry days is 15, no maximum expiry days</p><p>[null,30] // minimum expiry days is 0, maximum expiry day is 30 days</p></td><td><p>Optional field,</p><p>leave it blank means no filtering</p></td><td>The days remaining until the expiration date. The first number represents the minimum expiration days, with a default value of 0 if <code>null</code> is provided. The second number is the maximum expiration days; if <code>null</code> is provided, there is no limit.</td></tr><tr><td>is_recent_earning_only</td><td><code>true</code></td><td><p>Optional field,</p><p>leave it blank means no filtering</p></td><td>Filter for symbols with incoming earning reports(<code>earning_date</code> is not null).</td></tr><tr><td>put_call</td><td><code>CALL</code> ,  or <code>PUT</code></td><td><p>Optional field,</p><p>leave it blank means no filtering</p></td><td>Filter to identify whether this option trade is <code>PUT</code> or <code>CALL</code></td></tr><tr><td>side</td><td><code>ASK,AASK</code> or <code>ASK,BID</code></td><td><p>Optional field,</p><p>leave it blank means no filtering</p></td><td>Identify the side on which this trade is executed on</td></tr><tr><td>strike</td><td><p><code>[15.5,20]</code>// minimum strike price is $15.5, maximum strike price is $20</p><p><code>[0,null]</code> // // minimum expiry days is $0, no maximum limit on strike price.</p><p><code>[null,30]</code> // minimum strike price is $0, maximum strike price is $30.</p></td><td><p>Optional field,</p><p>leave it blank means no filtering</p></td><td>Identity the range of the Strike price of the option trade. The first number represents the minimum strike price, with a default value of <code>0</code> if <code>null</code> is provided. The second number is the maximum strike price. if <code>null</code> is provided, there is no limit at the maximium strike price. default value is <code>[0,null]</code> with minimum strike price is $0, and no limit on the maximum strike price.</td></tr><tr><td>oi</td><td><p><code>[155,2000]</code>// minimum open interest is 155, maximum open interest is 200</p><p><code>[0,null]</code> // // minimum open interest is 0, no maximum limit on open interest.</p><p><code>[null,300]</code> // minimum open interest is 0, maximum open interest is 300.</p></td><td><p>Optional field,</p><p>leave it blank means no filtering</p></td><td>The total number of this options contract that are still open. The first number represents the minimum OI, with a default value of <code>0</code> if <code>null</code> is provided. The second number is the maximum OI. if <code>null</code> is provided, there is no limit at the maximium OI. default value is <code>[0,null]</code> with minimum OI is 0, and no limit on the maximum OI.</td></tr><tr><td>iv</td><td><p><code>[0.1,1.1]</code>// minimum iv is 0.1, maximum iv is 1.1</p><p><code>[0,null]</code> // // minimum iv is 0, no maximum limit.</p><p><code>[null,1.1]</code> // minimum iv is 0, maximum iv is 1.1</p></td><td><p>Optional field,</p><p>leave it blank means no filtering</p></td><td>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 <code>0</code> if <code>null</code> is provided. The second number is the maximum IV. if <code>null</code> is provided, there is no limit at the maximium IV. default value is <code>[0,null]</code> with minimum IV is 0, and no limit on the maximum IV.</td></tr><tr><td>option_activity_type</td><td><p><code>AUTO</code> // single choice</p><p><code>AUTO,SLAN,SLAI</code>// multiple choices</p></td><td><p>Optional field,</p><p>leave it blank means no filtering</p></td><td>how is the trade excuted. All relevant code can be found at <a href="https://assets.website-files.com/5ba40927ac854d8c97bc92d7/628bc18445cf7ec41d21ddfa_OPRA%20Pillar%20Output%20Specification.pdf">Link</a></td></tr><tr><td>trade_count</td><td><code>[1,1]</code>//only block trads<br><code>[2,null]</code>//only aggregated trades<br><code>[2,10]</code>// aggregated trades that aggregates 2 to 10 trades</td><td><p>Optional field,</p><p>leave it blank means no filtering</p></td><td>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.</td></tr><tr><td>is_opening_only</td><td><code>true</code></td><td><p>Optional field,</p><p>leave it blank means no filtering</p></td><td>Filter for trades that are opening trades, with a size greater than the sum of open interest and daily volume, minus the trade size.</td></tr><tr><td>test_mode</td><td><code>true</code></td><td>Optional</td><td>If <code>test_mode</code> is set to <code>true</code> and it is not market time, the WebSocket will stream data from three days ago until today. This feature is useful for developers who want to continue testing the WebSocket stream connection after the market closes.</td></tr><tr><td>size</td><td><p><code>[155,2000]</code>// minimum size is 155, maximum open interest is 200</p><p><code>[0,null]</code> // // minimum size is 0, no maximum limit on size.</p><p><code>[null,300]</code> // minimum size is 0, maximum size is 300.</p></td><td><p>Optional field,</p><p>leave it blank means no filtering</p></td><td>Filter for the total order size. The first number represents the minimum size, with a default value of <code>0</code> if <code>null</code> is provided. The second number is the maximum size if <code>null</code> is provided, there is no limit at the maximium size. default value is <code>[0,null]</code> with minimum size is 0, and no limit on the maximum size.</td></tr></tbody></table>

### Sample Code

{% tabs %}
{% tab title="Typescript" %}

<pre class="language-typescript" data-full-width="true"><code class="lang-typescript">// Some code
<strong>import WebSocket from 'ws';
</strong>
const url = "wss://ws.optiondata.io/?symbols=AAPL,SPX&#x26;token=cus_xxxx&#x26;premium>=300000&#x26;test_mode=true";

// 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);
});
</code></pre>

{% endtab %}

{% tab title="Python" %}

```python
import asyncio
import websockets
import json
import datetime
from asyncio import Queue

# Set your WebSocket URL here
url = "wss://ws.optiondata.io/?token=YOUR_API_TOKEN"

# Create a global queue for demonstration
data_queue = Queue()

async def connect():
    """Connect to WebSocket and process messages."""
    while True:
        try:
            async with websockets.connect(url, ping_interval=10, ping_timeout=15) as websocket:
                print(f'✅[{datetime.datetime.utcnow()}]  WebSocket connection opened')

                try:
                    while True:
                        message = await websocket.recv()
                        print(f"[{datetime.datetime.utcnow()}] 📩 Message received: {message[:200]}{'...' if len(message) > 200 else ''}")
                        try:
                            received_data = json.loads(message)
                            option_symbol = received_data.get('option_symbol')

                            if received_data.get('daily_volume', 0) > 1000 and (
                                (received_data.get('price', 0) > 0.02 and option_symbol != "SPY")
                                or option_symbol == "SPY"
                            ):
                                if option_symbol:
                                    await data_queue.put(received_data)  # Push to queue
                                    print(f"[{datetime.datetime.utcnow()}] ✅ Queued data for option_symbol: {option_symbol}")

                        except json.JSONDecodeError as e:
                            print(f"[{datetime.datetime.utcnow()}]  Error parsing received data: {e}")

                except websockets.exceptions.ConnectionClosed as e:
                    print(f"[{datetime.datetime.utcnow()}] ⚠️ WebSocket connection closed: {e}, reconnecting immediately.")

        except websockets.exceptions.WebSocketException as e:
            print(f"[{datetime.datetime.utcnow()}] ⚠️ WebSocket error: {e}, reconnecting immediately.")
        except Exception as e:
            print(f"[{datetime.datetime.utcnow()}] ❌ Unexpected error: {e}, reconnecting immediately.")

        print(f"[{datetime.datetime.utcnow()}] ⏳ Waiting 2 seconds before reconnecting...")
        await asyncio.sleep(2)  # Backoff before reconnecting to avoid hammering the server

if __name__ == "__main__":
    try:
        asyncio.run(connect())
    except KeyboardInterrupt:
        print("Shutting down...")
```

{% endtab %}

{% tab title="Go" %}

```go
// Some code
package main

import (
	"fmt"
	"log"
	"os"
	"os/signal"

	"github.com/gorilla/websocket"
)

func main() {
	// Define the URL of the WebSocket server
	url := "wss://ws.optiondata.io/?symbols=AAPL,SPX&token=cus_xxxx&premium>=300000&test_mode=true"

	// Connect to the WebSocket server
	c, _, err := websocket.DefaultDialer.Dial(url, nil)
	if err != nil {
		log.Fatalf("Failed to connect to WebSocket server: %v", err)
	}
	defer c.Close()

	// Handle interrupt signals to terminate gracefully
	interrupt := make(chan os.Signal, 1)
	signal.Notify(interrupt, os.Interrupt)

	fmt.Println("WebSocket connection opened")

	done := make(chan struct{})

	// Goroutine for reading messages
	go func() {
		defer close(done)
		for {
			_, message, err := c.ReadMessage()
			if err != nil {
				log.Println("Error reading message:", err)
				return
			}
			fmt.Printf("Received message: %s\n", message)
			// Ideally, you would parse and handle the JSON message here
		}
	}()

	// Main loop for handling program exit
	for {
		select {
		case <-done:
			return
		case <-interrupt:
			log.Println("Interrupt received, closing WebSocket connection...")
			// To cleanly close the connection, send a close message and wait for the server to close the connection
			err := c.WriteMessage(websocket.CloseMessage, websocket.FormatCloseMessage(websocket.CloseNormalClosure, ""))
			if err != nil {
				log.Println("Error during closing WebSocket connection:", err)
				return
			}
			select {
			case <-done:
			}
			return
		}
	}
}
```

{% endtab %}
{% endtabs %}

## Response&#x20;

### Schema

<table data-full-width="true"><thead><tr><th>Name</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td><strong>id</strong></td><td><code>string</code></td><td>unique id for this option trade record</td></tr><tr><td><strong>symbol</strong></td><td><code>string</code></td><td>Ticker Symbol (<code>TSLA</code>, <code>MSFT</code>, etc...)</td></tr><tr><td><strong>date</strong></td><td><code>string</code></td><td>the date the trade was executed,  the date format is <code>YYYY-MM-DD</code></td></tr><tr><td><strong>time</strong></td><td><code>string</code></td><td>The time the trade was created. Format is <code>YYYY-MM-DD HH:MM:SS</code></td></tr><tr><td><strong>put_call</strong></td><td><code>string</code></td><td>Indicates whether this trade is  <code>PUT</code> or <code>CALL</code></td></tr><tr><td><strong>strike</strong></td><td><code>float</code></td><td>Strike price of the option trade</td></tr><tr><td><strong>expiration_date</strong></td><td><code>string</code></td><td>The date on which the Option expires. The Option becomes invalid after this date and cannot be exercised ex: <code>2022-04-05</code></td></tr><tr><td><strong>option_activity_type</strong></td><td><code>string</code></td><td>Please refer to <a href="https://assets.website-files.com/5ba40927ac854d8c97bc92d7/5bf419828984e605fe3ba2e7_proposed_opra_trade_codes.pdf">https://assets.website-files.com/5ba40927ac854d8c97bc92d7/5bf419828984e605fe3ba2e7_proposed_opra_trade_codes.pfd</a><a href="https://assets.website-files.com/5ba40927ac854d8c97bc92d7/628bc18445cf7ec41d21ddfa_OPRA%20Pillar%20Output%20Specification.pdf">https://assets.website-files.com/5ba40927ac854d8c97bc92d7/628bc18445cf7ec41d21ddfa_OPRA%20Pillar%20Output%20Specification.pdf</a> </td></tr><tr><td><strong>underlying_type</strong></td><td><code>string</code></td><td>Indicates underlying is Common Stock, ETF, ETN, etc.</td></tr><tr><td><strong>oi</strong></td><td><code>integer</code></td><td>Open Interest. The total number of this options contract that are still open.</td></tr><tr><td><strong>size</strong></td><td><code>integer</code></td><td>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)</td></tr><tr><td><strong>price</strong></td><td><code>float</code></td><td>Last price of a trade, or last price of last trade in a sweep.</td></tr><tr><td><strong>underlying_price</strong></td><td><code>float</code></td><td>Current stock price of the underlying asset</td></tr><tr><td><strong>bid</strong></td><td><code>float</code></td><td>Option contract best bid</td></tr><tr><td><strong>bid_size</strong></td><td><code>integer</code></td><td>Option contract bid size on exchange with best bid</td></tr><tr><td><strong>ask_size</strong></td><td><code>integer</code></td><td>Option contract bid size on exchange with best ask</td></tr><tr><td><strong>ask</strong></td><td><code>float</code></td><td>Option contract best ask</td></tr><tr><td><strong>iv</strong></td><td><code>float</code></td><td>Implied volatility (IV) is an estimate of the future volatility of the underlying stock based on options prices.</td></tr><tr><td><strong>premium</strong></td><td><code>float</code></td><td>Cost in dollar of the entire sweep or block option trade</td></tr><tr><td><strong>sentiment</strong></td><td><code>string</code></td><td><code>BULLISH</code>, <code>BEARISH</code>, or <code>NEUTRAL</code> The sentiment is estimated based on whether the trade was executed at the bid, ask, or spot price.</td></tr><tr><td><strong>trade_count</strong></td><td><code>integer</code></td><td>Number of trades involved in the sweep.</td></tr><tr><td><strong>expiry_days</strong></td><td><code>integer</code></td><td>The days left to expiration date.</td></tr><tr><td><strong>delta</strong></td><td><code>float</code></td><td>Delta is a measure of the change in an option's price</td></tr><tr><td><strong>vega</strong></td><td><code>float</code></td><td>Vega is a Greek that measures how sensitive an option's price is to changes in the implied volatility of the underlying stock</td></tr><tr><td><strong>exchange</strong></td><td><code>string</code></td><td>Exchange where the trade executed</td></tr><tr><td><strong>daily_volume</strong></td><td><code>integer</code></td><td>Day volume for this option contract including this trade</td></tr><tr><td><strong>earning_date</strong></td><td><code>string</code></td><td>next earning date for the underlying asset.</td></tr><tr><td><strong>updated_timestamp</strong></td><td><code>string</code></td><td>the UTC timestamp that this data record is created in our system</td></tr><tr><td><strong>theta</strong></td><td><code>float</code></td><td>measures the rate at which an option's price decreases as it approaches its expiration date, commonly referred to as "time decay."</td></tr><tr><td><strong>rho</strong></td><td><code>float</code></td><td>measures the sensitivity of an option’s price to changes in interest rates.</td></tr><tr><td><strong>market_cap</strong></td><td><code>Int</code></td><td>market capitalization, company's total market value, represented in dollars, and calculated by multiplying the current share price by the total number of outstanding shares</td></tr><tr><td><strong>option_symbol</strong></td><td><code>string</code></td><td>Option Contract Symbol, for example:<code>TSLA240430P00508000</code>, this refers to a put option contract with a strike price of $508 and an expiration date of April 30, 2024.</td></tr></tbody></table>

### **Sample response**

{% tabs %}
{% tab title="200" %}

<pre class="language-json" data-overflow="wrap"><code class="lang-json">//When websocket connected
{
  "status": "SUCCESS",
  "msg": "{ message: `Connection established with id: 159b4576-70ec-476f-8a1d-b061fdca0fb8"
}

//When Streaming data received
<strong>{
</strong>  "status": "SUCCESS",
  "data": {
    "id": "m3d9eur5",
    "date": "2024-11-11",
    "size": 10,
    "price": 15.24,
    "premium": 15240,
    "bid": 13.85,
    "ask": 15.85,
    "time": "2024-11-11 11:50:20",
    "symbol": "HOOD",
    "put_call": "CALL",
    "strike": 27,
    "expiration_date": "2027-01-15",
    "underlying_type": "STOCK",
    "option_activity_type": "AGGREGATED",
    "oi": 710,
    "underlying_price": 33.77,
    "sentiment": "NEUTRAL",
    "expiry_days": 795,
    "side": "MID",
    "moneyness": "ITM",
    "iv": 0.67,
    "delta": 0.7664,
    "option_symbol": "HOOD270115C00027000",
    "gamma": 0.0092,
    "daily_volume": 25,
    "earning_date": "1970-01-01",
    "trade_count": 2,
    "updated_timestamp": "1731343820218",
    "ask_size": "18",
    "bid_size": "3",
    "exchange": "EDGO",
    "vega": 0.152656,
    "theta": -0.006518,
    "rho": 0.231765,
    "market_cap": "25953526229"
  }
}
</code></pre>

{% endtab %}
{% endtabs %}

### **Response Error**

{% tabs %}
{% tab title="400" %}

```json
{
  "status": "ERROR",
  "code": 400,
  "msg": "error message"
}
```

{% endtab %}

{% tab title="500" %}

```json
{
  "status": "ERROR",
  "code": 500,
  "msg": "Internal Error"
}// Some code


```

{% endtab %}
{% endtabs %}

## FAQ

{% hint style="info" %}
**Q: What is an Aggregation Mode?**

A: Real-time Option Trades in `AGGREGATED` mode consolidates trades with the same option symbol executed simultaneously (at the second level) into a single aggregate trade. This approach simplifies the identification of large trades that have been divided into multiple smaller transactions. If you want to see the original trades without any modification, please use `RAW` mode, the major differences between the two data feeds:

* The `trade_count` for option trades in `RAW` mode is always 1. In `AGGREGATED` mode, the `trade_count` can be either 1 or greater than 1. If it is greater than 1, this indicates that the option trade record aggregates multiple original option trades with the same option symbol that was executed simultaneously.
* The average daily volume for Real-time Option Trades in `AGGREGATED` mode is 4 million rows of records, while the average daily volume for `RAW` is around 7 million rows of records.

**Q: How to choose between `AGGREGATED`  mode and `RAW` mode?**

A: Institutional players often divide large trades into smaller ones and execute them simultaneously. They do this either to hide their intentions or due to a lack of liquidity or market depth at the moment of execution. This is the background for why we introduced `AGGREGATED` mode, for the case that you need to identify significant block trades in real-time, you can select `AGGREGATED` mode, allowing our aggregation services to combine these trades. If you prefer no modifications to the trades, you can choose `RAW` mode instead. By default, the API uses `AGGREGATED` mode unless you specify a different value for the `aggregation_mode` field.  Please note that this is an assumption that trades executed simultaneously are sent by the same trader/institution, otherwise, you can choose `RAW` mode instead.

**Q: Can you give me some examples?**

A:  Let's say there are two records in real-time option trades with `RAW` mode like below:

```
// RAW MODE
date        time      symbol  strike  put_call expiration_date premium size trade_count
2025-02-01  09:32:02  TSLA    330     CALL     2025-02-15       1000    2    1
2025-02-01  09:32:02  TSLA    330     CALL     2025-02-15       2000    3    1

```

These two trades will be aggregated into one trade since they are executed at the same time with the same option symbol.

```
// AGGREGATED MODE
date        time      symbol  strike  put_call expiration_date premium size trade_count
2025-02-01  09:32:02  TSLA    330     CALL     2025-02-15       3000    5    2
```

For the example above, the size of trade in the `AGGREGATED` mode is equal to the sum of the  size of the trades in the `RAW`mode(5 = 3 + 2), the trade size of trade in the `AGGREGATED` mode is equal to the sum of the trade\_size in the `RAW` mode. For other data fields in `AGGREGATED` mode (eg: delta, iv, gamma, theta) is the average value of the related data field in the `RAW` mode.&#x20;

**Q: Is there a delay in the data?**

A: On average, We process around 20,000 records per minute during daily market open times. Due to the initial surge of data when the market opens, there may be delays during this period.

<img src="/files/qErN0TQfy86xtfl4ejaC" alt="" data-size="original">

Q: How to get started?

A: Please register at [https://portal.optiondata.io](https://discord.com/invite/mE5pEDMdWs) to get a 14-day free trial without a credit card required.  Please reach out to us to help you set up the API connection.

**Q: Is there still streaming data after market close, and if not, how can I test it?**

**A:** By default, there is no streaming data available after market close. However, if you set the `test_mode` parameter to `true`, the WebSocket will stream data from three days ago until today. This feature enables developers to continue testing the WebSocket stream connection even after the market has closed. Please note that during market hours, if `test_mode` is set to `true`, the WebSocket will still stream real-time data instead of historical data from the past three days.

**Q: What are the refund and trial policies for different APIs?**

A: **Real-time Option Data API:**

* 14-day free trial available
* 30-day money back guarantee
* No questions asked refund policy

**Historical Option Data API:**

* No free trial available
* No refund policy (all sales final)
* Contact support for any technical issues

**Q: How do I request a refund for real-time API?**

A: For real-time API subscriptions, simply send an email to <support@optiondata.io> using your login email address within 30 days of purchase. We'll process your refund promptly and get back to you with confirmation. **Note:** Refunds are only available for real-time API subscriptions, not historical data purchases.<br>

[\ <br>](<https://discord.com/invite/mE5pEDMdWs&#xA;&#xA;>)
{% endhint %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.optiondata.io/websocket-data-api/realtime-option-data-api.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
