option_history_open_interest
FreeValueStandardPro
Retrieve open interest history for an option contract.
Code Example
rust
let data = tdx.option_history_open_interest("SPY", "20260417", "550", "C", "20260315").await?;
for t in &data {
println!("date={} open_interest={}", t.date, t.open_interest);
}python
data = tdx.option_history_open_interest("SPY", "20260417", "550", "C", "20260315")
for t in data:
print(f"date={t.date} open_interest={t.open_interest}")typescript
const data = tdx.optionHistoryOpenInterest('SPY', '20260417', '550', 'C', '20260315');
for (const t of data) {
console.log(`date=${t.date} open_interest=${t.open_interest}`);
}cpp
auto data = client.option_history_open_interest("SPY", "20260417", "550", "C", "20260315");
for (const auto& t : data) {
printf("date=%d open_interest=%d\n", t.date, t.open_interest);
}Parameters
symbolstringrequiredUnderlying symbol
expirationstringrequiredExpiration date in
YYYYMMDD formatstrikestringrequiredStrike price in dollars as a string
rightstringrequired"C" for call, "P" for putdatestringrequiredDate in
YYYYMMDD formatmax_dteintoptionalMaximum days to expiration
strike_rangeintoptionalStrike range filter
Response
open_interestintOpen interest
datestringDate
Sample Response
json
[
{"date": 20260401, "open_interest": 28},
{"date": 20260402, "open_interest": 32}
]Daily open interest for a specific option contract.
Notes
- Open interest is typically reported once per day based on the previous day's settlement.