# Keyword Expansion – Autocomplete & People Also Ask (`publicrows/keyword-expansion`) Actor

Seed keywords into real Google queries: Autocomplete suggestions with a-to-z and question fan-out, People Also Ask questions with the answering page, and related searches, seed and kind on every row. Licensed live data, no scraping. $1.50 per 1,000 keywords plus $0.005 per lookup.

- **URL**: https://apify.com/publicrows/keyword-expansion.md
- **Developed by:** [PublicRows](https://apify.com/publicrows) (community)
- **Categories:** SEO tools, Marketing, Automation
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $1.05 / 1,000 keyword founds

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.
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

## Keyword Expansion – Autocomplete & People Also Ask

Seed keywords into real Google queries: Autocomplete suggestions with a-to-z and question fan-out, People Also Ask questions with the answering page, and related searches, seed and kind on every row. Licensed live data, no scraping. $1.50 per 1,000 keywords plus $0.005 per lookup.

### Who this is for

Content and SEO teams building topic clusters and FAQ sections, PPC teams mining long-tail queries, and AI agents that need the questions and phrasings people actually type into Google for a topic.

### Sample output

```json
{
  "seed": "air fryer",
  "kind": "autocomplete",
  "keyword": "air fryer baked potato",
  "query_sent": "air fryer",
  "rank": 1,
  "relevance": 601,
  "suggestion_type": "QUERY",
  "answer_source_domain": null,
  "answer_url": null,
  "answer_title": null,
  "google_search_url": "https://www.google.com/search?q=air+fryer+baked+potato&hl=en&gl=US&uule=w+CAIQIFISCQs2MuSEtepUEUK33kOSuTsc",
  "location_code": 2840,
  "language_code": "en",
  "row_key": "air fryer|autocomplete|air fryer baked potato",
  "source_url": "https://dataforseo.com/apis/serp-api"
}
```

### What you get

One row per keyword. Every row also carries `_source` (attribution) and the recipe version.

| Field | Type |
| --- | --- |
| `seed` | string, always present |
| `kind` | string, always present |
| `keyword` | string, always present |
| `query_sent` | string |
| `rank` | number |
| `relevance` | number |
| `suggestion_type` | string |
| `answer_source_domain` | string |
| `answer_url` | string |
| `answer_title` | string |
| `google_search_url` | url |
| `location_code` | number |
| `language_code` | string |
| `row_key` | string, always present |
| `source_url` | string |

Every row is one query Google itself suggests: `kind` is `autocomplete`, `people_also_ask` or `related_search`, `seed` is the keyword it came from and `query_sent` the exact text sent to Autocomplete (the seed, or the seed with a letter or question word). Autocomplete rows carry Google's `rank` and `relevance`; question rows carry `answer_source_domain`, `answer_url` and `answer_title` when Google exposes the page it answers the question from; Google increasingly answers these questions with an AI-written snippet whose sources are not exposed, and then the three fields are empty.

Google serves many links through google.com redirects since November 2026; answer domains are read from the breadcrumb where Google exposes one, so a few `answer_source_domain` values may be empty while the title is present.

Cost per seed with the defaults: two lookups ($0.01) plus about 25 rows ($0.04). With both fan-outs on, a seed makes 40 Autocomplete queries and typically 200 to 400 rows. The first 20 rows of every run are free. Pipe the `keyword` column into Keyword Search Volume & CPC to size the queries.

Bring your own DataForSEO credentials in the two optional inputs if you prefer the supplier charge on your own account; the row price here stays the same either way.

### Pricing

Pay per keyword: $0.0015 each ($1.50 per 1,000), plus $0.01 per lookup (one autocomplete query or one google search). The first 20 rows of every run are free; a 20-keyword test therefore costs $0.01.

### How to run

1. Keep the defaults for the standard sample, or set the inputs (listed last, below).
2. Run. Results land in the dataset as JSON, CSV or Excel.
3. From code or an agent: call it through the API, or as an MCP tool via mcp.apify.com.

### Source and fair use

Data: Google Autocomplete and search results through the DataForSEO SERP API, licensed. The data is bought from the supplier under its API terms on every run; nothing is scraped from any website. Rows are facts about keywords, and no personal data of individuals is included.

### FAQ

**How fresh is the data?** Each run fetches live from the source.
**Can I get more fields?** Open an issue naming the field and where it appears at the source.
**Something broke?** Open an issue. Issues are answered within 12 hours.
**Found it useful?** A short review on this page helps other people find it, and tells us what to improve.

### Inputs

- `seeds`: One seed keyword per line (commas also work). Each seed is expanded by every source you switch on below.
- `location`: Country whose Google suggestions and results are used.
- `language`: Language of the suggestions and results.
- `includeAutocomplete`: Google Autocomplete suggestions for the seed as typed (up to 15 per query).
- `includePeopleAlsoAsk`: The People Also Ask questions Google shows for the seed, with the page Google answers them from (one Google search per seed, shared with related searches).
- `includeRelatedSearches`: The related searches at the bottom of the seed's results page (shares the search with People Also Ask).
- `expandAlphabet`: Also query Autocomplete with the seed followed by a to z (26 more queries per seed, usually 150 to 300 more suggestions).
- `expandQuestions`: Also query Autocomplete with how, what, why, when, where, which, who, can, does, is, are and best in front of the seed (12 more queries per seed).
- `sandbox`: Use the supplier's test environment: same row structure, dummy data, no supplier charge. For wiring tests only.
- `dfsLogin`: Optional: your own DataForSEO API login (the account e-mail). Leave empty to use ours.
- `dfsPassword`: Optional: your own DataForSEO API password. Leave empty to use ours.
- `maxItems`: Stop after this many rows.

# Actor input Schema

## `seeds` (type: `string`):

One seed keyword per line (commas also work). Each seed is expanded by every source you switch on below.

## `location` (type: `string`):

Country whose Google suggestions and results are used.

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

Language of the suggestions and results.

## `includeAutocomplete` (type: `boolean`):

Google Autocomplete suggestions for the seed as typed (up to 15 per query).

## `includePeopleAlsoAsk` (type: `boolean`):

The People Also Ask questions Google shows for the seed, with the page Google answers them from (one Google search per seed, shared with related searches).

## `includeRelatedSearches` (type: `boolean`):

The related searches at the bottom of the seed's results page (shares the search with People Also Ask).

## `expandAlphabet` (type: `boolean`):

Also query Autocomplete with the seed followed by a to z (26 more queries per seed, usually 150 to 300 more suggestions).

## `expandQuestions` (type: `boolean`):

Also query Autocomplete with how, what, why, when, where, which, who, can, does, is, are and best in front of the seed (12 more queries per seed).

## `sandbox` (type: `boolean`):

Use the supplier's test environment: same row structure, dummy data, no supplier charge. For wiring tests only.

## `dfsLogin` (type: `string`):

Optional: your own DataForSEO API login (the account e-mail). Leave empty to use ours.

## `dfsPassword` (type: `string`):

Optional: your own DataForSEO API password. Leave empty to use ours.

## `maxItems` (type: `integer`):

Stop after this many rows.

## Actor input object example

```json
{
  "seeds": "air fryer\nstanding desk\nhow to lower cholesterol",
  "location": "2840",
  "language": "en",
  "includeAutocomplete": true,
  "includePeopleAlsoAsk": true,
  "includeRelatedSearches": true,
  "expandAlphabet": false,
  "expandQuestions": false,
  "sandbox": false,
  "maxItems": 5000
}
```

# Actor output Schema

## `rows` (type: `string`):

Dataset items, one per keyword (seed, kind, keyword, query_sent, rank, relevance, suggestion_type, answer_source_domain, answer_url, answer_title, google_search_url, location_code, language_code, row_key, source_url). Append ?format=csv or ?format=xlsx for other formats.

## `runSummary` (type: `string`):

Pages fetched, response classes, cost estimate and the quality-gate checks for this run.

# 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 = {
    "seeds": `air fryer
standing desk
how to lower cholesterol`,
    "location": "2840",
    "language": "en",
    "maxItems": 5000
};

// Run the Actor and wait for it to finish
const run = await client.actor("publicrows/keyword-expansion").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 = {
    "seeds": """air fryer
standing desk
how to lower cholesterol""",
    "location": "2840",
    "language": "en",
    "maxItems": 5000,
}

# Run the Actor and wait for it to finish
run = client.actor("publicrows/keyword-expansion").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 '{
  "seeds": "air fryer\\nstanding desk\\nhow to lower cholesterol",
  "location": "2840",
  "language": "en",
  "maxItems": 5000
}' |
apify call publicrows/keyword-expansion --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,publicrows/keyword-expansion"
        }
    }
}
```

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/qc2Jl6lK6gadagsts/builds/44zLfsGxffX5rfhoo/openapi.json
