How to connect an Exchange Rates API to Google Sheets

Exchangeratesapi.io is one of the most scalable APIs for obtaining current and historical exchange rates. We can use this API to import exchange rate data into Google Sheets. In this tutorial, we’ll show you how to connect ExchangeRatesAPI.io to Google Sheets in 5 steps:

  1. Install the Apipheny add-on
  2. Obtain an access key
  3. Choose a Exchangerates API Endpoint URL
  4. Enter the Exchangerates API Request into the Apipheny add-on
  5. Run the Exchangerates API Request in your Google Sheets

Step 1.) Install and open the Apipheny add-on in Google Sheets

To pull data from the Exchange Rates API into 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:

Opening the Apipheny add-on in Google Sheets
Opening the Apipheny add-on in Google Sheets

Step 2.) Sign up for the API and obtain an access key

First, sign up for ExchangeRatesAPI.io. There’s a free plan available.

After signing up for the API, your access key will be displayed on the dashboard screen:

Exchangerates dashboard
Exchangerates dashboard

Copy and paste your key to a safe location because you’ll need it in the next steps.

Step 3.) Choose a ExchangeRatesAPI Endpoint

In this section, we’ll show you how to browse the ExchangeRatesAPI documentation to find an API URL and endpoint that retrieves the specific exchange rate information you need. 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 ExchangeRatesAPI documentation page: https://exchangeratesapi.io/documentation/

The menu on the left contains basic information about the ExchangeRates API and a list of API endpoints available:

Exchangerates API documentation page
Exchangerates API documentation page

In this example, we will describe the Time-Series Endpoint, which lets you query the API for daily historical rates between two dates of your choice, with a maximum time frame of 365 days (if supported by your subscription plan). The URL for this endpoint is:

https://api.exchangeratesapi.io/v1/timeseries?access_key=API_KEY&start_date=START_DATE&end_date=END_DATE

The documentation for this endpoint contains a short description of the endpoint’s purpose, an example request, the accepted path parameters and the responses it can return:

Time-Series Endpoint documentation
Time-Series Endpoint documentation

All API calls to the Exchange Rates API should be made using the https://api.exchangeratesapi.io/v1/ base domain. All endpoints and parameters should be appended to this base domain.

Step 4.) Enter the ExchangeRatesAPI Request into the Apipheny add-on

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:

Method: At the top of the Apipheny sidebar, select the HTTP method (GET or POST) as required by your endpoint. For this example, we are using the GET method.

API URL: In Step 3, we explained how you can find the Exchange Rates API endpoint that you need. Now copy the complete API URL into the Apipheny add-on, where it says API URL Path, followed by any GET parameters required for your query.

For this example, we are using the Latest endpoint that requests the most recent exchange rate data. The corresponding URL for this endpoint is:

 http://api.exchangeratesapi.io/v1/latest?access_key=ACCESS_KEY

If you use this URL, don’t forget to replace ACCESS_KEY with the access key you previously obtained in Step 2.

Headers: Headers are not required for this API request. You can leave this section blank in Apipheny.

Here’s what our API request looks like in Apipheny:

Exchangerates API request entered into Apipheny
Exchangerates API request entered into Apipheny

Step 5.) Run the ExchangeRatesAPI Request in your Google Sheets

The last step is to click the Run button at the bottom of the Apipheny add-on and then your Exchange Rates data will be imported into your Google Sheet, like so:

Exchangerates data imported into Google Sheets
Exchangerates data imported into Google Sheets

After making a successful request to the ExchangeRatesAPI, try querying a different Exchange Rates API endpoint, or try using one of the more advanced features in the Apipheny add-on, such as:

Related Posts