Trade Quote
FreeValueStandardPro
Fetch every option trade of one date, each paired with the NBBO quote at the time of the trade. The vendor keeps the most recent 7 calendar days.
from thetadatadx import Client
client = Client.from_env()
rows = client.market_data.option_flat_file_trade_quote(
"",
)
for t in rows:
print(t.ms_of_day, t.price, t.bid, t.ask) Sample response ·
JSON[
{
"ask": "0.29",
"ask_condition": 50,
"ask_exchange": 60,
"ask_size": 51,
"bid": "0.15",
"bid_condition": 50,
"bid_exchange": 65,
"bid_size": 212,
"condition": 18,
"condition_flags": 0,
"date": 20260803,
"exchange": 76,
"expiration": 20270319,
"ext_condition1": 255,
"ext_condition2": 255,
"ext_condition3": 255,
"ext_condition4": 255,
"ms_of_day": 39481283,
"ms_of_day2": 39481283,
"price": "0.29",
"price_flags": 7,
"records_back": 0,
"right": "C",
"root": "AAPL",
"sequence": -499850982,
"size": 1,
"strike": "540.0",
"volume_type": 0
},
{
"ask": "0.28",
"ask_condition": 50,
"ask_exchange": 4,
"ask_size": 164,
"bid": "0.21",
"bid_condition": 50,
"bid_exchange": 76,
"bid_size": 9,
"condition": 18,
"condition_flags": 0,
"date": 20260803,
"exchange": 7,
"expiration": 20270319,
"ext_condition1": 255,
"ext_condition2": 255,
"ext_condition3": 255,
"ext_condition4": 255,
"ms_of_day": 39830528,
"ms_of_day2": 39830528,
"price": "0.24",
"price_flags": 5,
"records_back": 0,
"right": "C",
"root": "AAPL",
"sequence": -463192089,
"size": 3,
"strike": "540.0",
"volume_type": 0
}
]Parameters
| Name | Type | Required | Default | Description |
|---|---|---|---|---|
date | date | yes | - | Date YYYYMMDD |
timeout_ms | int | no | - | Per-request deadline in milliseconds. 0 means no deadline. |
Response
Rows of TradeQuoteTick:
| Field | Type | Description |
|---|---|---|
ms_of_day | i32 | Milliseconds since midnight Eastern Time. |
sequence | i32 | Exchange-assigned trade sequence number. |
ext_condition1 | i32 | Additional trade condition code. |
ext_condition2 | i32 | Additional trade condition code. |
ext_condition3 | i32 | Additional trade condition code. |
ext_condition4 | i32 | Additional trade condition code. |
condition | i32 | Trade condition code. Zero is a code the vendor assigns a meaning, so read columns() to tell a reported zero from a response that carried no such column. |
size | i32 | Number of contracts or shares traded. |
exchange | i32 | Exchange code where the trade executed. Zero is a code the vendor assigns a meaning, so read columns() to tell a reported zero from a response that carried no such column. |
price | f64 | Trade price. |
condition_flags | i32 | Trade condition flags bitmap. |
price_flags | i32 | Trade price flags bitmap. |
volume_type | i32 | Volume reporting mode, as sent. The vendor does not define this column. |
records_back | i32 | Offset of this record behind the most recent record. |
quote_ms_of_day | i32 | Timestamp of the paired quote, milliseconds since midnight ET. The vendor names this column MS_OF_DAY2. |
bid_size | i32 | Last NBBO bid size. |
bid_exchange | i32 | Exchange code of the NBBO bid. Zero is a code the vendor assigns a meaning, so read columns() to tell a reported zero from a response that carried no such column. |
bid | f64 | NBBO bid at the time of the trade. |
bid_condition | i32 | Quote condition code on the bid side. Zero is a code the vendor assigns a meaning, so read columns() to tell a reported zero from a response that carried no such column. |
ask_size | i32 | Last NBBO ask size. |
ask_exchange | i32 | Exchange code of the NBBO ask. Zero is a code the vendor assigns a meaning, so read columns() to tell a reported zero from a response that carried no such column. |
ask | f64 | NBBO ask at the time of the trade. |
ask_condition | i32 | Quote condition code on the ask side. Zero is a code the vendor assigns a meaning, so read columns() to tell a reported zero from a response that carried no such column. |
date | i32 | Trading date as a YYYYMMDD integer. |
Every row carries expiration (YYYYMMDD), strike (dollars) and right ("C" / "P"); with the row's root, which the whole result carries per row, they identify the contract.