We have many users using our Google Sheets Extension with great success. However some use cases might not be a good fit for Google Sheets due to complexity, scalability, or reliability concerns.
If you don't have the technical chops yourself or a developer to help you, you may be a bit stuck. Fortunately, you can integrate without writing any code using our SerpApi App on Make.com. This is a great no-code option for simply integrating SerpApi with other tools such as Google Sheets.
In this tutorial, I'll walk through a very basic example of how to query SerpApi with source data from Google Sheets. Then I'll show you how to both update existing rows in Google Sheets as well as adding new rows with the data returned from SerpApi.
Setting Up Google Sheets Source Data
First, we'll create a basic Google Sheet containing our keywords. We'll also add a few columns that will be destinations for data we get back from SerpApi's Google Search API.
Next, we'll head over to Make and create a new Scenario. The first Module we'll add is Get Range Values from the Google Sheets app.
Make sure you have a Connection to Google Sheets through Make. If you don't have one, follow the Create Connection flow to link your accounts.
Assuming your Connection is set up, you'll be presented with a form like below. Click the button "Click here to choose file" to select a spreadsheet from your Google Sheets account.
You'll also need to select the particular sheet you want to work from under "Sheet Name". For "Range", enter the range of values you want to search SerpApi with. Do not include the header row or you'll end burning a search credit searching with your column title.
We have a very simple sheet with only 2 rows of data so we'll just put A2:A3 to cover our range.
Our table does have headers so we'll check the "Yes" button and set A1:D1
for "Row with headers".
The final product should look like this:
Hit "Run once" to make sure your data is pulled correctly.
Assuming all went well, you should see each of our keywords in an Output Bundle of their own.
Searching Google with SerpApi
Now we can add SerpApi. We'll do a basic Google Search using the Search Google Module.
Similar to Google Sheets, you'll need a Connection to query SerpApi via Make. Follow the Create Connection flow to add your SerpApi API key.
Once you're connected, click on the "Search Query" form box to see what fields we have access to. We want to use the keyword (A)
field as our query so click that one to populate "Search Query" with it.
It should look like the below screenshot after clicking.
Note the number before keyword (A)
will be different in yours. You can ignore that.
Hit "Run once" again to execute the query.
You should see Output Bundles for each keyword from our Google Sheet. In this case, Make is smart enough to know we want to iterate over the list of keywords from Google Sheets without having to explicitly give that directive.
Updating Google Sheet Rows
We have our search results data and now we want to send that back to our Google Sheet. We'll do this using the Update a Row Module from the Google Sheets app.
We'll be presented with a form basically identical to what we saw for Get Range Values.
First, we'll tell Make where to get the row number for each update. Click on the "Row number" box and find the Row number
field under the Google Sheets output. I've collapsed the SerpApi output in the screenshot below to make it easier to display.
Click Row number
to populate this in the form.
Then we'll expand the SerpApi output and expand the Organic Results[]
array to locate the 3 fields we want. Follow the red arrows to map each field in the form.
The final product should look like the screenshot below. Remember, the numbers before each field name will be different than yours.
Hit the "Run once" button again and then check the Google Sheet. We should have our data all nicely populated in Google Sheets by now.
Adding Google Sheets Rows
In some cases, you may want to add rows instead of update them. For example, if you want to log the top page of search results for a list of keywords.
For this exercise, we'll create a new sheet in our Google Sheet and leave it with the default "Sheet2" name. Give it columns like the below screenshot.
Coming back to Make, we'll delete the Update a Row Module to keep our Scenario tidy. You can also leave this here and append the upcoming Modules if you prefer.
This time we need to unpack and iterate over organic search results returned in an array by the SerpApi Google Search Module. We'll handle this array using the Flow Control Iterator Module.
Select Organic Results[]
.
It should look like this after you click it.
Try running it once. You'll get a warning like below, but you can hit "Run anyway".
You should get output like the following where each Operation is a keyword from the original source Google Sheet. Each Bundle within an Operation represents an organic search result for that keyword.
Now we can add the Google Sheets Add a Row Module.
Select our Google Sheet and set the "Sheet Name" as "Sheet2".
We'll use the q
value from our SerpApi Google Search output to populate the keyword value. Use the output from the Iterator Module to select title
and link
.
The final product should resemble this:
Give it a whirl and you should see rows added. Looks good!
Wrapping Up
Hopefully this article helped you understand the basics enough that you're ready to get creative with your own Scenarios.
If you have any questions or want to share what you've created with Make and SerpApi, drop us a line at contact@serpapi.com
Want to Import This?
If you'd like to skip all this manual configuration, you can download the blueprints of each Scenario and then import it into an empty Scenario. All you'll need to do is configure your own SerpApi and Google connections.