When you start typing the keyword search on Google, Google will suggest relevant keywords. There are several reasons, primarily related to research, analysis, SEO, and reputation optimization, to scrape Google Autocomplete results.

Why do you need to scrape the autocomplete suggestions?

By scraping Google Autocomplete keywords, you can discover popular search queries related to specific keywords or topics, and generate ideas for your blog posts, videos, etc. You can have more insights into trending topics, frequently asked questions, and more!

Google Autocomplete keywords are also an excellent source for tracking mentions, sentiments, and brand reputation. For local businesses, they will help to understand the search behavior of users in specific locations.

Solution to scrape Google Autocomplete

If you want to scrape real-time keyword suggestions in different locations and different languages, SerpApi Google Autocomplete offers high-quality APIs to support your success. Let's do some searches!


Here is a video tutorial in Python:

Setting up a SerpApi account

SerpApi offers a free plan for newly created accounts. Head to the sign-up page to register an account and complete your first search with our interactive playground. When you want to do more searches with us, please visit the pricing page.

Once you are familiar with all the results, you can use the SERP APIs with your API Key.

Scrape your first Google Autocomplete results with SerpApi

Head to the Google Autocomplete Results from the documentation on SerpApi for details.

In this tutorial, we will scrape keyword suggestions when searching with the "star" keyword. Will Google suggest "Starbucks" or "Star Wars"...? The data contains: "value", "relevance", "type", and more. You can also scrape more information with SerpApi.

First, you need to install the SerpApi client library.

pip install google-search-results

Set up the SerpApi credentials and search.

import serpapi
import os, json, csv

params = {
    'api_key': 'YOUR_API_KEY',         # your serpapi api
    'engine': 'google_autocomplete',   # SerpApi search engine	
    'q': 'start'
}

To retrieve Google Autocomplete Results for a given search query, you can use the following code:

client = serpapi.Client()
results = client.search(params)['suggestions']

You can store Google Autocomplete Results JSON data in databases or export it to a CSV file.

import csv

header = ['value', 'relevance', 'type']

with open('google_autocomplete.csv', 'w', encoding='UTF8', newline='') as f:
    writer = csv.writer(f)

    writer.writerow(header)

    for item in results:
        print(item)
        writer.writerow([item.get('value'), item.get('relevance'), item.get('type')])

This example uses Python, but you can also use your favorite programming languages, such as Ruby, Node.js, Java, PHP, and more.

If you have any questions, please feel free to contact me.