option_history_trade_quote
FreeValueStandardPro
Retrieve combined trade + quote ticks for an option contract on a given date. Each row contains both the trade data and the prevailing quote at the time of the trade.
Code Example
rust
let data = tdx.option_history_trade_quote("SPY", "20260417", "550", "C", "20260315").await?;
for t in &data {
println!("date={} ms_of_day={} trade_price={:.2} size={} bid={:.2} ask={:.2} exchange={}",
t.date, t.ms_of_day, t.trade_price, t.size, t.bid, t.ask, t.exchange);
}python
data = tdx.option_history_trade_quote("SPY", "20260417", "550", "C", "20260315")
for t in data:
print(f"date={t.date} ms_of_day={t.ms_of_day} trade_price={t.trade_price:.2f} "
f"size={t.size} bid={t.bid:.2f} ask={t.ask:.2f} exchange={t.exchange}")typescript
const data = tdx.optionHistoryTradeQuote('SPY', '20260417', '550', 'C', '20260315');
for (const t of data) {
console.log(`date=${t.date} ms_of_day=${t.ms_of_day} trade_price=${t.trade_price} size=${t.size} bid=${t.bid} ask=${t.ask}`);
}cpp
auto data = client.option_history_trade_quote("SPY", "20260417", "550", "C", "20260315");
for (const auto& t : data) {
printf("date=%d ms_of_day=%d trade_price=%.2f size=%d bid=%.2f ask=%.2f exchange=%d\n",
t.date, t.ms_of_day, t.trade_price, t.size, t.bid, t.ask, t.exchange);
}Parameters
symbolstringrequiredUnderlying symbol
expirationstringrequiredExpiration date in
YYYYMMDD formatstrikestringrequiredStrike price in dollars as a string
rightstringrequired"C" for call, "P" for putdatestringrequiredDate in
YYYYMMDD formatstart_timestringoptionalStart time as milliseconds from midnight
end_timestringoptionalEnd time as milliseconds from midnight
exclusivebooloptionalUse exclusive time bounds
max_dteintoptionalMaximum days to expiration
strike_rangeintoptionalStrike range filter
Response
pricefloatTrade price
sizeintTrade size
conditionintTrade condition code
exchangeintTrade exchange code
bid_pricefloatPrevailing bid at time of trade
bid_sizeintPrevailing bid size
ask_pricefloatPrevailing ask at time of trade
ask_sizeintPrevailing ask size
datestringDate
ms_of_dayintMilliseconds from midnight
Sample Response
json
[
{"date": 20260402, "ms_of_day": 34203497, "trade_price": 98.59, "size": 1, "bid": 97.94, "ask": 98.90, "exchange": 6},
{"date": 20260402, "ms_of_day": 34950122, "trade_price": 99.10, "size": 2, "bid": 98.50, "ask": 99.45, "exchange": 10}
]Each row pairs the trade with the prevailing NBBO quote at execution time.
Notes
- Useful for trade classification (e.g., determining if a trade hit the bid or lifted the offer).