If you are looking for stock data and, more specifically, the Google finance API, this guide is for you. You will learn how to get real-time and historical stock data for any company traded on major global exchanges. Whether you are looking to get this data in Google Sheets or Excel, we have you covered. Let's get started!
What is the Google Finance API, and what can it be used for?
The Google Finance API was an application programming interface designed around Google Finance that allowed developers and any other users to access stock data included on the Google Finance website. The stock data available through this API was quite comprehensive, with coverage for almost all major global exchanges and stocks.
Is the Google Finance API shutdown?
As of March 2022, this API is deprecated and no longer available for public use.
Don't worry, though, as there are other viable APIs and no code alternatives to get all the stock data you need without the hassle of wasting time copy-pasting this data or doing any other ineffective methods. We will go through the main ones in this guide.
Alternatives to the Google Finance API
Yfinance is one of the most popular Google Finance API alternatives because of the extensive data availability and simplicity of use with the Python programming language.
The project is open source and is quite simple to get started with using the pip install yfiannce command (Python installation is required.)
You can navigate to see the documentation of this project here. Generally, the library is easy to use, with the ticker object being the main way to retrieve all stock data available.
The main downside of this method is that the data comes from the Yahoo Finance website, which may be incomplete or inaccurate, but most importantly, the data retrival is limited, and you can be backlisted for making too many simultaneous data requests.
You may also encounter some difficulties getting the specific data you are looking for, as you need to use quite a bit of data slicing to get to the right data frame.
Financial Modelling Prep
If you read our guide on the best stock data APIs, you know FMP is one of the best APIs you can use. The data available is quite extensive, covering all types of data, including news, analyst ratings, and financials among many more (see API documentation).
Using your favorite programming language, you can make sure to get only the stock data you are looking for and build custom applications, dashboards, etc.
The main downside of using this API provider is the monthly cost which comes at a minimum of $19/month which can be quite steep for individual investors and traders.
If you would like o get access to this API for a special price, then don't hesitate to email us at firstname.lastname@example.org with the subject discount to get a special price.
No code API
If you would like to get stock data in your Excel and Google Sheet spreadsheet without the hassle of coding, the best option is to use the Wisesheets add-on.
Using simple formulas, you can get the stock data you need for your analysis so you can easily compare and visualize hundreds of stocks at once in a simple view.
Better yet, you can use pre-built stock analysis models built by the community to get inspiration and your analysis done in a fraction of the time.
The data covered through the add-on includes; real-time price data, historical stock financials, key metrics, historical price data, dividend data, and more (see full data available).
The price for this option is quite affordable at $60 per year. The main downside is the fact that if you are looking to build custom applications that require a lot of data or you are looking to train machine learning models, this is not the most optimal solution in terms of programmatic data retrieval.
Which API is best for your needs?
The best API heavily depends on your needs. If you are just starting out and want to build a simple application using programming Yfinance is the best choice as it is free and simple to get started for Python programmers. If you require a lot of data to train large machine learning models or build finance applications, then FMP is the best opinion for you. Lastly, if you are an individual investor looking to access data easily in Excel for analyzing many stocks at once across fundamentals, then Wisesheets is the best tool for you.
How to make a request to the API
Making API requests varies depending on the option you choose. For FMP, all you need to do is enter the custom endpoint of the data you are looking for based on the documentation, and you will get all the stock data you need in the JSON format. For example, to get stock financials, you would need to enter the following URL (https://financialmodelingprep.com/api/v3/income-statement/AAPL?limit=120&apikey=) along with your API key.
On the other hand, for Yfinance, once you install the Python module, all you have to do is use the ticker as the python object from which you can get stock data. For example, to get the balance sheet for Apple you need to enter the following code:
import yfinance as yf aapl = yf.Ticker("AAPL") aapl.balance_sheet
Using Wisesheets, you can enter the company ticker on the statement dump function like this:
Or use the =WISE function to get only the data you need.
The different types of data that can be accessed through the API
Yfinance covers most data available through yahoo finance, including dividend data, historical stock price data, fundamentals, etc. You can see all the data covered here in the documentation.
FMP covers a more extensive data set that includes all of the above data and a lot more, including SEC as reported data, sentiment data, esg ratings, mutual fund holdings, and more.
Wisesheets is focused on simplicity and ease of use therefore, the data includes all the most important analysis data points such as historical stock financials, key metrics, dividend data, live price data, and more.
The Google Finance API is no longer available. Therefore it is best to choose from one of the API options mentioned. When it comes to choosing from the options available, there is no one size fits all. It really depends on your needs as an investor or developer. If you are just starting out and you have programming skills, then Yfinance is a great free option. If you need more data or speed, then FMP is the best choice. Lastly, if you want to use Excel to build powerful stock analysis models, then Wisesheets is the best tool for you.
No matter what your needs are, there is an API out there that can help you get the stock data you need.
You have brought up a very excellent points, thanks for the post.
Thank you, glad you enjoyed it.