How to connect APIs from RapidAPI to your Google Sheets

RapidAPI is one of the largest platforms for API discovery and integration. It features thousands of APIs that developers can search, test, and connect to.

In this tutorial we will show you how to connect RapidAPI to your Google Sheets without any coding, using 2 different examples.

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

Apipheny is an API connector for Google Sheets. You can use Apipheny to connect your Google Sheets to unlimited API data sources, make unlimited API requests, and more. There is a 30 day free trial included.

1.) Install Apipheny by opening the following link on desktop and then clicking the Install button in the Google Marketplace: https://apipheny.io/install

2.) After you’ve installed Apipheny, open a Google Sheet and then click on the Extensions dropdown in the menu at the top.

In the dropdown list you should see Apipheny. Click Apipheny then click Import API to open the Apipheny sidebar in your Google Sheet.

open apipheny

Tip: you can open a new Google Sheet by entering this URL in your browser: sheet.new

Example 1.) Gas Prices API

In this first example we are going to get data from the Gas Prices API.

1.) Get a subscription if necessary

After choosing an API in RapidAPI, go to the Pricing tab and choose a plan. We are using this Gas Prices API as the first example.

For this API, we chose the Basic plan:

The Pricing tab
The Pricing tab

After choosing a plan, you’ll receive a confirmation message:

Confirmation message
Confirmation message

2.) Find the cURL command

 Next, in the APIs dashboard, go to the Endpoints tab:

The Endpoints tab
The Endpoints tab

In the Code Snippets section, choose Shell > cURL to display the cURL command:

The Code Snippets section
The Code Snippets section
The cURL command
The cURL command

3.) Choose an endpoint

Next, you’ll need to browse the available endpoints to find an endpoint that retrieves the exact data that you want. If you already know the API URL you want to use, or you want to use the same example URL as us, just skip to Step 4.

To browse the available endpoints, click on the Endpoints tab. On the left side, you’ll see a list of endpoints available for the API:

Gas Price API documentation page
Gas Price API documentation page

An example endpoint from the Gas API is canada, which will have data on the gas prices in Canada.

Each endpoint’s documentation contains the HTTP method and request URL, a short description of the endpoint’s purpose, the header parameters, the cURL command and example responses:

The Canada endpoint
The Canada endpoint

For this example, as we can see in the cURL command, all endpoints can be accessed from the following base domain: https://gas-price.p.rapidapi.com/

4.) Enter your API request into Apipheny

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) required by your API endpoint. For this example, we are using the GET method.

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

For this example, we are using the GET europeanCountries endpoint, which is the service that brings up the current gasoline prices in European countries. This is what the whole URL looks like:

https://gas-price.p.rapidapi.com/europeanCountries

In the Headers section of Apipheny, add two rows with the following key and value:

Header 1
Key:
x-rapidapi-host
Value:
gas-price.p.rapidapi.com

Header 2
Key:
x-rapidapi-key
Value:
api-key

When entering Header 2 Value, replace api-key with your own API key that you’ll find in the Header Parameters section in RapidAPI.

Gas Price API request entered into Apipheny
Gas Price API request entered into Apipheny

5.) Run the API request

Finally, the last step is to click the Run button at the bottom of the Apipheny add-on and then wait for the API data to be imported into your Google Sheet. Here’s what our request looked like when completed:

Gas Price data imported into Google Sheets
Gas Price data imported into Google Sheets

Example 2.) Shazam API

In this second example we are going to get data from the Shazam API. The steps are very similar to Example 1.

1.) Get a subscription if necessary

Go to Pricing tab and choose a plan. We chose the Basic plan:

The Pricing tab
The Pricing tab

You’ll get a confirmation message:

Confirmation message
Confirmation message

2.) Find the cURL command:

Go to the Endpoints tab:

The Endpoints tab
The Endpoints tab

In the Code Snippets section choose Shell > cURL to display the cURL command:

The Code Snippets section
The Code Snippets section
The cURL command
The cURL command

3.) Choose an endpoint

Click on the Endpoints tab. On the left side, there will be a list of endpoints available for the API:

Shazam API documentation page
Shazam API documentation page

An example endpoint is songs/get-details, which gets information for a specific song:

https://shazam.p.rapidapi.com/songs/get-details?key=key_value&locale=en-US

For this endpoint, the key_value is the key field returned by calling the /songs/detect or /search endpoints.

Each endpoint’s documentation contains the HTTP method and URL, a short description of the endpoint’s purpose, the header parameters, its cURL command and example responses:

The Song Details endpoint
The Song Details endpoint

As you can see in the cURL command, these endpoints can be accessed with this base domain: https://shazam.p.rapidapi.com/

4.) Enter your API request into Apipheny

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) required by your API endpoint. For this example, we are using the GET method.

API URL: In Step 3, we explained how you can find the Shazam API endpoint that you need. Now copy and paste your complete API URL into the Apipheny add-on, where it says API URL Path, followed by any parameters required for your query (if applicable).

For this example, we are using the /search endpoint, which searches for songs and artists that match an input term. This is what the whole URL looks like:

https://shazam.p.rapidapi.com/search?term=kiss%20the%20rain&locale=en-US&offset=0&limit=5

In the Headers section of Apipheny, add two rows with the following keys and values:

Header 1
Key:
x-rapidapi-host
Value:
shazam.p.rapidapi.com

Header 2
Key:
x-rapidapi-key
Value:
api-key

Don’t forget to replace api-key with your own API key, which you’ll find in the endpoint’s Header Parameters section in RapidAPI.

 Shazam API request entered into Apipheny
Shazam API request entered into Apipheny

5.) Run the API request

Finally, the last step is to click the Run button at the bottom of the Apipheny add-on and then wait for the API data to be imported into your Google Sheet. Here’s what our request looked like when completed:

Shazam data imported into Google Sheets
Shazam data imported into Google Sheets

Example 3.) Real Estate API

That’s it! Once you’ve completed these two examples, you will have learned how to connect APIs from RapidAPI to your Google Sheets using Apipheny.

Now you can apply the same steps to almost any API from RapidAPI!



Crypto API Tutorials:


API Tutorials


API Knowledge

What is an API?

What is an API URL?

What are parameters?

What is an endpoint?

What is an API key/token?

What is basic authentication?

What are headers?

What is a GET request?

What is a POST request?