OptionData.io
  • Welcome!
    • Change Logs
  • Websocket Data API
    • Realtime Option Trades
Powered by GitBook
On this page
  • Sample Request
  • Schema for the CSV file
  1. REST DATA API

Historical Option Trades

GET https://api.optiondata.io/api-portal/f/list-csv-urls

Get the list of URLs for downloading the CSV files from the server, the URL links will expire in 1 hour after the request.

Query Parameters

Name
Type
Description

date*

String

A specific date string used to fetch the list of downloable URLS for the CSV files generated for that date, formatted as YYYYMMDD(e.g., 20240126).

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 only provides support for the date of 20240126

```json
{
    "status": "SUCCESS",
    "data": {
        "date": "20240126",
        "urls": [
            "https://fulloptionflow-daily-csv.s3.us-west-2.amazonaws.com/20240126/20240126_ABC.csv?AWSAccessKeyId=AKIAQW5P6UK75KBZ7DVL&Expires=1706603927&Signature=IZ7tTN1dr2FONQ%2Fg%2F7BlRBLSl24%3D",
            "https://fulloptionflow-daily-csv.s3.us-west-2.amazonaws.com/20240126/20240126_DEFGH.csv?AWSAccessKeyId=AKIAQW5P6UK75KBZ7DVL&Expires=1706603927&Signature=WiReSV4MlTqris2GKx2xvrQ%2B9RA%3D",
            "https://fulloptionflow-daily-csv.s3.us-west-2.amazonaws.com/20240126/20240126_IJKLMNOPQ.csv?AWSAccessKeyId=AKIAQW5P6UK75KBZ7DVL&Expires=1706603927&Signature=7m%2BgDgmO1zbbqIkIlZomefJJ8HE%3D",
            "https://fulloptionflow-daily-csv.s3.us-west-2.amazonaws.com/20240126/20240126_RS.csv?AWSAccessKeyId=AKIAQW5P6UK75KBZ7DVL&Expires=1706603927&Signature=45Q6p4whtNDMY%2FVyUTgaDA5kx0c%3D",
            "https://fulloptionflow-daily-csv.s3.us-west-2.amazonaws.com/20240126/20240126_TUVWXYZ.csv?AWSAccessKeyId=AKIAQW5P6UK75KBZ7DVL&Expires=1706603927&Signature=Brg1ORXJ75MPPaNGrYGPQwcLYLM%3D"
        ]
    }
}
```

Sample Request

var request = require('request');
var options = {
  'method': 'GET',
  'url': 'https://api.optiondata.io/api-portal/f/list-csv-urls?date=20240126',
  'headers': {
    'API-KEY': 'test_key'
  }
};
request(options, function (error, response) {
  if (error) throw new Error(error);
  console.log(response.body);
});

import requests

url = "https://api.optiondata.io/api-portal/f/list-csv-urls?date=20240126"

payload = {}
headers = {
  'API-KEY': 'test_key'
}

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

print(response.text)
curl --location 'https://api.optiondata.io/api-portal/f/list-csv-urls?date=20240126' \
--header 'API-KEY: test_key'

The daily CSV file compilation, consisting of five separate files, is generated and made available approximately 90 minutes following the closing of the market. This equates to a release time of 2:30 PM PST, 5:30 PM EST, and 4:30 PM CST. Each day's complete data set approximately encompasses 1 million rows, with the collective file size nearing 800MB.

Schema for the CSV file

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

put_call

string

Indicates whether this trade is PUT or CALL

strike_price

float

Strike price of the option trade

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

option_activity_type

string

underlying_type

string

Indicates underlying is Common Stock, ETF, ETN, etc.

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

bid_size

integer

Option contract bid size on exchange with best bid

ask_size

integer

Option contract bid size on exchange with best ask

ask

float

Option contract best ask

oi

integer

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

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.

expiry_days

integer

The days left to expiration date.

delta

float

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

vega

float

Vega is a Greek that measures how sensitive an option's price is to changes in the implied volatility of the underlying stock

exchange

string

Exchange where the trade executed

Last updated 7 months ago

Test it in the Postman:

sample CSV file:

Please refer to

https://www.postman.com/crimson-star-798429/workspace/optiondata-io/example/30898839-4caecb88-287b-4f0d-a231-a02f6f631678
https://optiondata-public.s3.us-west-2.amazonaws.com/20240326_ABC.csv
https://assets.website-files.com/5ba40927ac854d8c97bc92d7/5bf419828984e605fe3ba2e7_proposed_opra_trade_codes.pdf