stock_history_quote
NBBO quotes for a stock on a given date, sampled at a configurable interval. Use "0" as the interval to get every quote change.
FreeValueStandardPro
Code Example
rust
let data = tdx.stock_history_quote("SPY", "20260315", "60000").await?;
for t in &data {
println!("date={} ms_of_day={} bid={:.2} bid_size={} ask={:.2} ask_size={} midpoint={:.2}",
t.date, t.ms_of_day, t.bid, t.bid_size, t.ask, t.ask_size, t.midpoint);
}python
data = tdx.stock_history_quote("SPY", "20260315", "60000")
for t in data:
print(f"date={t.date} ms_of_day={t.ms_of_day} bid={t.bid:.2f} "
f"bid_size={t.bid_size} ask={t.ask:.2f} ask_size={t.ask_size} midpoint={t.midpoint:.2f}")typescript
const data = tdx.stockHistoryQuote('SPY', '20260315', '60000');
for (const t of data) {
console.log(`date=${t.date} ms_of_day=${t.ms_of_day} bid=${t.bid} bid_size=${t.bid_size} ask=${t.ask} ask_size=${t.ask_size}`);
}cpp
auto data = client.stock_history_quote("SPY", "20260315", "60000");
for (const auto& t : data) {
printf("date=%d ms_of_day=%d bid=%.2f bid_size=%d ask=%.2f ask_size=%d midpoint=%.2f\n",
t.date, t.ms_of_day, t.bid, t.bid_size, t.ask, t.ask_size, t.midpoint);
}Parameters
symbolstringrequiredTicker symbol
datestringrequiredDate 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" to get every quote change.start_timestringoptionalStart time as milliseconds from midnight ET
end_timestringoptionalEnd time as milliseconds from midnight ET
venuestringoptionalData venue filter
Response Fields (QuoteTick)
ms_of_dayi32Milliseconds since midnight ET
bid_size / ask_sizei32Quote sizes
bid_exchange / ask_exchangei32Exchange codes
bid / askf64Bid/ask prices (decoded at parse time).
midpoint is pre-computed.bid_condition / ask_conditioni32Condition codes
datei32Date as
YYYYMMDD integerSample Response
json
[
{"date": 20260402, "ms_of_day": 34200000, "bid": 646.41, "bid_size": 1360, "ask": 646.42, "ask_size": 120, "midpoint": 646.41},
{"date": 20260402, "ms_of_day": 34260000, "bid": 646.85, "bid_size": 440, "ask": 646.87, "ask_size": 480, "midpoint": 646.86},
{"date": 20260402, "ms_of_day": 34320000, "bid": 647.35, "bid_size": 160, "ask": 647.38, "ask_size": 840, "midpoint": 647.36}
]SPY 1-minute NBBO quotes on 2026-04-02. Full response contains 391 rows.
Notes
- Setting
intervalto"0"returns every NBBO change, which can produce hundreds of thousands of rows for active symbols. Use the Rust_streamvariant for large responses. - Python users chain
.to_pandas()on the return value:tdx.stock_history_quote(...).to_pandas(). - Shorthand is supported:
"1m","5m","1h". Milliseconds ("60000","300000","3600000") are auto-converted to the nearest valid preset.