Skip to content

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
// 1-minute sampled quotes
let quotes: Vec<QuoteTick> = tdx.stock_history_quote("AAPL", "20240315", "60000").await?;

// Every quote change (stream variant for large responses)
tdx.stock_history_quote_stream("AAPL", "20240315", "0", |chunk| {
    println!("Got {} quotes in this chunk", chunk.len());
    Ok(())
}).await?;
python
# 1-minute sampled quotes
quotes = tdx.stock_history_quote("AAPL", "20240315", "60000")

# Every quote change as DataFrame
df = tdx.stock_history_quote_df("AAPL", "20240315", "0")
print(f"{len(df)} quote changes")
go
// 1-minute sampled quotes
quotes, err := client.StockHistoryQuote("AAPL", "20240315", "60000")
if err != nil {
    log.Fatal(err)
}
fmt.Printf("%d quotes\n", len(quotes))
cpp
// 1-minute sampled quotes
auto quotes = client.stock_history_quote("AAPL", "20240315", "60000");
std::cout << quotes.size() << " quotes" << std::endl;

Parameters

symbolstringrequired
Ticker symbol
datestringrequired
Date in YYYYMMDD format
intervalstringrequired
Sampling interval in milliseconds. Use "0" to get every quote change.
start_timestringoptional
Start time as milliseconds from midnight ET
end_timestringoptional
End time as milliseconds from midnight ET
venuestringoptional
Data venue filter

Response Fields (QuoteTick)

ms_of_dayi32
Milliseconds since midnight ET
bid_size / ask_sizei32
Quote sizes
bid_exchange / ask_exchangei32
Exchange codes
bid / aski32
Fixed-point prices. Use bid_price(), ask_price(), midpoint_price() for decoded values.
bid_condition / ask_conditioni32
Condition codes
price_typei32
Decimal type for price decoding
datei32
Date as YYYYMMDD integer

Helper methods: bid_price(), ask_price(), midpoint_price(), midpoint_value()

Notes

  • Setting interval to "0" returns every NBBO change, which can produce hundreds of thousands of rows for active symbols. Use the Rust _stream variant for large responses.
  • Python users can use the _df variant for direct DataFrame output: tdx.stock_history_quote_df(...).
  • Common intervals: "60000" (1 min), "300000" (5 min), "3600000" (1 hour).

Released under the GPL-3.0-or-later License.