Skip to content

index_history_price

FreeValueStandardPro

Retrieve intraday price history for an index on a single date at a specified interval.

Code Example

rust
let data = tdx.index_history_price("SPX", "20260315", "60000").await?;
for t in &data {
    println!("date={} ms_of_day={} price={:.2}", t.date, t.ms_of_day, t.price);
}
python
data = tdx.index_history_price("SPX", "20260315", "60000")
for t in data:
    print(f"date={t.date} ms_of_day={t.ms_of_day} price={t.price:.2f}")
typescript
const data = tdx.indexHistoryPrice('SPX', '20260315', '60000');
for (const t of data) {
    console.log(`date=${t.date} ms_of_day=${t.ms_of_day} price=${t.price}`);
}
cpp
auto data = client.index_history_price("SPX", "20260315", "60000");
for (const auto& t : data) {
    printf("date=%d ms_of_day=%d price=%.2f\n", t.date, t.ms_of_day, t.price);
}

Parameters

symbolstringrequired
Index symbol (e.g. "SPX")
datestringrequired
Date in YYYYMMDD format
intervalstringrequired
Accepts milliseconds ("60000") or shorthand ("1m"). Valid presets: 100ms, 500ms, 1s, 5s, 10s, 15s, 30s, 1m, 5m, 10m, 15m, 30m, 1h.
start_timestringoptional
Start time of day as milliseconds from midnight
end_timestringoptional
End time of day as milliseconds from midnight

Response

Returns an array of PriceTick records with price and time fields:

pricef64
Index price/level
ms_of_dayu32
Milliseconds from midnight ET
dateu32
Date as YYYYMMDD integer

Sample Response

json
[
  {"date": 20260402, "ms_of_day": 34200000, "price": 6820.51},
  {"date": 20260402, "ms_of_day": 34260000, "price": 6828.42},
  {"date": 20260402, "ms_of_day": 34320000, "price": 6834.15}
]

SPX intraday price history at 1-minute intervals. Requires Value subscription.

Notes

Released under the Apache-2.0 License.