Alpha Vantage provides enterprise-grade financial market data through a set of powerful and developer-friendly APIs. We can use the Alpha Vantage API to import data from Alpha Vantage into Google Sheets. In this tutorial, I’ll show you how to connect the Alpha Vantage REST API to Google Sheets in 5 steps:
To pull data from the Alpha Vantage API to Google Sheets, first install and open the Apipheny Google Sheets add-on.
Apipheny is a no-code API integrator for Google Sheets that you can use to make unlimited API requests, connect to unlimited APIs, save API requests, schedule API requests, and more.
1. Install Apipheny by opening the following link on desktop and then clicking the Install button on the page: https://apipheny.io/install.
2. After you’ve installed Apipheny, open a Google Sheet and then click on the Add-Ons or Extensions option in the top menu. In the add-ons menu, you should see Apipheny.
Click Apipheny > Import API to open the Apipheny sidebar in your Google Sheets.
Go to https://www.alphavantage.co/ and click the GET YOUR FREE API KEY TODAY button:
In the Claim your Free API Key section, complete all the fields and then click the GET FREE API KEY button:
Your API key will be displayed on the net window:
Copy it to a safe location because you’ll need it later.
In this section, I’ll show you how to browse the Alpha Vantage API documentation to find an API endpoint URL that retrieves the specific information you need from your Alpha Vantage account. If you already know your API URL, or you want to use the same example URL as us, just skip to Step 4.
First, open the Alpha Vantage API documentation page: https://www.alphavantage.co/documentation/
The menu on the left contains general information about the Alpha Vantage API and a list of APIs, each with its endpoints:
For example, the Fundamental Data API has 8 endpoints: Company Overview, Earnings, Income Statement, Balance Sheet, Cash Flow, Listing & Delisting Status, Earnings Calendar and IPO Calendar.
An example endpoint is Company Overview that returns the company information, financial ratios, and other key metrics for the equity specified:
Don’t forget to replace demo with your API key!
The documentation for this endpoint contains the API parameters, the endpoint URL and the Language-specific guides:
Okay, we’re in the home stretch. Now go back to your Google Sheet and make sure that the Apipheny add-on is open on the “Import” tab. With the Import Tab open, enter these details into the add-on:
API URL: In Step 3, I explained how you can find the Alpha Vantage API endpoint that you need. Now copy the complete API URL into the Apipheny add-on, where it says API URL Path (JSON / CSV), followed by any GET parameters required for your query.
For this example, we are using the TIME_SERIES_INTRADAY endpoint that returns intraday time series of the equity specified, covering extended trading hours where applicable. The corresponding URL for this endpoint is:
Don’t forget to replace api_key with you previously obtained API key at Step 2.)
Headers aren’t required.
The last step is to click the Run button at the bottom of the Apipheny add-on and then your Alpha Vantage data will be imported into your Google Sheet.
After making a successful request to the Alpha Vantage API, try querying a different Alpha Vantage API endpoint, or try using one of the more advanced features in the Apipheny add-on, such as: