• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
  • Skip to footer

Rapid Blog

  • Enterprise
  • API Hub
  • Add Your API
  • About
  • Docs
    • API Glossary
  • Blog
    • What is an API?
    • REST API Tutorials
    • Most Popular APIs
    • Write for Us
  • Sign Up
    • Log In
Blog » APIs » How to Use an API in Google Sheets – RapidAPI for Google Sheets

How to Use an API in Google Sheets – RapidAPI for Google Sheets

By Alex Walling // January 8, 2021

Table of Contents

  • 1. Installing the Plugin
  • 2. Forming the Request
  • 3. Subscribing to the API
  • 4. Gathering the Required Information
  • Related Links

In this article, you’ll learn how to use APIs in Google Sheets.

If you don’t know how to use an API, I’d recommend checking out this guide first.

Google Sheets can be a very powerful tool for storing, managing, and transforming all kinds of data. I use it all the time for tracking my monthly spending, potential conferences RapidAPI might sponsor, emails of partnership leads, my yearly goals, and much more! With Google Sheets being such a useful tool already, we wanted to help enable anyone to supercharge their sheets through the power of APIs.

The RapidAPI add-on for Google Sheets allows you to make API requests to any API on RapidAPI from within a Google Sheet, and embed the data you get back into the sheet – all through a single function that can be dragged down across many rows

This tutorial will walk you through the basics of using the add-on.

1. Installing the Plugin

To install the plugin, simply head to the Google Sheets add-on store and install the free RapidAPI for Google Sheets add-on. During the installation process, there will be a prompt to accept permissions to run – which are required because this add-on makes requests to external APIs.
By default, the add-on will be disabled in any new spreadsheets that you create. Before using it in a new spreadsheet, you must enable it for that document. To do so:

  1. Open the sheet you want to use the add-on in.
  2. Open the “Add-ons” menu at the top of the window.
  3. Click “Manage Add-ons”
  4. You should see the RapidAPI Add-on there – click the green “Manage” button next to it and select “Use in this document”. Once selected it should have a check next to it.

Installation page - RapidAPI for Google Sheets

2. Forming the Request

The RapidAPI Google Sheets Add-on supports two different types of functions

=GET(url, selectPaths, rapidApiKey)
=GETARR(url, arrPath, selectPaths, rapidApiKey)

The main difference between the two functions is how the response of the data is displayed. If an API has a single object as the response, then you will use the GET function. If the API returns an object that contains an array of values, then you will use the GETARR function.
For this tutorial, we’ll be using the GETARR functionality to search the Movie Database (IMDB Alternative) API to get information about a movie search term.

3. Subscribing to the API

Before being able to make a request to the API, you’ll first need to subscribe to an API plan. To do that, use the ‘Pricing’ tab. There are four different pricing plans currently available for the API we’re using for this example. The most affordable plan is a free BASIC plan, which allows for 1,000 calls per month and $0.01 for each additional request over 1,000. The plan that allows you the highest amount of requests is the $10 per month MEGA plan, which enables you to make unlimited API calls.

If the API you are using does have an overage fee associated, please be sure to be careful about the number of requests that your account is making. You will be charged for any additional usage. You can keep track of your quota in your RapidAPI Developer Dashboard.

4. Gathering the Required Information

For the GETARR function, at the bare minimum requires the url, arrPath, selectPaths, and rapidApiKey. You are also able to provide optional and required query string parameters too. All of this information can easily be found on the APIs listing page from RapidAPI. Here’s where you can locate the information:

Diagram showing where required fields are located

URL: "https://rapidapi.com/rapidapi/api/movie-database-imdb-alternative"
arrPath: "Search"
selectPath: "imdbID,Title,Year,Poster"
rapidApiKey: "*****************************"
requiredParameters: "s",{Cell Containing Search Term}
optionalParameters: "page","1","r","json"

With this information in hand, you’re ready to start forming your request! Here’s what the full request will look like:

=GETARR("https://movie-database-imdb-alternative.p.rapidapi.com/","Search","imdbID,Title,Year,Poster","*********************","page","1","r","json","s",B3)

One thing to note here is that after entering all of the required values [url, arrPath, selectPaths, rapidApiKey], you are able to provide the optional and required query string parameters in the following format: ,“key”,”value”,”key2”,”value2”,etc.

When I’m utilizing this tool, I like to format the Spreadsheet by using a cell for the search term since it is the dynamic parameter. This makes it easy to update that particular cell and get a new search result.

Results of querying for Lord of the Rings
Results from querying for Avengers

The API request is what fills in the IMDB ID, TITLE, Release Year, and Link columns of this spreadsheet. Then as an added bonus, I use the =IMG() function, that is provided by default in Google Sheets, to add in the image of the movie posters based on the link the API returned!

I went ahead and created a template for this specific example to help you get started. The template Google Sheet can be found here.
With this spreadsheet, you can select ‘Add to Drive’ and follow the instructions in this blog post to help you get started. Once you subscribe and have your API key, just add it to the spreadsheet to see your results. For more example use cases, you can take a look at this example spreadsheet that shows you how you can validate a list of email addresses, find stock information, geocode an address.

We’re really excited to see the ways in which you will use the RapidAPI Google Sheets plugin! Shoot us a Tweet at @Rapid_API to let us know what you end up building.

Related Links

  • Get Netflix Data from RapidAPI to Google Sheets
  • How to Use an API
    • With Python
    • With JavaScript
      • With Node.js
      • With React
        • React and Axios
      • With Vue.js
    • With PHP
    • With Ruby on Rails
    • With Java
    • With C#
    • in Google Sheets
4.3/5 - (13 votes)
« How To Use An API with Java (The Complete Beginner’s Guide)
List of Top SMS APIs to Send Text Messages (Updated for 2022) »

Related Blog Posts

5 Steps to Fueling a Successful Local Analytics Product Using Data Axle’s Data on RapidAPI
5 Steps to Fueling a Successful Local Analytics Product Using Data Axle’s Data on RapidAPI

How to Use the Horoscope API with Python, PHP, Ruby & Javascript Examples
How to Use the Horoscope API with Python, PHP, Ruby & Javascript Examples

What Are Microservices?
What Are Microservices?

How to Use the CalorieNinjas API with Python, PHP, Ruby & Javascript Examples
How to Use the CalorieNinjas API with Python, PHP, Ruby & Javascript Examples

8 Common API Error Examples and Use Cases
8 Common API Error Examples and Use Cases

How to Use the unogsNG API with Java, Python, PHP, Ruby & JavaScript Examples
How to Use the unogsNG API with Java, Python, PHP, Ruby & JavaScript Examples


Filed Under: APIs, REST API Tutorials Tagged With: google sheets

Alex Walling

Developer Advocate at RapidAPI

Reader Interactions

Comments

  1. Andrea Nerla says

    January 10, 2020 at 11:00 am

    The template at the end is not reproducible, due to some Google Sheets updates I guess. For example, now to separate arguments in GETARR Google Sheets uses semicolumns instead of commas. Even when replacing commas with semicolumns the project doesn’t work though.

    Reply
  2. Hassan Ali says

    January 12, 2020 at 3:15 am

    Im getting this error – #Specified key ‘xxx’ does not exist in content. I checked with other endpoint and it works, but im getting this error in one which i needed

    Reply
  3. Op says

    May 17, 2020 at 12:39 am

    The custom GET and GETARR functions no longer works. You guys might want to check it out.

    Reply
  4. Hafizd says

    October 19, 2020 at 3:36 pm

    Hi, sir how to add photo on sheet?

    Reply
  5. Guy says

    December 16, 2020 at 4:20 pm

    Will you please try this API? I cannot get it to work. I get #ERROR JSON Pasing/Selecting from it
    https://rapidapi.com/adminMelissa/api/global-email-v4/endpoints

    Reply
  6. Nigel says

    March 15, 2021 at 6:22 pm

    im getting a 404 error on the free RapidAPI for Google Sheets add-on link?!
    broken link maybe?

    https://chrome.google.com/webstore/detail/rapidapi-for-google-sheet/niplaodlmdnbohiabbnknjienppmbpfl

    Reply
  7. Gabi says

    April 10, 2021 at 11:11 pm

    How can I recall the API to update every X minutes inside the Google Sheet?

    Reply
  8. Tonmoy Tanvi says

    October 17, 2021 at 7:59 am

    Hi Alex Walling, hope you are well! I found that most of the users are facing errors. Maybe it’s too complex for them. I have been working with an API tool site For months. It will help you and others, I hope so! you can try it once, you won’t face that many difficulties anymore, https://sheet.best/

    Reply

Leave a Reply

Your email address will not be published. Required fields are marked *

Primary Sidebar

Build anything with APIs, faster.

Discover, evaluate, and integrate with any API. RapidAPI is the world’s largest API Hub with over 4 Million developers and 35,000 APIs.

Browse APIs »

Footer

  • API Guides
  • API Courses
  • API Glossary
  • API Testing
  • API Management
  • How to use an API
  • For API Providers
  • Most Popular APIs
  • For Developers
  • Free APIs List
  • Learn REST API
  • Build API’s
  • About
  • Team
  • Careers
  • Contact Us
  • Write for Us
  • API Directory
  • Press Room
  • Privacy Policy
  • Terms of Use

© 2023 RapidAPI. All rights reserved.