Google Autocomplete API
Google Autocomplete API allows you to get suggestions for a keyword. The API is accessed through the following endpoint: /search?engine=google_autocomplete
. A user may query the following: https://serpapi.com/search?engine=google_autocomplete
utilizing a GET
request. Head to the playground for a live and interactive demo.
API Parameters
Localization
gl
Optional
Parameter defines the country to use for the Google search. It's a two-letter country code. (e.g., us
for the United States, uk
for United Kingdom, or fr
for France) Head to the Google countries page for a full list of supported Google countries.
hl
Optional
Parameter defines the language to use for the Google Autocomplete search. It's a two-letter language code. (e.g., en
for English, es
for Spanish, or fr
for French). Head to the Google languages page for a full list of supported Google languages.
Advanced Autocomplete Parameters
Serpapi Parameters
no_cache
Optional
Parameter will force SerpApi to fetch the Google Autocomplete results even if a cached version is already present. A cache is served only if the query and all parameters are exactly the same. Cache expires after 1h. Cached searches are free, and are not counted towards your searches per month. It can be set to false
(default) to allow results from the cache, or true
to disallow results from the cache. no_cache and async parameters should not be used together.
async
Optional
Parameter defines the way you want to submit your search to SerpApi. It can be set to false
(default) to open an HTTP connection and keep it open until you got your search results, or true
to just submit your search to SerpApi and retrieve them later. In this case, you'll need to use our Searches Archive API to retrieve your results. async and no_cache parameters should not be used together.
API Results
JSON Results
JSON output includes structured data for suggestions
- list of completions for provided keyword. chrome
and chrome-omni
clients also have omnibox related metadata - suggesttype
, verbatim_relevance
, clientdata
.
A search status is accessible through search_metadata.status
. It flows this way: Processing
-> Success
|| Error
. If a search has failed, error
will contain an error message. search_metadata.id
is the search ID inside SerpApi.
HTML Results
This API does not have html response, just a text. search_metadata.prettify_html_file
contains prettified version of result. It is displayed in playground.
API Examples
Example with q: coffee
parameter

{
"search_metadata": {
"id": "605881c3de9834001cb9a014",
"status": "Success",
"json_endpoint": "https://serpapi.com/searches/e577b8c1681b6153/605881c3de9834001cb9a014.json",
"created_at": "2021-03-22 11:38:43 UTC",
"processed_at": "2021-03-22 11:38:44 UTC",
"google_autocomplete_url": "https://www.google.com/complete/search?q=coffee&gl=us&hl=en&client=chrome",
"raw_html_file": "https://serpapi.com/searches/e577b8c1681b6153/605881c3de9834001cb9a014.html",
"prettify_html_file": "https://serpapi.com/searches/e577b8c1681b6153/605881c3de9834001cb9a014.prettify",
"total_time_taken": 0.26
},
"search_parameters": {
"engine": "google_autocomplete",
"q": "coffee",
"gl": "us",
"hl": "en"
},
"search_information": {
"autocomplete_results_state": "Showing completion results."
},
"suggestions": [
{
"value": "mega millions",
"relevance": 1250,
"type": "QUERY",
"serpapi_link": "https://serpapi.com/search.json?engine=google_autocomplete&q=mega+millions"
},
{
"value": "megan fox",
"relevance": 601,
"type": "QUERY",
"serpapi_link": "https://serpapi.com/search.json?engine=google_autocomplete&q=megan+fox"
},
{
"value": "megan thee stallion",
"relevance": 600,
"type": "QUERY",
"serpapi_link": "https://serpapi.com/search.json?engine=google_autocomplete&q=megan+tree+stallion"
},
...
],
"verbatim_relevance": 886
}
Example with q: t scott
and cp: 1
t| scott

{
"search_metadata": {
"id": "605882f5de98340020c8e942",
"status": "Success",
"json_endpoint": "https://serpapi.com/searches/ee108fda921ed872/605882f5de98340020c8e942.json",
"created_at": "2021-03-22 11:43:49 UTC",
"processed_at": "2021-03-22 11:43:50 UTC",
"google_autocomplete_url": "https://www.google.com/complete/search?q=t+scott&cp=1&gl=us&hl=en&client=chrome",
"raw_html_file": "https://serpapi.com/searches/ee108fda921ed872/605882f5de98340020c8e942.html",
"prettify_html_file": "https://serpapi.com/searches/ee108fda921ed872/605882f5de98340020c8e942.prettify",
"total_time_taken": 1.30
},
"search_parameters": {
"engine": "google_autocomplete",
"q": "t scott",
"cp": "1",
"gl": "us",
"hl": "en"
},
"search_information": {
"autocomplete_results_state": "Showing completion results."
},
"suggestions": [
{
"value": "travis scott",
"relevance": 601,
"type": "QUERY",
"serpapi_link": "https://serpapi.com/search.json?engine=google_autocomplete&q=travis+scott"
},
{
"value": "travis scott burger",
"relevance": 600,
"type": "QUERY",
"serpapi_link": "https://serpapi.com/search.json?engine=google_autocomplete&q=travis+scott+burger"
},
{
"value": "tim scott",
"relevance": 555,
"type": "QUERY",
"serpapi_link": "https://serpapi.com/search.json?engine=google_autocomplete&q=tim+scott"
},
...
],
"verbatim_relevance": 851
}
Example with q: t scott
and cp: 7
t scott|

{
"search_metadata": {
"id": "60588431de9834001e2a3d72",
"status": "Success",
"json_endpoint": "https://serpapi.com/searches/9071926fbf9dad59/60588431de9834001e2a3d72.json",
"created_at": "2021-03-22 11:49:05 UTC",
"processed_at": "2021-03-22 11:49:05 UTC",
"google_autocomplete_url": "https://www.google.com/complete/search?q=t+scott&cp=7&gl=us&hl=en&client=chrome",
"raw_html_file": "https://serpapi.com/searches/9071926fbf9dad59/60588431de9834001e2a3d72.html",
"prettify_html_file": "https://serpapi.com/searches/9071926fbf9dad59/60588431de9834001e2a3d72.prettify",
"total_time_taken": 1.03
},
"search_parameters": {
"engine": "google_autocomplete",
"q": "t scott",
"cp": "7",
"gl": "us",
"hl": "en"
},
"search_information": {
"autocomplete_results_state": "Showing completion results."
},
"suggestions": [
{
"value": "t scott jones",
"relevance": 1250,
"type": "QUERY",
"serpapi_link": "https://serpapi.com/search.json?engine=google_autocomplete&q=t+scott+jones"
},
{
"value": "t scott law",
"relevance": 700,
"type": "QUERY",
"serpapi_link": "https://serpapi.com/search.json?engine=google_autocomplete&q=t+scott+law"
},
{
"value": "t scott construction",
"relevance": 601,
"type": "QUERY",
"serpapi_link": "https://serpapi.com/search.json?engine=google_autocomplete&q=t+scott+construction"
},
...
],
"verbatim_relevance": 1300
}
Example with q: pewdiepie
and client: chrome
chrome
.
{
"search_metadata": {
"id": "60588593de9834001e2a3d73",
"status": "Success",
"json_endpoint": "https://serpapi.com/searches/17723d4e141789e0/60588593de9834001e2a3d73.json",
"created_at": "2021-03-22 11:54:59 UTC",
"processed_at": "2021-03-22 11:54:59 UTC",
"google_autocomplete_url": "https://www.google.com/complete/search?q=pewdiepie&gl=us&hl=en&client=chrome",
"raw_html_file": "https://serpapi.com/searches/17723d4e141789e0/60588593de9834001e2a3d73.html",
"prettify_html_file": "https://serpapi.com/searches/17723d4e141789e0/60588593de9834001e2a3d73.prettify",
"total_time_taken": 1.15
},
"search_parameters": {
"engine": "google_autocomplete",
"q": "pewdiepie",
"gl": "us",
"hl": "en",
"client": "chrome"
},
"search_information": {
"autocomplete_results_state": "Showing completion results."
},
"suggestions": [
{
"value": "pewdiepie net worth",
"relevance": 1050,
"type": "QUERY",
"serpapi_link": "https://serpapi.com/search.json?engine=google_autocomplete&q=pewdiepie+net+worth"
},
{
"value": "pewdiepie merch",
"relevance": 601,
"type": "QUERY",
"serpapi_link": "https://serpapi.com/search.json?engine=google_autocomplete&q=pewdiepie+merch"
},
{
"value": "pewdiepie chair",
"relevance": 600,
"type": "QUERY",
"serpapi_link": "https://serpapi.com/search.json?engine=google_autocomplete&q=pewdiepie+chair"
},
...
],
"verbatim_relevance": 1300
}
Example with q: pewdiepie
and client: safari
safari
.
{
"search_metadata": {
"id": "60588679de9834001e2a3d74",
"status": "Success",
"json_endpoint": "https://serpapi.com/searches/1909edfac7e1512d/60588679de9834001e2a3d74.json",
"created_at": "2021-03-22 11:58:49 UTC",
"processed_at": "2021-03-22 11:58:49 UTC",
"google_autocomplete_url": "https://www.google.com/complete/search?q=pewdiepie&gl=us&hl=en&client=safari",
"raw_html_file": "https://serpapi.com/searches/1909edfac7e1512d/60588679de9834001e2a3d74.html",
"prettify_html_file": "https://serpapi.com/searches/1909edfac7e1512d/60588679de9834001e2a3d74.prettify",
"total_time_taken": 1.13
},
"search_parameters": {
"engine": "google_autocomplete",
"q": "pewdiepie",
"gl": "us",
"hl": "en",
"client": "safari"
},
"search_information": {
"autocomplete_results_state": "Showing completion results."
},
"suggestions": [
{
"value": "pewdiepie net worth",
"relevance": 1050,
"type": "QUERY",
"serpapi_link": "https://serpapi.com/search.json?engine=google_autocomplete&q=pewdiepie+net+worth"
},
{
"value": "pewdiepie merch",
"relevance": 601,
"type": "QUERY",
"serpapi_link": "https://serpapi.com/search.json?engine=google_autocomplete&q=pewdiepie+merch"
},
{
"value": "pewdiepie chair",
"relevance": 600,
"type": "QUERY",
"serpapi_link": "https://serpapi.com/search.json?engine=google_autocomplete&q=pewdiepie+chair"
},
...
],
"verbatim_relevance": 1300
}
Example with q: pewdiepie
and gl: au
au
.
{
"search_metadata": {
"id": "6058874ede98340020c8e943",
"status": "Success",
"json_endpoint": "https://serpapi.com/searches/bd1194ee7b29e346/6058874ede98340020c8e943.json",
"created_at": "2021-03-22 12:02:22 UTC",
"processed_at": "2021-03-22 12:02:22 UTC",
"google_autocomplete_url": "https://www.google.com/complete/search?q=pewdiepie&gl=au&hl=en&client=chrome",
"raw_html_file": "https://serpapi.com/searches/bd1194ee7b29e346/6058874ede98340020c8e943.html",
"prettify_html_file": "https://serpapi.com/searches/bd1194ee7b29e346/6058874ede98340020c8e943.prettify",
"total_time_taken": 1.21
},
"search_parameters": {
"engine": "google_autocomplete",
"q": "pewdiepie",
"gl": "au",
"hl": "en",
"client": "chrome"
},
"search_information": {
"autocomplete_results_state": "Showing completion results."
},
"suggestions": [
{
"value": "pewdiepie net worth",
"relevance": 1100,
"type": "QUERY",
"serpapi_link": "https://serpapi.com/search.json?engine=google_autocomplete&q=pewdiepie+net+worth"
},
{
"value": "pewdiepie sub count",
"relevance": 601,
"type": "QUERY",
"serpapi_link": "https://serpapi.com/search.json?engine=google_autocomplete&q=pewdiepie+sub+count"
},
{
"value": "pewdiepie merch",
"relevance": 600,
"type": "QUERY",
"serpapi_link": "https://serpapi.com/search.json?engine=google_autocomplete&q=pewdiepie+merch"
},
...
],
"verbatim_relevance": 1300
}
Example with q: pewdiepie
and hl: ja

{
"search_metadata": {
"id": "6058882ede9834002292ab3a",
"status": "Success",
"json_endpoint": "https://serpapi.com/searches/5c2fb9ce14ffbd58/6058882ede9834002292ab3a.json",
"created_at": "2021-03-22 12:06:06 UTC",
"processed_at": "2021-03-22 12:06:06 UTC",
"google_autocomplete_url": "https://www.google.com/complete/search?q=pewdiepie&hl=ja&client=chrome",
"raw_html_file": "https://serpapi.com/searches/5c2fb9ce14ffbd58/6058882ede9834002292ab3a.html",
"prettify_html_file": "https://serpapi.com/searches/5c2fb9ce14ffbd58/6058882ede9834002292ab3a.prettify",
"total_time_taken": 1.04
},
"search_parameters": {
"engine": "google_autocomplete",
"q": "pewdiepie",
"hl": "ja",
"client": "chrome"
},
"search_information": {
"autocomplete_results_state": "Showing completion results."
},
"suggestions": [
{
"value": "pewdiepie net worth",
"relevance": 1000,
"type": "QUERY",
"serpapi_link": "https://serpapi.com/search.json?engine=google_autocomplete&q=pewdiepie+net+worth"
},
{
"value": "pewdiepie なぜ人気",
"relevance": 601,
"type": "QUERY",
"serpapi_link": "https://serpapi.com/search.json?engine=google_autocomplete&q=pewdiepie+なぜ人気"
},
{
"value": "pewdiepie 年収",
"relevance": 600,
"type": "QUERY",
"serpapi_link": "https://serpapi.com/search.json?engine=google_autocomplete&q=pewdiepie+年収"
},
...
],
"verbatim_relevance": 1290
}