The financial APIs market grows so quickly that last year’s post or platform is not a good choice this year. So in this story, I will show you the best 5 stock market APIs that I use in 2019.
Stock market data APIs offer real-time or historical data on financial assets that are currently being traded in the markets. These APIs usually offer prices of public stocks, ETFs, ETNs.
These data can be used for generating technical indicators which are the foundation to build trading strategies and monitor the market.
In this story, I mainly care about price information. For other data, there are some other APIs mainly for that use cases which will not be covered here.
I will talk about the following APIs and where they can be used:
- Yahoo Finance
- Google Finance in Google Sheets
- IEX Cloud
- AlphaVantage
- World trading data
- Other APIs (Polygon.io, Intrinio, Quandl)
Docs: yfinance
Yahoo Finance API was shut down in 2017. So you can see a lot of posts about alternatives for Yahoo Finance. However, it went back sometime in 2019. So you can still use Yahoo Finance to get free stock market data. Yahoo’s API was the gold standard for stock-data APIs employed by both individual and enterprise-level users.
Yahoo Finance provides access to more than 5 years of daily OHLC price data. And it’s free and reliable.
There’s a new python module yfinance that wraps the new Yahoo Finance API, and you can just use it.
# To install yfinance before you use it.
> pip install yfinance
Below is an example of how to use the API. Check out the Github link above to see the full document, and you are good to go.