DiscoverAsync FinanceGet Historical Option Price Data In Python From Polygon.io API
Get Historical Option Price Data In Python From Polygon.io API

Get Historical Option Price Data In Python From Polygon.io API

Update: 2022-12-16
Share

Description

Here's a fast and free way to get historical option price data; it's easy to get all the option data you might need in Python from the Polygon.io API.   


Here's all the code from the video  


https://github.com/AdamGetbags/polygonData/blob/main/historicalOptionDataPolygon.py https://github.com/AdamGetbags/polygonData/blob/main/polygonAPIkey.py 


0:32 open the docs 


0:50 create a Polygon.io account and subscribe to free basic plan 


1:25 pip install polygon-api-client 


1:34 import modules 


1:46 get API key from Polygon.io into python 


2:19 authenticate your client with API key 


2:34 request contract data for every available option by underlying 


3:35 BEWARE of the rate limit 


3:49 extract the individual contract data 


4:17 assign option ticker to variable using individual contract data 


4:30 create a request for OHLC option data  


5:07 define frequency and periodicity of bars 


5:30 get historical option price data  


5:37 format to dataframe, reformat timestamp, and set index 


6:24 plot a candlestick chart  


The Polygon.io API features a ton of useful methods for getting stock, option, cryptocurrency, and forex data in a bunch of different programming languages.


- - -


Follow the podcast and join our larger community on Youtube to receive value on all things finance and technology!


https://www.youtube.com/c/adamgetbags


If you love the content, buy me a coffee!


https://www.buymeacoffee.com/adamgetbags


Keep up with me!


https://www.instagram.com/damgetbags


https://twitter.com/damgetbags


- - -


Need some ideas for your project portfolio?


Check out how to get historical option price data in Python from the Polygon API.


https://youtu.be/87O9qxfMJ-g


Here's how to quickly get crypto data in Python from the CoinGecko API


https://youtu.be/4-CC3u4i73k


Here's how to create a SQL database from a Pandas DataFrame in Python


https://youtu.be/9IPlc-nKD1k


- - -


DISCLAIMER: The Information on Async Finance is provided for education and informational purposes only, without any express or implied warranty of any kind, including warranties of accuracy, completeness, or fitness for any particular purpose. The Information contained in or provided from or through Async Finance is not intended to be and does not constitute financial advice, investment recommendations, investment advice, trading advice, or any other advice. The Information on Async Finance is general in nature and is not specific to you the User or anyone else. You should not make any decision, financial, investment, trading, or otherwise, based on any of The Information presented on Async Finance without undertaking independent due diligence and consultation with a professional broker or financial advisory.

Comments 
In Channel
loading
00:00
00:00
x

0.5x

0.8x

1.0x

1.25x

1.5x

2.0x

3.0x

Sleep Timer

Off

End of Episode

5 Minutes

10 Minutes

15 Minutes

30 Minutes

45 Minutes

60 Minutes

120 Minutes

Get Historical Option Price Data In Python From Polygon.io API

Get Historical Option Price Data In Python From Polygon.io API

Adam Getbags