Import Data From Alpha Vantage To Google Sheets

Importdata from Alpha Vantage to Google Sheets
Reading Time: 4 minutes

Alpha Vantage provides enterprise-grade financial market data such as stock data, forex and cryptocurrency data feeds, technical and economic indicators, and also market news and sentiments through its easy-to-use APIs. Using its APIs, we can import real-time as well as historical global market data into Google Sheets.

This tutorial will guide you through how to import data from Alpha Vantage to Google Sheets using a simple and easy-to-use Google Sheets extension–Amigo Data.

Follow these steps on how to import data from Alpha Vantage to Google Sheets using API.

  1. Install the Amigo Data add-on
  2. Get your Alpha Vantage API key
  3. Choose the data endpoint to import
  4. Import the data to Google Sheets

How to import data from Alpha Vantage to Google Sheets

Let’s see how to get Alpha Vantage data to Google Sheets in four simple steps.

1. Install the Amigo Data extension

Get the Amigo Data add-on from Google Workspace Marketplace.

Amigo Data in Google Workspace Marketplace

Click here to install.

2. Get your Alpha Vantage API key

Go to alphavantage.co and click GET YOUR FREE API KEY TODAY.

Alpha vantage home page

Fill in the details and click the GET FREE API KEY button.

Getting the Alpha Vantage API key

Upon clicking the button, the API key will be generated and displayed underneath the button.

The Alpha Vantage API key

Note the key. We’ll be using it to make API calls to the Alpha Vantage.

3. Choose the endpoint for the data to import

An API endpoint is a digital location where the API receives requests and sends out responses. Each endpoint is a URL that provides the location of a resource on the API server.

To get an endpoint, go to the API documentation page by clicking Documentation. You can also click the link to go to the page.

Alpha Vantage API documentation link

On the left of the screen is a list of the available APIs. Click on the one for which you want to import the data into Google Sheets. Eg. Weekly Adjusted to get the weekly adjusted time series data–last trading of each week, weekly open, weekly close, weekly high, weekly low, weekly volume and weekly dividend–for a specified ticker.

List of APIs

Scroll to the part where examples API endpoint URLs are given. We can modify the endpoint using the parameters mentioned immediately above.

Sample endpoint URLs

For example, to retrieve the weekly adjusted time series data for Tesla, we use the following endpoint URL.

https://www.alphavantage.co/query?function=TIME_SERIES_WEEKLY_ADJUSTED&symbol=TSLA&apikey=YOUR_API_KEY

The endpoints by default return only the latest 100 results. To retrieve all the available historical data, specify it by using the outputsize parameter, ie, outputsize=full.

So the modified endpoint URL becomes

https://www.alphavantage.co/query?function=TIME_SERIES_WEEKLY_ADJUSTED&symbol=TSLA&apikey=YOUR_API_KEY&outputsize=full

Note: Each query parameter must be separated by an ampersand (&).

Do not forget to replace YOUR_API_KEY in the URL with your own key.

4. Import the data to Google Sheets

Open Google Sheets and launch Amigo Data from the Extensions tab.

Open Amigo Data from Google Sheets

Select Custom API from the list of sources.

Select Custom API as the source to connect

Paste the complete endpoint URL in the API URL field.

Paste the endpoint

Click the PREVIEW button. The preview of the data will appear in a short while depending on the size of the dataset.

Flatten and expand the nested data points. Then click IMPORT.

Preview and flattening the data to import

Upon clicking the import button, the data for the selected endpoint will be imported from Alpha Vantage to Google Sheets.

Snippet of the imported data

To import data for a different company, change the ticker symbol to that for the particular company. To import the data for a company listed outside of the US, we need to specify the exchange symbol too.

For example, to retrieve the intraday data with 5 minutes interval for Shell which is listed primarily in the London Stock Exchange, we’d use the formula endpoint URL. (SHEL is the ticker symbol and LON is the exchange symbol)

Check the Alpha Vantage API documentation for all the various data that you can retrieve and other details.

The imported data can be updated automatically, if you set it so, at regular intervals–hourly, daily, weekly, or on certain days of the week. To learn how to set a refresh schedule and receive alerts of the imported data to your email or a Slack channel so that you always have the latest information at your fingertips, click here.

See also

This is how you can integrate Alpha Vantage To Google Sheets. There are several types of data that you can import to Google Sheets from various sources using the Amigo Data add-on. A few examples are Indian government Open Data, Wikipedia data, Reddit Data, AccuWeather, and Binance. Visit our blog for a full list of the articles.

Here are some similar articles that you may be interested in:

https://blog.tryamigo.com/import-yahoo-finance-data-into-google-sheets/

https://blog.tryamigo.com/import-td-ameritrade-data-to-google-sheets/

https://blog.tryamigo.com/import-data-from-nasdaq-to-google-sheets/

https://blog.tryamigo.com/import-nse-data-to-google-sheets/