Stock Market APIs and Financial Data using Polygon.io

If you’ve ever thought about using your Computer Science education to explore stock market, forex, or crypto data, getting started may seem like a daunting task.  This tutorial series is meant to help you overcome some of the obstacles to getting started, and introduce you to new tools and platforms that will help you on your path to building market data software.

We will be using Polygon.io, a financial data platform that provides real-time and historical stock market APIs, forex, and crypto data, to retrieve recent stock prices through their RESTful APIs.  To get started, you will need to sign up for an account.  This will give you access to a free API key that can be used to get stock, forex, or crypto data from their REST endpoints, which are documented here.  Once you have created an account, go to your user dashboard, and copy your default API key to your clipboard.  Take the following url https://api.polygon.io/v2/aggs/ticker/AAPL/range/1/day/2020-06-01/2020-06-17?apiKey=YOURKEY, and replace YOURKEY with the free Polygon.io API key you generated in the last step.  Take the resulting url (now containing your API Key), and paste it in the URL bar of a new tab in your browser.  You should see a JSON response, with aggregate stock market data for Apple (Ticker symbol AAPL), containing the open, close, high, and low stock price for each day during the date range requested.  You can find more information on the response data in the documentation for that REST endpoint, and you can also find a useful glossary of stock market and financial terms here.  You may also want to use a programming language like Python or Javascript to retrieve your stock data, or download an API Client like Postman.

In the next post, we look at graphing our aggregate stock market data using React.