I can pull an option chain to get a glance of it (e.g. with quantmod::getOptionChain("SPY", Exp="2023-07-28")
), but it won't tell me what date those prices were from.
Is there a lesser-known option that allows me to request the trade-date information from Yahoo?
I don't want to do something like Sys.Date() - 1
and then start checking if the market was open on that date, or if Yahoo doesn't have information from that date, etc. etc.
Yahoo doesn't provide historical option chain data via their API. So the prices are as-of the LastTradeTime
column in the output. I haven't used ORATS or getOptionChain.orats()
, but you might be able to get historical data that way. You'd need to sign up and at least get an API key. Historical data may not be free.