How to get Google autocomplete suggestions in Python

Checked on 2026-11-19.

The suggestions of Google's search box come from an address that answers a plain GET request with JSON, and Python reads it in a few lines. It is not a published API: Google's own words for it are "non-official, non-published", and it promises nothing about it. Whichever route you take, you get phrases: suggestions carry no search volumes.

1. The suggestion address: free and unofficial

One GET request with your text in q. It asked for no key and no account when this guide was checked.

Python
import requests

res = requests.get(
    "https://suggestqueries.google.com/complete/search",
    params={"client": "firefox", "q": "running shoes"},
    timeout=30,
)
res.raise_for_status()
query, suggestions = res.json()[:2]
for position, phrase in enumerate(suggestions, start=1):
    print(position, phrase)

There is no documentation to take this from, so here is what the address returned on 19 November 2026:

JSON
["running shoes",
 ["running shoes", "running shoes review", "running shoes nike", "running shoes ranking",
  "running shoes for women", "running shoes best", "running shoes gore tex", "running shoes 2026",
  "running shoes brands", "running shoes nike women"],
 [],
 {"google:suggestsubtypes": [[512], [512], [512], [512], [512], [512], [512], [512], [512], [512]]}]

It is a JSON list: the text you sent, then the suggestions in the order they came (ten for this seed), then an empty list and an object the code above does not use. client=firefox is the value the Firefox search bar sends: Mozilla's published search configuration gives Google's suggestion address as https://www.google.com/complete/search with that parameter.

Where it stops: at Google's goodwill. In a 2015 post Google wrote that developers had been using "a non-official, non-published API" for autocomplete, and announced that it would be "restricting unauthorized access to the unpublished autocomplete API as of August 10th, 2015". The address still answered a single request when this guide was checked, and that is all anybody can say about it. There are no documented parameters, so language and country are trial and error; there is no stated quota; and nothing warns you before it changes or starts refusing you. The alternative that post names is Google Custom Search Engine, which keeps autocomplete "in connection with Search functionality" on a site of your own. Automated access to Google's services also falls under Google's Terms of Service: read them before you build a product on this.

2. An API that asks Google, YouTube and Amazon

Pipefetch has a suggestions endpoint that collects the autocomplete suggestions of Google, YouTube and Amazon for one seed keyword. It asks for the seed as it is, then with question words in front of it (how, what, why), then with comparison words, prepositions and the letters a to z after it, until it holds as many phrases as you asked for, 100 at most.

Python
import os
import requests

res = requests.get(
    "https://pipefetch.com/v1/keywords/suggestions",
    params={"q": "running shoes", "source": "google", "country": "US", "limit": 50},   # source: all, google, youtube or amazon
    headers={"x-api-key": os.environ["PIPEFETCH_API_KEY"]},
    timeout=90,
)
if res.status_code == 404:
    print("No suggestions for this keyword")  # not charged
else:
    res.raise_for_status()
    data = res.json()["data"]
    print(data["seed"]["keywordCount"], "keywords | more were available:", data["seed"]["truncated"])
    for k in data["keywords"]:
        print(k["bestPosition"], k["group"], k["keyword"], k["sources"])

Each keyword says which sources suggested it (sources, sourceCount), the highest place any of them gave it (bestPosition, where 1 is the top suggestion) and a group read from its words: question, comparison, preposition or other. With source=all, the default, the phrases that more of the three sources suggest come first. The language follows country. Amazon has suggestions for 15 countries; for any other it is left out and named in sourcesUnavailable.

The same plain words apply here as above. This reads the same public suggestions; it is not an official API of Google, YouTube or Amazon, and Pipefetch is not affiliated with them. It returns no search volumes, no cost per click and no difficulty scores. A request costs 1 credit whatever the limit, a seed nobody has a suggestion for answers 404 and costs nothing, and a new account has 100 free credits and needs no card. The reference lists every field.

What a suggestion is, and what it is not

Google's help page on autocomplete says that predictions "reflect real searches that have been done on Google", and that its systems also consider the language of the query, the location it comes from, trending interest and your past searches. The same page says autocomplete "doesn't simply display the most common queries on a given topic", and that it "shouldn't be compared against Google Trends" for that reason. Predictions that break Google's policies are removed.

So a suggestion tells you that people search for a phrase, in some language and place, around now. It does not tell you how many of them. A place in the list is not a volume, and a phrase that is missing from the list has not been shown to have no searches.

For numbers, Google's own tool is Keyword Planner in Google Ads, which shows "estimates on the number of searches a keyword gets each month". It needs a Google Ads account with billing information entered.

Which one should you use?

You needUse
Suggestions for a few seeds, in a script of your own, on an address Google may closeThe suggestion address
Up to 100 phrases per seed with the questions marked, or YouTube's and Amazon's suggestions beside Google'sAn HTTP API such as Pipefetch
Search volumesNeither: Keyword Planner in Google Ads

Getting more than one short list

One request to the suggestion address gives one short list. The way to a longer one is to ask for variations of the seed: the seed followed by each letter of the alphabet, the seed after question words, the seed before prepositions. You can loop over those yourself against the address of route 1, at the price of many more requests to an address that gives you no allowance.

Pipefetch does that expansion inside one request and drops a phrase that only came back as a copy of what was asked. A seed with many suggestions reaches the limit before the later steps are asked, and truncated is then true in the answer.

Try it with 100 free credits. No card needed. No scraper to build or maintain. Get an API key or read the docs.

Every source

YouTube

Instagram

Websites

TikTok

Facebook

Google

Threads

LinkedIn

App stores

Steam

X

Pinterest

Airbnb

Real estate

Job boards

Eventbrite

Shopify stores

Public tenders

All guides