There are various stock markets that are available online but among all of them, it’s hard to figure out from which site you should visit or which site will be useful.
In this article, we will be discussing the 5 best stock market APIs.
What is Stock market data API?
Real-time or historical data on financial assets that are currently being traded in the markets are offered by stock market data APIs.
Prices of public stocks, ETFs, and ETNs are specially offered by them.
- Java Database Connectivity (JDBC) Interview Questions in Java
- Python Data Persistence – Python Cassandra Driver
- Python Data Persistence SQLAIchemy
In the article, we will be more inclined towards the price information. We will be talking about the following APIs and how they are useful:
- Yahoo Finance
- Google Finance in Google sheets.
- IEX cloud
- World trading data
- Other APIs( Polygon.io, intrinio, Quandl)
1. Yahoo Finance:
The API was shut down in 2017. However, it got back up after 2019. The amazing thing is we can still use Yahoo Finance to get free stock data. It is employed by both individual and enterprise-level users.
It is free and reliable and provides access to more than 5 years of daily OHLC price data.
yFinance is the new python module that wraps the new yahoo finance API.
>pip install yfinance
The GitHub link is provided for the code but I will be attaching the code below for your reference.
Google Finance got shut down in 2012 but some features were still on the go. There is a feature in this API that supports you to get the stock market data and It is known as GoogleFinance in google sheets.
All we have to do is type the below command and we will get the data.
Furthermore, the syntax is:
GOOGLEFINANCE(ticker, [attribute], [start_date], [end_date|num_days], [interval])
The ticker is used for security consideration.
Attribute(should be “price” by default).
Start_date: when you want to fetch the historical data.
End_date: Till when you want the data.
Intervals: return data frequency which is either “DAILY” or “WEEKLY”.
2. IEX Cloud:
IEX Cloud is a new financial service just released this year. It’s an independent business separate from IEX Group’s flagship stock exchange, is a high-performance, financial data platform that connects developers and financial data creators.
It is very cheap compared to others and you can get all the data you want easily. It also provides free trial.
You can easily check it out at :
You can refer to the website:
It is the best and the leading provider of various free APIs. It provides gain to access the data related to the stock, FX-data, and cryptocurrency.
AlphaVantage provides access to 5-API request per minute and 500-API requests per day.
4. World Trading Data:
You can refer to the website for World Trading data:
In this trading application, you can access the full intraday API and currency API. The availability ranges from $8 to $32 per month.
There are different types of plans available. You can get 5-stocks per request for free access. You can get 250 total requests per day.
The response will be in JSON format and there will be no python module to wrap their APIs.
5. Other APIs:
It is only for the US stock market and is available at $199 per month. This is not a good choice for beginners.
It is only available for real-time stock data at $75 per month. For EOD price data it is $40 but you can get free access to this on different platforms. So, I guess it might not be a good choice for independent traders.
It is a marketplace for financial, economic, and other related APIs. It aggregates API from thor party so that users can purchase whatever APIs they want to use.
Every other API will have different prices and some APIs will be free and others will be charged.
Quandl contains its analysis tool inside the website which will be more convenient.
It is a platform which will be most suitable if you can spend a lot of money.
I hope you find this tutorial useful and will refer to the websites given for stock market data.
Trading is a quite complex field and learning it is not so easy. You have to spend some time and practice understanding the stock market data and its uses.