# YouTube Autocomplete Keyword Scraper: search suggestions a to z (`steadydata/youtube-autocomplete`) Actor

YouTube's own search suggestions for up to 500 seed keywords per run, per country and language, with optional a-to-z and question-word expansion for hundreds of long-tail video keywords per seed, ranked as YouTube ranks them. Pay per suggestion.

- **URL**: https://apify.com/steadydata/youtube-autocomplete.md
- **Developed by:** [Steadydata Team](https://apify.com/steadydata) (community)
- **Categories:** SEO tools, Marketing, Automation
- **Stats:** 3 total users, 2 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $0.23 / 1,000 suggestion listeds

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

## YouTube Autocomplete Keyword Scraper: search suggestions a to z

YouTube's own search suggestions for up to 500 seed keywords per run, per country and language, with optional a-to-z and question-word expansion for hundreds of long-tail video keywords per seed, ranked as YouTube ranks them. Pay per suggestion.

### Why this scraper

- **Only delivered results are charged.** Inputs that fail come back as clear error
  records at no cost.
- The endpoint the YouTube search box itself uses, half a kilobyte per call: a seed with question-word expansion costs eleven small requests. Measured on the platform: three seeds, 109 suggestions, for fifteen hundredths of a cent.
- YouTube's own suggestions in YouTube's own order, not the Google web mix: what people type into YouTube in a given country and language. A-to-z expansion, ten question patterns and your own prefixes or suffixes turn one seed into hundreds of long-tail video keywords, de-duplicated and ranked in the order they surfaced. Suggestions that do not carry the seed are dropped, so an expansion never delivers unrelated rows.

### Who this is for

Paste seed keywords in `keywords` (up to 500 per run), set `country` and `language`, switch on `expandAlphabet` or `expandQuestions` or add `customPrefixes` (use \* for the seed position), and set `maxSuggestionsPerKeyword` (default 200). Every row carries the seed, the exact query that surfaced the suggestion, the rank, the suggestion, country and language.

### Who this is not for

YouTube returns at most about fourteen suggestions per query, so the numbers come from expansion, not from one call. The question patterns are English; for other languages set your own via `customPrefixes`. YouTube completes almost any prefix, so a seed nobody searches for still yields a few rows built on that seed. There are no search volumes here: pair the output with the Google Trends actors below for demand.

### Input example

```json
{
    "keywords": [
        "how to edit video",
        "air fryer recipe"
    ],
    "country": "US",
    "language": "en",
    "expandAlphabet": false,
    "expandQuestions": false,
    "customPrefixes": [],
    "maxSuggestionsPerKeyword": 200
}
```

### Output example

- `keyword`
- `query`
- `rank`
- `suggestion`
- `country`
- `language`

Error codes: `INVALID_KEYWORD`, `NO_SUGGESTIONS`, `BLOCKED`.

One delivered row looks like this:

```json
{
  "keyword": "air fryer",
  "query": "air fryer",
  "rank": 1,
  "suggestion": "air fryer recipes",
  "country": "US",
  "language": "en",
  "status": "ok"
}
```

### Related actors from steadydata

- [google-autocomplete](https://apify.com/steadydata/google-autocomplete): the same expansion on Google web search
- [youtube-search](https://apify.com/steadydata/youtube-search): the videos that rank for the suggested keywords
- [google-trends-compare](https://apify.com/steadydata/google-trends-compare): which suggestion is searched for more

### Pricing

Pay per event: one `suggestion-listed` event per delivered result. No charge for inputs
that fail, no separate platform-usage surcharge.

**Free Apify plan:** this actor delivers up to 25 rows per run for accounts on the Apify free
plan, and then stops with a message. That limit is set by us, not by Apify. It exists so the
actor keeps paying for itself for the people who do pay. Any paid Apify plan runs it at full
size, billed per delivered row, with failed rows never charged.

**Reviews:** if this actor saves you time, a short review on this page is the one thing that
helps most. Ratings are what other buyers look at first, and we have no other way to ask.

### FAQ

**How is this different from the Google Autocomplete actor?** Same expansion logic, different source: this one asks YouTube's search box, so the suggestions are video searches.

**Can I get search volume?** Not from autocomplete; YouTube publishes none. Use Google Trends Compare on the suggestions that matter.

**Which country and language should I set?** The market you make videos for: `country` sets the storefront (gl), `language` the interface language (hl).

**How many rows per seed?** Around ten for the seed alone, up to a few hundred with a-to-z and question expansion, capped by `maxSuggestionsPerKeyword`.

**Do I pay for a seed without suggestions?** No, that is a free error row.

**Is personal data collected?**
`query` is the exact prefix sent to YouTube (for example `air fryer c` or `how air fryer`); `rank` counts across all expansions in the order the suggestions surfaced.

**What happens when the source changes?**
Sources change from time to time; that is the nature of this work. The actor is
monitored daily and fixed fast, and while it is broken you are not charged, because
only delivered results cost anything.

# Changelog

This Actor's version history is a separate document: https://apify.com/steadydata/youtube-autocomplete/changelog.md

# Actor input Schema

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

One seed keyword per row (up to 500). A seed without suggestions comes back as a free error record.

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

Two-letter country code that sets the market (gl), e.g. US, GB, NL, DE.

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

Interface language (hl), e.g. en, nl, de. Suggestions follow the language people type in that market.

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

Also query '<seed> a' to '<seed> z' (26 extra calls per seed) for long-tail keywords.

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

Also query 'how <seed>', 'what <seed>', 'why <seed>', 'best <seed>', '<seed> vs' and similar (10 extra calls per seed). English words; set your own via customPrefixes for other languages.

## `customPrefixes` (type: `array`):

Your own expansions, one per row. Use \* for the seed position, e.g. 'beste *' or '* tutorial'. Without \* the text is used as a suffix.

## `maxSuggestionsPerKeyword` (type: `integer`):

Cost ceiling per seed across all expansions.

## Actor input object example

```json
{
  "keywords": [
    "how to edit video",
    "air fryer recipe"
  ],
  "country": "US",
  "language": "en",
  "expandAlphabet": false,
  "expandQuestions": false,
  "customPrefixes": [],
  "maxSuggestionsPerKeyword": 200
}
```

# Actor output Schema

## `results` (type: `string`):

No description

# 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": [
        "how to edit video",
        "air fryer recipe"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("steadydata/youtube-autocomplete").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": [
        "how to edit video",
        "air fryer recipe",
    ] }

# Run the Actor and wait for it to finish
run = client.actor("steadydata/youtube-autocomplete").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": [
    "how to edit video",
    "air fryer recipe"
  ]
}' |
apify call steadydata/youtube-autocomplete --silent --output-dataset

```

## MCP server setup

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

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/d8lroMPUtXuhRiEl5/builds/ngiWI4N23aD5Kh1YO/openapi.json
