Skip to content

option_at_time_trade

FreeValueStandardPro

Retrieve the trade at a specific time of day across a date range for an option contract. Returns one trade per date, the most recent trade at or before the specified time.

Code Example

rust
let data = tdx.option_at_time_trade("SPY", "20260417", "550", "C", "20260101", "20260301", "09:30:00.000").await?;
for t in &data {
    println!("date={} ms_of_day={} price={:.2} size={}",
        t.date, t.ms_of_day, t.price, t.size);
}
python
data = tdx.option_at_time_trade("SPY", "20260417", "550", "C", "20260101", "20260301", "09:30:00.000")
for t in data:
    print(f"date={t.date} ms_of_day={t.ms_of_day} price={t.price:.2f} size={t.size}")
typescript
const data = tdx.optionAtTimeTrade('SPY', '20260417', '550', 'C', '20260101', '20260301', '09:30:00.000');
for (const t of data) {
    console.log(`date=${t.date} ms_of_day=${t.ms_of_day} price=${t.price} size=${t.size}`);
}
cpp
auto data = client.option_at_time_trade("SPY", "20260417", "550", "C", "20260101", "20260301", "09:30:00.000");
for (const auto& t : data) {
    printf("date=%d ms_of_day=%d price=%.2f size=%d\n", t.date, t.ms_of_day, t.price, t.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
start_datestringrequired
Start date in YYYYMMDD format
end_datestringrequired
End date in YYYYMMDD format
time_of_daystringrequired
ET wall-clock time in HH:MM:SS.SSS (e.g. "09:30:00.000"; legacy "34200000" is also accepted)
max_dteintoptional
Maximum days to expiration
strike_rangeintoptional
Strike range filter

Response

pricefloat
Trade price
sizeint
Trade size
datestring
Date
ms_of_dayint
Milliseconds from midnight
conditionint
Trade condition code
exchangeint
Exchange code

Sample Response

json
[
  {"date": 20260331, "ms_of_day": 38482216, "price": 93.00, "size": 1},
  {"date": 20260402, "ms_of_day": 34203497, "price": 98.59, "size": 1}
]

Trade closest to 12:00 PM ET for SPY 2026-04-17 550 call. One row per date.

Notes

  • Common time values: "09:30:00.000" (9:30 AM), "13:00:00.000" (1:00 PM), "16:00:00.000" (4:00 PM).
  • Useful for building daily time series at a consistent intraday timestamp (e.g., opening trade every day).

Released under the Apache-2.0 License.