Skip to main content
ScrapingRabbit

Blog · · 4 min read

Find Keyword Ideas With Google Autocomplete (and Code)

Pull the phrases Google suggests as people type, filter out the non-keywords, and expand one seed into dozens of ideas with a short script. Tested code included.

When you type into Google's search box, it suggests how your phrase might continue. Those suggestions come from what many people really search for, which makes them a free source of keyword and content ideas. This guide shows how to read them as data, and how to turn a single starting phrase into dozens of ideas.

One request, one list

The endpoint takes your phrase as query. Every call needs an API key. New accounts get 100 free credits and a first key is created automatically on sign-up (it is shown once on the dashboard). Sign in at scrapingrabbit.com/login, then send the key in the x-api-key header (a Bearer token also works). The code below reads it from the SCRAPINGRABBIT_API_KEY environment variable, so no key is ever written into your code.

curl -H "x-api-key: $SCRAPINGRABBIT_API_KEY" "https://api.scrapingrabbit.com/v1/google/autocomplete?query=youtube+transcript"

A successful call costs 1 credit.

The answer has the phrase you sent and a list of suggestions. Each suggestion has three fields:

FieldMeaning
valueThe suggested text
relevanceA number Google attaches to the suggestion. The list comes back with the highest first.
typeQUERY for a search phrase, NAVIGATION for a website address

In our test, a request returned 15 suggestions. The top ones for "youtube transcript" were "youtube transcript generator", "youtube transcript generator free" and "youtube transcript download".

Filter out the non-keywords

In that same list there was one entry with type set to NAVIGATION: it was a bare web address, https://youtubetotranscript.com/. Google offers those as direct shortcuts. They are not phrases people search for, so they do not belong in a keyword list. Keep only the QUERY entries:

async function suggest(phrase) {
  const url = `https://api.scrapingrabbit.com/v1/google/autocomplete?query=${encodeURIComponent(phrase)}`;
  const res = await fetch(url, { headers: { "x-api-key": process.env.SCRAPINGRABBIT_API_KEY } });
  const body = await res.json();
  if (!body.success) return [];
  return body.data.suggestions.filter((s) => s.type === "QUERY").map((s) => s.value);
}

If a request fails, the function returns an empty list instead of crashing, so a loop can carry on. Failed calls are not charged.

Turn one phrase into many

A single request gives about 15 ideas. To get more, add a letter after your phrase and ask again. Typing "youtube transcript a" makes Google suggest phrases that continue with a word starting with "a". In our test that produced "youtube transcript ai", "youtube transcript api" and "youtube transcript app", none of which were in the first list.

Here is a script that does it for any letters you choose and removes duplicates:

const wait = (ms) => new Promise((resolve) => setTimeout(resolve, ms));

async function expand(seed, letters) {
  const found = new Set(await suggest(seed));
  for (const letter of letters) {
    for (const phrase of await suggest(`${seed} ${letter}`)) found.add(phrase);
    await wait(6500);
  }
  return [...found];
}

const ideas = await expand("youtube transcript", ["a", "b", "c"]);
console.log(ideas.length, "unique phrases");

We ran this with the letters a, b and c. Four requests produced 57 unique phrases, at 1 credit per request. Run it across the whole alphabet and you will have several hundred ideas from one seed, which is far more than you could think of alone.

A Set keeps each phrase once, even when two letters suggest the same one.

Be polite with requests

Each key is limited per minute: 10 requests on the free plan, 60 on Starter, 120 on Pro and 300 on Scale. Going over returns a 429 with code RATE_LIMITED and a Retry-After header in seconds. A full alphabet run uses 27 requests, which is 27 credits, so do not run many seeds at once. The 6.5 second pause in the script keeps it under the free plan's 10 requests per minute. On a bigger plan you can shorten it. If you hit the limit, wait the number of seconds in Retry-After.

Turn ideas into a plan

A list of phrases is only the start. A few steps make it useful:

  1. Group by topic. Phrases that share a word often share an intent. Put them in clusters.
  2. Look for questions. Seeds such as "how", "can" and "why" show what people want explained, which suits articles and guides.
  3. Check the value. Autocomplete does not tell you volume, so take your best phrases to a tool that does.
  4. Look at the results. Search each phrase and see what already ranks. If every result is a large site, a small site may find that phrase hard.

What autocomplete cannot tell you

Suggestions show what is popular, not how many searches happen, and they can change with country, language and time. They also reflect what Google chooses to show, which can leave out some phrases. Treat the list as a source of ideas, not as measurement.

Try it without code

The free Google autocomplete tool works in the browser with no key. It shows the suggestions for any phrase and copies the whole list in one click. It already leaves out the website-address entries, so what you copy is search phrases only.

Try it yourself

Frequently asked questions

Do autocomplete suggestions show search volume?

No. They show which phrases are popular enough to be suggested, in a ranked order. To size a topic you need a tool that reports search volume.

Why does one suggestion look like a web address?

Google sometimes offers a direct website as a suggestion. The API marks it with the type NAVIGATION. It is not a search phrase, so filter it out of keyword lists.

Will I get the same suggestions in every country?

Not always. Suggestions can differ by country, language and time, so treat a list as a snapshot.

More guides