option_history_quote
FreeValueStandardPro
Retrieve NBBO quotes for an option contract, sampled at a specified interval.
Code Example
rust
let data = tdx.option_history_quote("SPY", "20260417", "550", "C", "20260315", "60000").await?;
for t in &data {
println!("date={} ms_of_day={} bid={:.2} ask={:.2} bid_size={} ask_size={}",
t.date, t.ms_of_day, t.bid, t.ask, t.bid_size, t.ask_size);
}python
data = tdx.option_history_quote("SPY", "20260417", "550", "C", "20260315", "60000")
for t in data:
print(f"date={t.date} ms_of_day={t.ms_of_day} bid={t.bid:.2f} "
f"ask={t.ask:.2f} bid_size={t.bid_size} ask_size={t.ask_size}")typescript
const data = tdx.optionHistoryQuote('SPY', '20260417', '550', 'C', '20260315', '60000');
for (const t of data) {
console.log(`date=${t.date} ms_of_day=${t.ms_of_day} bid=${t.bid} ask=${t.ask} bid_size=${t.bid_size} ask_size=${t.ask_size}`);
}cpp
auto data = client.option_history_quote("SPY", "20260417", "550", "C", "20260315", "60000");
for (const auto& t : data) {
printf("date=%d ms_of_day=%d bid=%.2f ask=%.2f bid_size=%d ask_size=%d\n",
t.date, t.ms_of_day, t.bid, t.ask, t.bid_size, t.ask_size);
}Parameters
symbolstringrequiredUnderlying symbol
expirationstringrequiredExpiration date in
YYYYMMDD formatstrikestringrequiredStrike price in dollars as a string
rightstringrequired"C" for call, "P" for putdatestringrequiredDate in
YYYYMMDD formatintervalstringrequiredAccepts milliseconds (
"60000") or shorthand ("1m"). Valid presets: 100ms, 500ms, 1s, 5s, 10s, 15s, 30s, 1m, 5m, 10m, 15m, 30m, 1h. Use "0" for every quote change.max_dteintoptionalMaximum days to expiration
strike_rangeintoptionalStrike range filter
Response
bid_pricefloatBest bid price
bid_sizeintBid size
ask_pricefloatBest ask price
ask_sizeintAsk size
datestringDate
ms_of_dayintMilliseconds from midnight
bid_exchangeintBid exchange code
ask_exchangeintAsk exchange code
Sample Response
json
[
{"date": 20260402, "ms_of_day": 34200000, "bid": 0.00, "ask": 0.00, "bid_size": 0, "ask_size": 0},
{"date": 20260402, "ms_of_day": 34260000, "bid": 97.94, "ask": 98.90, "bid_size": 1, "ask_size": 1},
{"date": 20260402, "ms_of_day": 34320000, "bid": 97.05, "ask": 100.60, "bid_size": 1, "ask_size": 54}
]1-minute NBBO quotes for SPY 2026-04-17 550 call.
Notes
- Use
"0"as the interval to get every quote change (tick-by-tick). - For liquid contracts with
"0"interval, the response can be very large. In Rust, use the_streamvariant.