I think the simplest way to do this in Python is with Databento's API.
import databento as db
client = db.Historical()
data = client.timeseries.get_range(
dataset='GLBX.MDP3',
schema='definition',
start='2022-10-10',
end='2022-10-10',
)
df = data.to_df()
print(df[['symbol', 'expiration']])
This gets you the expirations for all symbols (617,090 in total) that were active on a specific historical date (2022-10-10).
symbol expiration
ts_recv
2022-10-10 00:00:00+00:00 OSXG3 P9850 2022-12-22 19:30:00+00:00
2022-10-10 00:00:00+00:00 AAOJ4 C5950 2024-04-30 18:30:00+00:00
2022-10-10 00:00:00+00:00 7FV3-7FG4 2023-10-11 15:30:00+00:00
2022-10-10 00:00:00+00:00 WAYZ2 P-150 2022-11-18 19:30:00+00:00
2022-10-10 00:00:00+00:00 AHMG4 2024-02-01 04:59:00+00:00
... ... ...
2022-10-10 23:58:50.142534786+00:00 UD:1V: BX 1011861394 2022-10-11 20:00:00+00:00
2022-10-10 23:59:03.453690873+00:00 UD:1V: VT 1011861395 2022-10-14 21:59:00+00:00
2022-10-10 23:59:05.521727212+00:00 UD:EN: GN 1011861396 2022-10-14 20:00:00+00:00
2022-10-10 23:59:18.036952193+00:00 UD:1V: BX 1011861397 2022-10-11 20:00:00+00:00
2022-10-10 23:59:51.703175001+00:00 UD:1V: BX 1011861398 2022-10-11 20:00:00+00:00
[617090 rows x 2 columns]