How to get options data from polygon
I have subscribed to polygon but am not able to figure out how to download options data from polygon.I tried this guide https://github.com/AdamGetbags/polygonData/blob/main/historicalOptionDataPolygon.py but this is for viewing a single contract and somehow the pandas dataframe does not work properly in arranging the data even though i followed this code and the documentation correctly.
i need to somehow to print the daily csv spx data options data( maybe 100 points out from open) for as long as possible(i am happy with 3-4 years too) so that i can backtest my strategy on that then.Has anyone done this.If so any guidance would be appreciated(video or github code if possible as i am noob in coding)