Replacing Yahoo Finance with the IEX API and Alpha Vantage in Google Sheets
For those of you that make use of the Yahoo Finance API, I’m sure you are all aware of the recent shutdown.
I have found a solution which completely replaces Yahoo Finance and provides all of the same functionality plus gives room for a ton of expansion in the future. I’ve switched over to using the free data available at IEX. If you are a user of my free dividend tracking spreadsheet on Google Sheets, this IEX integration is included in the latest version. IEX, at this time, only provides data for US traded stocks. The spreadsheet has been updated to also support some international stocks through the Alpha Vantage API.
For information on how to use Alpha Vantage in this spreadsheet, please refer to Step 3 below.
Here’s how to start using it yourself:
After copying the IMPORTJSON code into your script editor, here’s how you use it:
Latest stock price:
Dividend pay date:
I’ve had a few requests to add support for looking up international stocks, specifically on the Canadian exchanges. IEX works great for US stocks, but does not provide any stock data from international exchanges. After reviewing a few websites, someone made an excellent script to use the Alpha Vantage API to lookup the latest stock price for stocks on other exchanges.
I’ve implemented these changes in the latest version. The spreadsheet will first try the IEX API. If that fails, then it will default to looking up the latest price information from the Alpha Vantage API. As always, any manually entered stock price and/or dividend amount will override the data obtained from IEX or Alpha Vantage.
a) First make sure you have the latest PortfolioTracker script (Tools > Script editor).
b) Get your free API key from Alpha Vantage. This key, which you will get instantly on the website, then gets pasted between the quotes replacing the “PUT YOUR API KEY HERE” text on the script.
c) Make sure to type in the ticker symbols using the appropriate notation. TSX:TD (for Toronto-Dominion Bank, as an example)
Latest dividend amount: this functionality is not yet available on Alpha Vantage. I will update this post when it becomes available.