Skip to content

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

symbolstringrequired
Underlying symbol
expirationstringrequired
Expiration date in YYYYMMDD format
strikestringrequired
Strike price in dollars as a string
rightstringrequired
"C" for call, "P" for put
datestringrequired
Date in YYYYMMDD format
start_timestringoptional
Start time as milliseconds from midnight
end_timestringoptional
End time as milliseconds from midnight
exclusivebooloptional
Use exclusive time bounds
max_dteintoptional
Maximum days to expiration
strike_rangeintoptional
Strike range filter

Response

pricefloat
Trade price
sizeint
Trade size
conditionint
Trade condition code
exchangeint
Trade exchange code
bid_pricefloat
Prevailing bid at time of trade
bid_sizeint
Prevailing bid size
ask_pricefloat
Prevailing ask at time of trade
ask_sizeint
Prevailing ask size
datestring
Date
ms_of_dayint
Milliseconds 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).

Released under the Apache-2.0 License.