GET /google/autocomplete

Autocomplete

Get Google search autocomplete suggestions for a given query string.

Google SERP API

Retrieve autocomplete suggestions from Google Search for a given query. This endpoint returns the same suggestions that appear in the Google search bar as users type, useful for keyword research, search UX enhancements, and understanding search intent.

HTTP Request

1
GET /google/autocomplete

Parameters

ParameterTypeRequiredDefaultDescription
qstringYesThe query string to get suggestions for
hlstringNo"en"Language code for suggestions (e.g., en, es, fr)
pqstringNoPrevious query, used by Google to provide context-aware suggestions

Response

The response returns a JSON array of suggestion strings.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
[
  "openai api pricing",
  "openai api key",
  "openai api documentation",
  "openai api python",
  "openai api playground",
  "openai api rate limits",
  "openai api models",
  "openai api tutorial"
]

Code Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
import requests

url = "https://google-serp-search-api.p.rapidapi.com/google/autocomplete"

querystring = {
    "q": "openai api",
    "hl": "en"
}

headers = {
    "X-RapidAPI-Key": "YOUR_API_KEY",
    "X-RapidAPI-Host": "google-serp-search-api.p.rapidapi.com"
}

response = requests.get(url, headers=headers, params=querystring)
suggestions = response.json()

for suggestion in suggestions:
    print(suggestion)
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
const url = "https://google-serp-search-api.p.rapidapi.com/google/autocomplete";

const params = new URLSearchParams({
  q: "openai api",
  hl: "en",
});

const response = await fetch(`${url}?${params}`, {
  method: "GET",
  headers: {
    "X-RapidAPI-Key": "YOUR_API_KEY",
    "X-RapidAPI-Host": "google-serp-search-api.p.rapidapi.com",
  },
});

const suggestions = await response.json();
suggestions.forEach((suggestion) => console.log(suggestion));
1
2
3
4
5
curl -G "https://google-serp-search-api.p.rapidapi.com/google/autocomplete" \
  --data-urlencode "q=openai api" \
  --data-urlencode "hl=en" \
  -H "X-RapidAPI-Key: YOUR_API_KEY" \
  -H "X-RapidAPI-Host: google-serp-search-api.p.rapidapi.com"
  • Search — Perform a full Google web search
Start building today

Get your API key and make your first request in under a minute.

Get Your API Key on RapidAPI