Google
|
przez Autom Team

How to Scrape Google Autocomplete using n8n & Autom

If you work in SEO, content creation, advertising, or product research, you'll find that Google Autocomplete data is incredibly valuable. It reveals the actual queries people type into Google.

However, collecting this data manually can be tedious and time-consuming. The process involves typing in a keyword, waiting for suggestions to appear, copying them, pasting them into a spreadsheet, and then repeating this over and over again. It's not only boring, but it also becomes unmanageable as your keyword list grows.

I'm Josseline, the founder of Autom, a Google Search API. I create APIs with the primary goal of making data easier to access, scale, and utilize without unnecessary complications.

In this blog, I will break down how to use Autom’s Google Autocomplete API with n8n and Google Sheets to pull autocomplete suggestions in bulk. By the end of the tutorial, you will also get a ready-to-use blueprint that you can import into n8n and start pulling data right away.

Let us get started.

Before Starting Automation You’ll Need

➡️Get Autom API Key - Sign up on Autom, and you will get 1000 free credits right away. Once inside the dashboard, open API Keys from the left sidebar. Create a new key, give it a name, keep it active, and save it. Copy the API key and keep it ready. 

Get Autom API Key

➡️Sign up on n8n - and create your account. You will get a 14-day free trial, which is enough to build and test this workflow without any upfront commitment.

➡️Create a new Google Sheet - give it a clear name. Add two tabs called Input and Output. In the Input sheet, list your seed keywords in the first column, one per row.

Create a new Google Sheet

Once everything is set up, we are ready to create our automation workflow on n8n.

Set Up Google Autocomplete Scraping in n8n: Step-by-Step Guide

In this guide, we’ll build an n8n workflow step by step to scrape Google Autocomplete data. The entire setup is done by connecting different nodes, where each node handles one part of the automation.

To get started, sign in to n8n and click on Create New Workflow. You’ll land on a blank canvas where we’ll gradually add and connect nodes to form the complete workflow. Give the workflow a clear name so it’s easy to identify later.

Node 1: Trigger Manually

Click on the “+” sign and add the Manual Trigger. This will let you run the workflow anytime while building and testing it.

Node 2: Read Keywords from Google Sheets

Add a Google Sheets node and select Get Row(s) as the operation. Choose your spreadsheet and select the sheet where your seed keywords are stored.

If your sheet name or column name is different, simply select the one you created. Click Execute.  On the right side, you’ll see a table showing all the keywords fetched from your sheet.

Read Keywords from Google Sheets

Step 3: Loop Over Items

Add the Loop Over Items node and set the Batch Size to 1.

This node processes one keyword at a time from the Google Sheet, ensuring each seed keyword is sent separately to the Google Autocomplete API. It helps avoid mixing results and keeps the output clean and organised.

Click Execute to confirm the loop is working. On the right side, you’ll see autocomplete suggestions generated for each keyword one by one.

Loop Over Items

As you can see in the screenshot, the loop output sends each keyword one by one to the HTTP Request node, while the done path runs after all items are processed.

HTTP Request node

Node 4: HTTP Request 

Before configuring this node, visit Autom’s Google Search Autocomplete API documentation to understand the endpoint, request body, and response structure.

Now add an HTTP Request node and connect it to the loop output.

Set the method to POST and use the following endpoint as the URL:
https://autom.dev/api/v1/google/search/autocomplete

Enable Send Headers and add:

  • x-api-key → String value → your Autom API key

  • Content-Type → application/json

In the request body, pass the values as strings or numbers, exactly as defined in the API docs:

  • query (string): the keyword coming from the loop

  • cp (number): cursor position in the query

  • gl (string): country code (for example us)

  • hl (string): language code (for example en)

This node sends one keyword at a time to Autom and returns Google Autocomplete suggestions along with the search parameters.

Click Execute. On the right side, you’ll see the suggestions array and search_parameters returned by the API.

HTTP Request

Node 5: Split Out 

The HTTP Request node returns all Google Autocomplete suggestions together inside a single suggestions array. To process and store each autocomplete keyword individually, we use the Split Out node to break this array into separate items.

This node takes the output of the HTTP Request as its input, which contains the suggestions array and the search_parameters object.

In the Fields to Split Out field, enter suggestions. This tells n8n to split the response so that each autocomplete suggestion is handled as a separate item.

Next, set Include to All Other Fields. This ensures that every autocomplete suggestion still keeps the original search details, such as the seed keyword, country, and language.

Click Execute. On the right side, you’ll see that each autocomplete keyword is now output as its own item, with the related search parameters preserved. This prepares the data for clean formatting and storage in the next steps.

Split Out

Node 6: Edit Fields 

At this stage, the autocomplete data is still nested inside fields like search_parameters and suggestions. If we send this data directly to Google Sheets, it would either store unreadable objects or fail to map the values correctly. To avoid this, we use the Edit Fields node to convert everything into simple text fields.

Keep the node in Manual Mapping mode. Under Fields to Set, add the following fields as String values:

  • seed_keyword → drag the value from search_parameters.q

Edit Fields

  • autocomplete_keyword → drag the value from suggestions.value

Edit Fields

You can either drag and drop these values from the left input panel or use expressions to map them. Turn off Include Other Input Fields so only these two clean columns are passed forward.

After clicking Execute, the output on the right shows a clean table where each row contains one seed keyword and one autocomplete suggestion. This format is ideal for saving directly into Google Sheets in the next step.

Node 7: Google Sheets - Append or Update Row

This is the final step where we store the cleaned data into Google Sheets. At this point, the data is already flattened into simple text fields (seed_keyword and autocomplete_keyword), so it can be saved without any formatting issues.

In the node settings, connect your Google Sheets account. 

Set Resource to Sheet Within Document and Operation to Append or Update Row.

Select your spreadsheet (for example, Google Autocomplete Keywords) and choose the Output sheet where you want the results to be stored.

Keep Mapping Column Mode set to Map Automatically. Since the column names in the sheet match the field names created in the Edit Fields node, n8n automatically places each value in the correct column. You don’t need to select any column to match on because we’re simply appending new rows.

Click Execute, and on the right side, you’ll see the same table as the input. At the same time, the data gets added to your Google Sheet row by row, completing the automation.

That’s it -  your Google Autocomplete scraping workflow is now fully automated end to end.

Google Sheets - Append or Update Row

Final Step: Save and Run the Workflow

Save the workflow and click Execute Workflow.

Save and Run the Workflow

Once the run is complete, open your Google Sheet and check the Output sheet to see the autocomplete keywords being added row by row.

Open your Google Sheet and check the Output

Download the Blueprint

➡️ Download the n8n blueprint from the link below and import it into your workspace.

To import, click Import workflow in n8n and upload the file.

After importing, update your Google Sheets connection, sheet names, and replace the API key in the HTTP Request node with your own. Then save and run the workflow.

Wrap Up

In this guide, you walked through how to scrape Google Autocomplete using n8n & Autom, starting from setting up the workflow to storing clean autocomplete data in Google Sheets. This setup helps you collect keyword ideas at scale without manual effort and keeps everything organised for SEO or content research.

If you want to try this yourself, you can get started with Autom for free and use the 1,000 free credits to test the Google Autocomplete API and other search endpoints.

To go deeper, you can also check out these related resources:

 

SERP API

Discover why Autom is the preferred API provider for developers.