This article covers how to automate exchange rate data imports to Google Sheets to fetch real-time data. With the ExchangeRate API, you can import accurate and reliable data in just a few seconds.
Importing data manually can be a tedious task. However, it need not remain so. Using Amigo Data, you can easily connect to the data source and import the data into Google Sheets and get them updated automatically.
Steps to import Air Quality data to Google Sheets:
- Install the Amigo Data add-on
- Get the ExchangeRate API key
- Choose the data endpoint
- Import data to Google Sheets
How to automate Exchange Rate data imports to Google Sheets
Here’s the step-by-step guide to import the ExchnageRate API data to Google Sheets
Step 1: Install the Amigo Data add-on
Install the Amigo Data Google Sheets add-on from the Google Workspace Marketplace.
Click here to install.
Alternatively, you can get it from Google Sheets.
- Open a new sheet
- Go to Extensions→Add-ons→Get add-ons
- Search for Amigo Data and install
Step 2: Generate the API key
In order to access the ExchangeRate API data, we’ll need a key called the API key. It is a code used to identify and authenticate access.
Follow the steps below to get an API key from the ExchangeRate.
Visit the ExchangeRate API website and enter your email address to generate a free API key
Enter your credentials and sign up for a free API key
Your account will be created after you click on the activation link sent to you via mail
You will be logged in and redirected to the page where you can see your API key
Step 3: Choose an endpoint
Refer to the ExchangeRate API documentation to explore all the endpoints. For this tutorial, we will import pair conversion data. We will convert 100 USD to INR. So, select the Pair Conversion option.
Scroll a bit and you will come across the following endpoint URL. Copy the URL.
We need to customize the following API endpoint URL to be able to fetch the relevant data. You can find here the list of supported currencies along with their valid codes.
Sample URL:
https://v6.exchangerate-api.com/v6/YOUR-API-KEY/pair/EUR/GBP
In the sample URL, EUR and GBP are the currency pair. EUR is the base currency (the currency that we want to convert) and GBP is the target currency (the currency that we want to convert to)
We will modify EUR to USD and GBP to INR as we wish to convert USD to INR. The modified URL should look like this:
https://v6.exchangerate-api.com/v6/YOUR-API-KEY/pair/USD/INR
If you wish to convert any given amount from one currency to another. Then simply append the amount to the URL link after using a ‘/’. The amount is accepted in decimal format (XXXX.XXXX). For converting $100 to INR, the URL link should look like this:
https://v6.exchangerate-api.com/v6/YOUR-API-KEY/pair/USD/INR/100
Copy the modified URL
Note: The URL must not contain any spaces
Step 4: Import the Conversion rate data to Google Sheets
Go back to Google Sheets and launch the Amigo Data extension.
Select Custom API from the list of sources
Paste the endpoint in the API URL bar
Then click the PREVIEW button
Flatten the data points and then click IMPORT.
A snippet of imported data
You can likewise import other types of data from the ExchangeRate API. Following are some other examples.
Historical Data
https://v6.exchangerate-api.com/v6/YOUR-API-KEY/history/USD/YEAR/MONTH/DAY
You can import historical exchange rate data using the historical data endpoint URL. It imports exchange rate data against all the currencies for a particular date. You can find this in the list of endpoints. For example, if we wish to import USD exchange rate data on 01/01/2020, the modified URL should look like this:
https://v6.exchangerate-api.com/v6/YOUR-API-KEY/history/USD/2020/01/01
On the ExchangeRate documentation page, you can explore more endpoints and try them out.
After importing the data, you can also set a refresh schedule so that the data are updated automatically at regular intervals. To learn how to set a refresh schedule, follow this link.
There are several other types of data that you can import into Google Sheets using Amigo Data such as Marketstack data, Coinmarketcap data, Nasdaq data, and many more.
Some related articles you may be interested in:
https://blog.tryamigo.com/get-real-time-stock-data-in-google-sheets/
https://blog.tryamigo.com/import-coinmarketcap-data-to-google-sheets/
https://blog.tryamigo.com/import-data-from-nasdaq-to-google-sheets/