@Wayne, I think you are well-versed in Python. Yahoo! is funny about their quotes, as I use ^GSPC to get historical SPX equivalents, but I look under ^SPX for option chains. There's no history on the index there, only a daily quote.
Here's a snippet of Python script that pulls historical option data for SPX. In this example, it's the
SPXW230203C04020000, AKA the Weekly Feb 3rd 4020 Call option. Perhaps this will be useful if you add on some iterations through the Expirations and Strikes of interest to pull history:
Python Code:
import time as tm
import datetime as dt
import pandas as pd
# period1 = int(tm.mktime(dt.datetime(2005, 1, 1, 23, 59).timetuple()))
period1 = int(tm.mktime(dt.datetime(2023, 1, 1, 23, 59).timetuple()))
period2 = int(tm.mktime(dt.datetime.now().timetuple()))
interval = '1d' # 1m, 1wk
path = r'C:\\Users\\daven\\Downloads\\'
# -- Quotes for SPX -- ****************************************************************
ticker = 'SPXW230203C04020000'
query_string = f'
https://query1.finance.yahoo.com/v7/finance/download/{ticker}?period1={period1}&period2={period2}&interval={interval}&events=history&includeAdjustedClose=true'
# Load DataFrame
df = pd.read_csv(query_string)
print(df)
Output:
