Google APIs · Autocomplete

Google Autocomplete API

Google's search-box suggestions for text as typed, as JSON: 15 suggestions with Google's relevance score, or the box's own 10 with the people, places and things Google knows. For keyword research, query ideas and search boxes of your own.

What people type next

Send the text as typed, spaces kept: how to asks what follows. client=chrome gives 15 suggestions with relevance; client=gws-wiz gives the box's 10, with things Google knows.

curl -G https://api.serpbit.com/v1/autocomplete \
  -H "Authorization: Bearer $SERPBIT_API_KEY" \
  --data-urlencode "q=golden ret" \
  --data-urlencode "client=gws-wiz"

{
  "suggestions": [
    { "position": 1, "value": "golden retriever", "type": "ENTITY",
      "title": "Golden Retriever", "description": "Dog breed" },
    { "position": 2, "value": "golden retriever puppies", "type": "QUERY" }
  ]
}

What comes back

The same call in Python and JavaScript

Three prefixes, three calls: every suggestion once, with its best relevance. The clients read the key from SERPBIT_API_KEY and retry a failed call without billing it twice. Any HTTP client works too.

# pip install serpbit
from serpbit import Serpbit

sb = Serpbit()  # reads SERPBIT_API_KEY
seen = {}
for prefix in ["how to ", "how to a", "how to b"]:
    answer = sb.autocomplete(prefix, gl="us", hl="en")
    for s in answer["suggestions"]:
        seen[s["value"]] = max(seen.get(s["value"], 0), s.get("relevance", 0))

for value, score in sorted(seen.items(), key=lambda kv: -kv[1]):
    print(score, value)
// npm install serpbit
import Serpbit from "serpbit";

const sb = new Serpbit(); // reads SERPBIT_API_KEY
const seen = new Map();
for (const prefix of ["how to ", "how to a", "how to b"]) {
  const answer = await sb.autocomplete(prefix, { gl: "us", hl: "en" });
  for (const s of answer.suggestions) {
    seen.set(s.value, Math.max(seen.get(s.value) ?? 0, s.relevance ?? 0));
  }
}
console.log([...seen].sort((a, b) => b[1] - a[1]));

Response fields

The main fields of the answer. Some come only with one client, as marked. The reference has every parameter.

FieldTypeWhat it holds
suggestions[]arrayThe suggestions, in the box's order: 15 with client=chrome, 10 with gws-wiz.
positionintegerThe suggestion's place in the list.
valuestringThe suggested text: "golden retriever puppies".
typestringThe kind of suggestion: QUERY for a plain query, ENTITY for a thing Google knows, or NAVIGATION.
relevanceintegerGoogle's score for the suggestion. client=chrome.
highlightedstringThe suggestion with what Google added in <b>. client=gws-wiz.
title, descriptionstringA known thing's name and line: "Golden Retriever", "Dog breed". client=gws-wiz.
thumbnailstringA known thing's picture. client=gws-wiz.
verbatim_relevanceintegerGoogle's score for the text as typed. client=chrome.
searchobjectWhat was asked: q, gl, hl, client, and cp when given.
meta.creditsintegerThe credits the call spent.
request_idstringThe call's id, to quote to support.

What it is used for

Grow a keyword list

Ask a seed word followed by each letter, "espresso a", "espresso b" and so on, and keep every value with its relevance.

Find the questions people ask

Send "how to ", "why does " or "can I " with the trailing space. The suggestions are what people type after those words.

See what your brand suggests

Type your brand's name and read what Google suggests after it, for the country and language you ask from.

Compare countries and languages

Ask the same text with another gl and hl to see what people elsewhere type.

What 1,000 cost

1 credit a call, on the same key and credits as every other API. A call that fails is free, and so is the same call again within the hour.

PlanPrice a monthCalls a monthPer 1,000
Free$01,000free
Starter$2525,000$1.00
Developer$75100,000$0.75
Production$150300,000$0.50
Scale$350800,000$0.44

In US dollars before tax. All plans and credit packs are on the pricing page.

Questions

Which client should I use?

chrome, the default, for more suggestions with a relevance score: good for keyword research. gws-wiz for exactly what Google's search box shows, with the things it knows.

Why keep the trailing space?

Because Google reads it: how to suggests ways to finish the words, while how to with a space suggests what comes after them.

Can I get suggestions for another country?

Yes. gl sets the country and hl the language, as they do on every other API.

Can I get it as Markdown?

Yes. output=md returns the suggestions as Markdown, ready for a language model.

Can an AI agent use it?

Yes. Our MCP server has it as the google_autocomplete tool: add https://api.serpbit.com/mcp as a connector in Claude, ChatGPT or Cursor and sign in.

Is Serpbit part of Google?

No. Serpbit is not affiliated with Google; Google is a trademark of Google LLC.

Start with 1,000 free credits.

Every month. No card.