Import Data From Alpha Vantage To Google Sheets

Importdata from Alpha Vantage to Google Sheets
Reading Time: 5 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 Alpha Vantage 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 data automation tool called Amigo Data with Alpha Vantage API.

In the snippet below, we have the quarterly income statement of Tesla imported to Google Sheets with the Alpha Vantage API.

Quarterly income statement of Tesla with Alpha Vantage API

Follow these steps on how to import data from Alpha Vantage to Google Sheets using Alpha Vantage 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 to import data from Alpha Vantage to Google Sheets using Alpha Vantage API.

Click here to install.

Install Amigo to import data from Alpha Vantage to Google Sheets

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 to claim your Alpha Vantage API key.

Getting the Alpha Vantage API key

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

The Alpha Vantage API key

Note the key. We’ll be using it to retrieve data from Alpha Vantage API.

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 Alpha Vantage API endpoint, go to the Alpha Vantage 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 Alpha Vantage API documentation is a list of the available stock APIs. There are various types of APIs available, such as Forex APIs, Fundamental Data APIs, Cryptocurrencies APIs, and Technical Indicators APIs among others.

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.

Alpha Vantage API documentation

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

Sample Alpha Vantage API 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:
1. Each query parameter must be separated by an ampersand (&).
2. Replace YOUR_API_KEY in the URL with your Alpha Vantage API key.

4. Import the data to Google Sheets

Open Google Sheets and launch Amigo Data from the Extensions tab to import data from Alpha Vantage to Google Sheets.

Open Amigo Data to pull data from Alpha Vantage to Google Sheets

Select Custom API from the list of sources.

Select Custom API as the source to connect

Enter the Alpha Vantage API endpoint URL in the API URL field.

Enter the Alpha Vantage API URL

Click the PREVIEW button to retrieve the data from Alpha Vantage. 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 from Alpha Vantage to Google Sheets

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

Set a refresh schedule so that the imported data get updated automatically 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 stock API with Google Sheets using Alpha Vantage API. 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.


FAQs

Getting Alpha Vantage API Indian stocks is no different from American stocks. You only need to insert the ticker symbol for the Indian stock that you want to retrieve the data, and then use the Alpha Vantage API endpoint URL to import the data into Google Sheets using Amigo.

Note however that the stock prices are quoted in US dollar and not rupee.

Alpha Vantage uses the stock exchanges’ ticker symbols and does not have its own stock symbols.

There are plenty of stock market APIs that we can use to fetch data from Indian stock markets. Some popular ones are Alpha Vantage, Yahoo Finance, EOD Historical Data, Twelve Data, etc. These are free for limited use and allow us to retrieve stock data of Indian companies.

You can pull intraday data from NSE and BSE to Google Sheets using Alpha Vantage API. Go to the Alpha Vantage API documentation and select the Intraday endpoint from Core Stock APIs. Then enter the stock symbol for which you want to get intraday data in the symbols parameter. Use Amigo to pull the data to Google Sheets.

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

Import Yahoo Finance data to Google Sheets

Import TD Ameritrade data to Google Sheets

Import data from Nasdaq to Google Sheets

Import NSE data to Google Sheets

Import NSE Data to Google Sheets and Auto-update the Data

Leave a Reply