# Google Autocomplete Keywords — with Relevance Scores (`xtracto/google-autocomplete-keywords`) Actor

Turn a seed keyword into the phrases people actually type, straight from Google's autocomplete, with Google's own relevance score on every suggestion. Alphabet, question and comparison expansions for depth. Web, YouTube, Images and Shopping. You set the language and country. Keyless.

- **URL**: https://apify.com/xtracto/google-autocomplete-keywords.md
- **Developed by:** [Farhan Febrian Nauval](https://apify.com/xtracto) (community)
- **Categories:** SEO tools, Lead generation
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $1.00 / 1,000 results

This Actor is paid per event and usage. You are charged both the fixed price for specific events and for Apify platform usage.
Since this Actor supports Apify Store discounts, the price gets lower the higher subscription plan you have.

Learn more: https://docs.apify.com/actors/running/actors-in-store.md#pay-per-event

## What's an Apify Actor?

An Actor is a serverless cloud program that runs on the Apify platform. It has two run modes.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.

Apify vocabulary and the platform model are defined once, in the agent quickstart at https://apify.com/agents.md.

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.

Do not guess an integration path. Every one of them is in the agent quickstart at https://apify.com/agents.md: the Apify MCP server, Agent Skills with the Apify CLI, the JavaScript and Python clients, the REST API, and the account-free path for an agent with no human to sign in. It also carries the rule on stating cost before the first paid run.

For examples already wired to this Actor's own input schema, see the [API](#api) section below.

Each client library has reference documentation the quickstart does not restate: [JavaScript/TypeScript](https://docs.apify.com/api/client/js/docs.md) (`npm install apify-client`) and [Python](https://docs.apify.com/api/client/python/docs.md) (`pip install apify-client`).

# README

## Google Autocomplete Keywords — with Relevance Scores

Turn one seed into the phrases people actually type, straight from Google's autocomplete —
and with **Google's own relevance score** on every suggestion, not a score invented here.

Keyless. No login, no browser, no proxy, no API key.

### What you get

| Field | Example |
|---|---|
| `keyword` | `budget tracker google sheets` |
| `relevance` | `601` — Google's own ordering weight |
| `seed` / `query` | `budget tracker` / `budget tracker how` |
| `expansionToken` | `how` (null for the seed's own query) |
| `rankInQuery` | `2` — position within that query's suggestions |
| `dataset` / `language` / `country` | `web` / `en` / `us` |

Measured on one seed: `budget tracker` with the **questions** expansion returned
**67 unique keywords from 14 requests**, every one carrying a relevance score.

### Google returns 15 per query. Depth comes from asking differently

Every populated dataset returned exactly 15 suggestions, so 15 is treated as a cap rather
than a coincidence — and the actor says so in the log when a run hits it on every seed.

| Expansion | Queries per seed | What it surfaces |
|---|---|---|
| `none` | 1 | the plain 15 |
| `alphabet` | 27 | the widest net — a to z appended |
| `questions` | 14 | how / what / why / when — content and FAQ work |
| `prepositions` | 14 | for / with / vs / near — intent and use cases |
| `comparisons` | 9 | vs / alternative / better than — competitors |

Suggestions are de-duplicated across an expansion, because the seed itself comes back under
almost every token. The first sighting wins, so `rankInQuery` and `relevance` always belong
to the `query` recorded on the row.

### Set the language and country, or your server sets them for you

This is the one input worth reading twice. With `hl`/`gl` unset, Google answers for
wherever the request came from. Same query, same second, three locales:

| Setting | First suggestions |
|---|---|
| unset, from an Indonesian connection | `budget tracker adalah`, `budget tracker template` |
| `hl=en&gl=us` | `budget tracker template`, `budget tracker google sheets` |
| `hl=de&gl=de` | `budget tracker app`, `budget tracker excel`, `budget tracker notion` |

Both are sent on every request and recorded on every row, so two runs for two markets stay
comparable.

### Four datasets, because only four of Google's eight do anything

`ds=` selects a vertical. Compared against the web result set for the same query:

| Dataset | Result | Offered? |
|---|---|---|
| Web | the baseline, 15 suggestions | yes |
| YouTube | 15 suggestions, **12 differ** | yes |
| Images | 15 suggestions, **6 differ** | yes |
| Shopping | 7 suggestions, **4 differ** | yes |
| News | 15 suggestions, **0 differ** — accepted and silently ignored | **no** |
| Books, Video, Recipes, Products | empty | **no** |

A "news keyword research" mode would have shipped returning plain web suggestions while
looking like it worked. Only the datasets that demonstrably change the answer are offered,
and the rest are named here so nobody re-adds them.

### This is not the results page

Autocomplete is the endpoint a browser calls while you type. It answers in well under a
kilobyte and needs no proxy, which is why a run of this costs almost nothing. It reports
what Google *suggests*, which is a signal about demand — it is not a rank tracker and does
not claim search volume.

# Actor input Schema

## `keywords` (type: `array`):

One or more seeds to expand, such as 'budget tracker' or 'best running shoes'. Each seed is expanded independently and every row says which seed it came from.

## `expansion` (type: `string`):

Google returns at most 15 suggestions per query, so depth comes from asking more than once. 'none' asks once per seed. 'alphabet' appends a to z (27 queries per seed) and is the widest net — one seed went from 15 to 57 unique keywords. 'questions' appends how/what/why/when and friends, which is what you want for content and FAQ work. 'prepositions' appends for/with/vs/near, which surfaces intent and use cases. 'comparisons' appends vs/alternative/better than, which surfaces competitors.

## `dataset` (type: `string`):

Which autocomplete Google should answer from. Only the four listed here demonstrably change the result: measured against the Web baseline for the same query, YouTube differed on 12 of 15 suggestions, Images on 6 of 15, and Shopping on 4 of 7. Google's other datasets are not offered on purpose — News is accepted and then silently ignored (it returns the Web suggestions byte for byte), and Books, Video, Recipes and Products return nothing at all.

## `language` (type: `string`):

Interface language code, such as en, de, id or pt. This is not cosmetic: with no language set, Google answers for wherever the request comes from. The same query from an Indonesian connection returned 'budget tracker adalah' unset, 'budget tracker google sheets' with hl=en, and 'budget tracker excel' with hl=de. Set it to your audience, not to your server.

## `country` (type: `string`):

Two-letter country code, such as us, de, id or br. Works with the language code to place the suggestions in a market. Sent on every request and recorded on every row, so two runs for two markets stay comparable.

## `maxKeywordsPerSeed` (type: `integer`):

Stop a seed once it has produced this many unique keywords. Useful with the alphabet expansion, where a broad seed can run well past what you need. It caps output, not requests.

## Actor input object example

```json
{
  "keywords": [
    "budget tracker"
  ],
  "expansion": "none",
  "dataset": "web",
  "language": "en",
  "country": "us",
  "maxKeywordsPerSeed": 100
}
```

# Actor output Schema

## `overview` (type: `string`):

Dataset items shown in the 'Keywords' view.

## `items` (type: `string`):

Every record this run produced, with all fields, as JSON.

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {
    "keywords": [
        "budget tracker"
    ],
    "language": "en",
    "country": "us"
};

// Run the Actor and wait for it to finish
const run = await client.actor("xtracto/google-autocomplete-keywords").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = {
    "keywords": ["budget tracker"],
    "language": "en",
    "country": "us",
}

# Run the Actor and wait for it to finish
run = client.actor("xtracto/google-autocomplete-keywords").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
for item in client.dataset(run.default_dataset_id).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{
  "keywords": [
    "budget tracker"
  ],
  "language": "en",
  "country": "us"
}' |
apify call xtracto/google-autocomplete-keywords --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,xtracto/google-autocomplete-keywords"
        }
    }
}
```

The hosted server signs you in with OAuth on first connect, so no API token belongs in this config. Clients without OAuth support can send an `Authorization: Bearer <APIFY_API_TOKEN>` header instead, using a token from API & Integrations in Apify Console (https://console.apify.com/settings/integrations).

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/CYdOo3Nyfv29ULkaN/builds/3gd5uJBsRiDX21JMi/openapi.json
