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.
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:
["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.
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 need | Use |
|---|---|
| Suggestions for a few seeds, in a script of your own, on an address Google may close | The suggestion address |
| Up to 100 phrases per seed with the questions marked, or YouTube's and Amazon's suggestions beside Google's | An HTTP API such as Pipefetch |
| Search volumes | Neither: 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.
APIs used in this guide
Guides for other sources
Every source
YouTube
- How to get a YouTube transcript in Python
- How to get a YouTube transcript in Node.js
- YouTube API quota exceeded: what the error means and how to fix it
- How to find a YouTube channel ID from a handle or URL
- How to download YouTube subtitles as SRT or VTT
- youtube-transcript-api RequestBlocked or IpBlocked: why it happens and how to fix it
- How to get YouTube comments in Python
- How to search YouTube from Python
- How to list a YouTube channel's videos in Python
- How to summarize a YouTube video with an LLM in Python
- How to get YouTube transcripts and video stats in Google Sheets
- How to get YouTube video views and likes in Python
- How to get YouTube transcripts in n8n, Make and Zapier
- LangChain YoutubeLoader fails on a server: why, and a loader that works
- How to get a YouTube channel's subscriber count in Python
- How to give Claude or Cursor access to YouTube (MCP server)
- How to get YouTube comments in Node.js
- How to analyze YouTube comments with an LLM in Python
- How to list a YouTube channel's Shorts in Python
- How to search YouTube from JavaScript
- How to get an Instagram follower count in Python
- Instagram Basic Display API alternatives: what to use after the shutdown
- Instaloader 401 Unauthorized, 429 and "Login required": what to do
- How to calculate an Instagram engagement rate in Python
- How to get an Instagram follower count in Node.js
- How to get Instagram follower counts in Google Sheets
- How to get Instagram Reel views in Python
Websites
- Clearbit Logo API alternatives: get a company logo from its domain
- How to extract email addresses from a website in Python
- How to turn a web page into Markdown in Python
- How to detect what a website is built with, in Python
- How to get the contact emails and phone numbers of websites in Google Sheets
- How to build a LangChain tool that reads web pages and searches Google
- How to turn a web page into Markdown in JavaScript for RAG
- How to extract social media links from a website in Python
- How to get a website's favicon in Python
- How to check robots.txt in Python before you fetch a page
TikTok
- How to get a TikTok video's views and likes in Python
- How to get the comments of a TikTok video in Python
- How to get a TikTok follower count in Python
- TikTok Research API: who can get access, and what to do if you cannot
- How to get TikTok video views, likes and shares in Node.js
- How to get TikTok views, likes and follower counts in Google Sheets
- How to get a Facebook Page's posts without app review
- Is there a Facebook Marketplace API?
- Facebook Groups API alternatives after its removal in 2024
- How to get a Facebook Page's follower count and contact details in Python
- How to get Google search results in Python
- pytrends 429 TooManyRequestsError: what it means and what to do
- How to get Google Trends data in Python
- Why is Wyoming first in Google Trends?
- How to get Google search results in Node.js
- How to get Google search results into Google Sheets
- How to give an LLM live Google results with tool calling
Threads
- How to get LinkedIn company data in Python
- How to search LinkedIn jobs from Python
- How to get a LinkedIn company page's latest posts in Python