Skip to content

Price

FreeValueStandardPro

Get the latest price snapshot for one or more indices.

  • Retrieves a real-time last index price.
  • Exchanges typically generate a price report every second for popular indices like SPX.
rust
pub fn index_snapshot_price(&self, symbols: &[&str]) -> IndexSnapshotPriceBuilder<'_>

Optional parameters chain on the builder: .min_time(&str). Execute with .awaitResult<Vec<PriceTick>, Error>, or decode chunk-by-chunk with .stream(handler).

Example

rust
let rows = tdx.index_snapshot_price(&["SPX"]).await?;
for t in &rows {
    println!("date={} ms_of_day={} price={}", t.date, t.ms_of_day, t.price);
}

Parameters

NameTypeRequiredDefaultDescription
symbolsymbolsyesComma-separated ticker symbols (e.g. AAPL,MSFT)
min_timestringnoMinimum time filter
timeout_msintnoPer-request deadline in milliseconds. 0 means no deadline.

Response

Rows of PriceTick:

FieldTypeDescription
ms_of_dayi32Milliseconds since midnight Eastern Time.
pricef64Index value.
datei32Trading date as a YYYYMMDD integer.

Released under the Apache-2.0 License.