How to Use an API in Google Sheets — RapidAPI for Google Sheets
![]()
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.
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:
- Open the sheet you want to use the add-on in.
- Open the “Add-ons” menu at the top of the window.
- Click “Manage Add-ons”
- 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.
Forming the Request
The RapidAPI Google Sheets Add-on supports two different types of functions
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.
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.
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:
With this information in hand, you’re ready to start forming your request! Here’s what the full request will look like:
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.
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.
Как подключить API Google Search Console к Google Таблицам
В статье ( «Google Apps Script: полезные функции и фишки для SEO (часть первая)» ) я демонстрирую скрипты, которые будут работать с API Google Search Console (и другими сервисами Google, так как подключение к API происходит подобным образом). Чтобы облегчить настройку, буду ссылаться на эту статью.
Перед тем как перейти к делу, давайте разберёмся, зачем подключать API Google Search Console к Google Таблицам.
С помощью этой настройки вы сможете выгружать из Google Search Console (GSC) такие данные:
- Search Analytics: это то, что мы можем найти в разделе «Эффективность» в GSC (в старой версии GSC этот раздел называется «Анализ поисковых запросов»).
- Sitemaps: добавлять и удалять карты сайта, получать информацию о конкретных картах сайта.
- Sites: добавлять и удалять сайты (в GSC), получать информацию и списки сайтов в GSC.
- URL Crawl Errors Counts. Получать количество ошибок по типам: authPermissions, flashContent, manyToOneRedirect, notFollowed, notFound, other, roboted, serverError, soft404. В разрезе mobile, smartphoneOnly и web.
- URL Crawl Errors Samples. Извлекать сведения об ошибках, получать список URL определенных ошибок, помечать URL предоставленного сайта, как «исправленный» и удалять его из списка.
Как подключить API Google Search Console к Google Таблицам
- Делаем копию таблицы, к которой подключим API Google Search Console. К ней уже подключена библиотека OAuth2.
- Заходим на сайт Google Cloud Platform.
- Мы попали в Google Cloud Platform. Затем в поисковой строке Google Cloud Platform нужно ввести «Search Console API» и перейти далее.

- Нажимаем на кнопку «Включить» («Enable»).

- Далее переходим в «Учетные данные» («Credentials»).

- Переходим по ссылке:

- Создаем учетную запись «Идентификатор клиента OAuth».

- Теперь выбираем «Веб-приложение».

Если поле неактивно, нужно перейти по ссылке «Настроить окно запроса доступа» и заполнить все поля. После нужно сохранить и продолжить настройку — нажать “Теперь выбираем «Веб-приложение»”.

- Ниже, в поле «Разрешенные URI перенаправления» («Authorized redirect URIs») нужно вставить строку: https://script.google.com/macros/d/<ключ_проекта>/usercallback
- ( <ключ_проекта>нужно взять в редакторе Apps Script, кликнув на «Файл» — «Свойства проекта» — «Ключ проекта»).

- Далее появится окно с идентификатором и секретом клиента (your client id and your client secret). Сохраните себе эти строки, они понадобятся для работы с API Google Search Console в Google Таблицах.

- Далее в скрипте во вкладке «Variables», в переменной «CLIENT_ID» вставляем «Ваш идентификатор клиента». В переменной «CLIENT_SECRET» вставляем «Ваш секрет клиента» (эти данные мы получили на прошлом шаге) и нажимаем «Сохранить».

- Переходим в наш ранее скопированный документ и запускаем скрипт для окончательной авторизации:

- Получаем разрешение.

- Выбираем аккаунт, который нам нужен:

- Следуем подсказкам на скриншоте:

- Жмём «Разрешить»:

- Копируем URL и в новой вкладке переходим по нему.

- Если все настроили верно, нужно будет указать свой профиль и дать разрешение, как мы это делали в пунктах 16 и 18.
- Если видим такое окно, значит API Google Search Console подключили:

- Чтобы убедиться в этом, переходим в наш документ и заново запускаем скрипт, как это было в пункте 14. В результате во вкладке «Sites» появятся все сайты, которые есть в аккаунте Google Search Console.
Не получается подключиться? Пишите в комментариях, постараюсь помочь.
Кстати, скоро будет второй пост из цикла статей о Google Apps Script, не пропустите.
Выводы
Изучив возможности API методов GSC, можно автоматизировать процесс проверки сайта в этом сервисе. В цикле статей о Google Apps Script я поделюсь скриптом, который регулярно автоматически выгружает нужные нам данные. Затем, если есть какие-то существенные изменения, отсылает письмо на почту. Кроме того, с помощью Google Apps Script можно и отправлять email .
Информация в посте актуализирована Евгением Лукьянюком в октябре 2021 года.
С SEO познакомился в 2015 году.
Работал и обучался в компании Palmira Studio.
C августа 2015 года работаю SEO-специалистом в агентстве интернет-маркетинга Netpeak.
Сертификация: Google Analytics, Google AdWords по направлениям «поисковая и мобильная реклама».
Как загрузить данные из любого API в Google Sheets (data stream)
Всем привет! Я Лаптев Алексей, основатель и главный разработчик группы сервисов в datamonster.
В первую для задач аналитики, когда готовых сервисов нет или по каким-то причинам их использование невозможно.
- Выгрузка статистики в Google Sheets из Яндекс Метрики, Google Analytics
- Выгрузка статистики в Google Sheets из рекламных кабинетов Яндекс Директ, ВКонтакте
- Выгрузка статистики в Google Sheets из маркетплейсов Ozon, Wildberries
- Выгрузка данных из сервисов с которыми нет коннекторов, но где есть API
Ввиду проблем с работой сервисов западных партнеров, мы в apimonster сделали свой вариант.
- Создаем запрос к api по аналогии с работой в postman. Обычно нужно указать url, токен и параметры запроса.
- Форматируем полученные данные в нужный табличный вид
- Подключаем Google Sheets, указываем рабочий лист
- Настраиваем выгрузку — на основании какого запроса в api по какому расписанию в какой лист Google Sheets заливать данные.
Все, ничего сложного, но если сложности возникли, есть настройка под ключ.
Создаем запрос к api по аналогии с работой в postman
Форматируем полученные данные в нужный табличный вид
Настраиваем выгрузку — на основании какого запроса в api по какому расписанию в какой лист Google Sheets заливать данные
Готово, каждый день данные из api будут добавляться в Google Sheets
Сам сервис здесь, помощь с настройкой здесь.
Сервис в бете, возможны шероховатости.
Ну вы, конечно, обнаглевшие ребята. Я к вам пришел с этой идеей, предложил партнерство, вы её реализовали, закрыли чат и даже спасибо не сказали.
Тут стоить уточнить, что ваша роль которую вы видели в реализации довольно очевидной идеи — статья на VC.
Мы же нагло реализовали все, в том числе для вас.
вот козлы. Сочувствую. И непонятно, как делиться идеей, чтобы ее, может, и использовали бы, но хотя бы сказали "спасибо"
Алексей, скажите пожалуйста, хочу реализовать передачу данных из сервиса Wapico(WhatsApp рассылки), в Google sheets через API, вопрос в том что мне нужны данные только определённого типа, например "только те клиенты что ответили на сообщение" так как полностью все данные выгружать это 1000+ отправленных сообщений в день, это не очень целесообразно, можете ли вы на базе своего сервиса мне. этим помочь, естественно в рамках договора?
Там вебхуков нет, но на базе ваззап24 в целом реализуемо.
Я прошу прощения, так как я человек практически ничего не понимающий в разработке, коде и тд, "там" это на базе сервиса wapico? они утверждают что есть, а если "там" это в Google sheets, то у меня ломается мозг, зачем в таблицах вебхук
How to use an API in Google Sheets?
Google Sheets is a powerful tool for storing and managing different kinds of data. Many people use these sheets to keep their income, expenditures, targets, form responses, and more.
RapidAPI for Google Sheets
The RapidAPI add-on for Google Sheets supercharges these sheets by allowing you to use any API from RapidAPI Hub. RapidAPI Hub lets you choose from thousands of APIs which over 3 million developers are using.
Using the add-on, you can perform tasks like email validation, geo-location, currency exchange, data imports, and much more without leaving the sheet. Moreover, it provides a getter function that can be dragged down to as many cells as you want for dynamic data fetching.
Usage
Let's go through a practical example to see how we can integrate APIs in Google Sheets. I will use an exchange rate API to convert the currencies of amounts present in a sheet. I have divided the process into four easy steps.
→ STEP #1: Installation
To install the plugin, head to this link and install the add-on. They will prompt you for required permissions as this add-on requests external APIs. By default, the add-on will be disabled in your sheets. Before using it in a sheet, you must enable it for that sheet. To do so:
- Open the sheet in which you want to use the add-on.
- Open the “Add-ons” menu at the top of the window.
- Click “Manage Add-ons”.
- Click on the three dots menu and select Use in this document.
→ STEP #2: Find the API
Now, we will find an API that suits our use case. Go to RapidAPI Hub and create an account if you haven’t already. Then, search for "Currency Exchange" in the search section.
For this guide, I am going to use the Currency Conversion and Exchange Rates. Go ahead and subscribe to the API.
→ STEP #3: Formulate the Request
The add-on offers two functions:
- =GET(URL, selectPath, rapidApiKey, parameters) : If the API returns a single object in the response.
- =GETARR(URL, arrPath, selectPath, rapidApiKey, parameters) : If the API returns an array of objects in the response.
We will use the GET function for this guide. First, focus on the code snippet of the API as it will help us formulate the GET function.
Now, let's go over the parameters of the GET function.
URL — this is the URL of the endpoint you’re using. In our case, it’ll be: https://currency-conversion-and-exchange-rates.p.rapidapi.com/convert .
SelectPath — this will highlight what part of the response data you want to pull into the spreadsheet. You can see the response by testing the API endpoint. As you can see in the following image, we need the result field.
rapidApiKey — this is your API key to use APIs through RapidAPI. You can find it in the X-RapidAPI-Key field.
Parameters — For each parameter (as seen in the code snippet screenshot), you should pass two arguments to the function — the parameterName and parameterValue. In our case, the parameters are "from", "to" and "amount". Note that the parameter value can also reference another cell to get the value dynamically.
Our GET function will thus be:
→ FINAL STEP
Head over to your Google Sheet now. I am using the following mock data:
In the "Amount" cell C2, paste the GET function we formulated above.
Once you enter, it will make the API call, and you will get the exchanged amount in USD. Notice how I am using the cell value B2 as the amount parameter? Now, you can just drag the cell down, and B3, B4 will replace B2, and so on for each cell. As you can see, all the amounts are exchanged and filled in their respective cells.
That's all it takes to integrate any API from RapidAPI Hub into your Google Sheets.