Skip to content

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

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
intervalstringrequired
Accepts 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_dteintoptional
Maximum days to expiration
strike_rangeintoptional
Strike range filter

Response

bid_pricefloat
Best bid price
bid_sizeint
Bid size
ask_pricefloat
Best ask price
ask_sizeint
Ask size
datestring
Date
ms_of_dayint
Milliseconds from midnight
bid_exchangeint
Bid exchange code
ask_exchangeint
Ask 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 _stream variant.

Released under the Apache-2.0 License.