Skip to content

stock_snapshot_trade

Latest trade snapshot for one or more stocks. Returns the most recent trade execution for each symbol.

FreeValueStandardPro

Code Example

rust
let data = tdx.stock_snapshot_trade(&["SPY"]).await?;
for t in &data {
    println!("date={} ms_of_day={} price={:.2} size={} exchange={} condition={}",
        t.date, t.ms_of_day, t.price, t.size, t.exchange, t.condition);
}
python
data = tdx.stock_snapshot_trade(["SPY"])
for t in data:
    print(f"date={t.date} ms_of_day={t.ms_of_day} price={t.price:.2f} "
          f"size={t.size} exchange={t.exchange} condition={t.condition}")
typescript
const data = tdx.stockSnapshotTrade(['SPY']);
for (const t of data) {
    console.log(`date=${t.date} ms_of_day=${t.ms_of_day} price=${t.price} size=${t.size} exchange=${t.exchange} condition=${t.condition}`);
}
cpp
auto data = client.stock_snapshot_trade({"SPY"});
for (const auto& t : data) {
    printf("date=%d ms_of_day=%d price=%.2f size=%d exchange=%d condition=%d\n",
        t.date, t.ms_of_day, t.price, t.size, t.exchange, t.condition);
}

Parameters

symbolsstring[]required
One or more ticker symbols
venuestringoptional
Data venue filter
min_timestringoptional
Minimum time of day as milliseconds from midnight ET

Response Fields (TradeTick)

ms_of_dayi32
Milliseconds since midnight ET
sequencei32
Sequence number
ext_condition1 through ext_condition4i32
Extended trade condition codes
conditioni32
Trade condition code
sizei32
Trade size in shares
exchangei32
Exchange code
pricef64
Trade price (decoded at parse time).
condition_flagsi32
Condition flags bitmap
price_flagsi32
Price flags bitmap
volume_typei32
0 = incremental volume, 1 = cumulative volume
records_backi32
Records back count
datei32
Date as YYYYMMDD integer

Helper methods: is_cancelled(), regular_trading_hours(), is_seller(), is_incremental_volume()

Sample Response

json
[
  {"date": 20260402, "ms_of_day": 71983113, "price": 255.35, "size": 50, "exchange": 0, "condition": 1},
  {"date": 20260402, "ms_of_day": 71998357, "price": 655.94, "size": 50, "exchange": 0, "condition": 1}
]

Notes

  • Accepts multiple symbols in a single call.
  • All price fields are f64 -- decoded during parsing.

Released under the Apache-2.0 License.