# SERP + PAA + AI Overview Content-Gap Pack (`vesperxiv/serp-content-gap-pack`) Actor

For a list of keywords and a target domain, returns real Google SERP data (organic results, People Also Ask, related searches, AI Overview), clusters the ranking competitor domains, and lists the content-gap topics your domain does not rank for -- as a dataset plus a content-gap CSV.

- **URL**: https://apify.com/vesperxiv/serp-content-gap-pack.md
- **Developed by:** [Vesper](https://apify.com/vesperxiv) (community)
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $10.00 / 1,000 price per keyword serp packs

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

## SERP + PAA + AI Overview Content-Gap Pack

Give it a list of keywords and a target domain. For every keyword it pulls a real Google SERP — organic results, **People Also Ask**, related searches, and **AI Overview** — clusters the ranking competitor domains, checks whether your domain ranks, and lists the **content-gap topics**: the PAA questions and related searches Google associates with the keyword that your domain does **not** rank for.

Built for SEO agencies, affiliate/content teams, and AI-search (AEO/GEO) consultants who need a ready-to-brief gap list, not raw SERP JSON.

### What you get

- **Dataset — one item per keyword:** organic results (position, title, URL, domain, snippet), PAA questions, related searches, AI Overview presence + text + cited sources, your domain's best rank (or null), competitor domain clusters, and the gap-topic list with a `gapCount`.
- **`content-gap.csv`** (key-value store): one row per topic — keyword, topic, topic source (`paa` / `related`), whether the target ranks, `isGap`, top competitor domain + URL, AI Overview presence.
- **`summary.json`**: totals (keywords ok/failed, gap topics, keywords with AI Overview, keywords where the target ranks) and a per-keyword rollup.

### Input

| Field | What it is |
|---|---|
| `keywords` | One keyword per line, up to `maxKeywords` (default 50, max 100). |
| `targetDomain` | e.g. `example.com`. Gap = PAA/related topic where this domain is absent from the top 10. |
| `countryCode` / `languageCode` | Google `gl` / `hl`, defaults `us` / `en`. |
| `maxResultsPerKeyword` | Organic results kept per keyword, default 10. |
| `includeAiOverview` | Include the AI Overview text (default on; presence is always reported). Free. |
| `enableAiOverviewAddon` | Off by default. Asks the scraper to use a specialized proxy to capture the full AI Overview more often — costs extra per captured overview on your account. The base scrape already returns the AI Overview when Google shows one. |
| `useBingFallback` | If Google returns nothing for a keyword, fall back to Bing HTML organic results for that keyword, flagged `source: bing-fallback` (no PAA / related / AI Overview). |
| `googleSearchScraperActorId` | Actor used for Google data, default `apify/google-search-scraper`. |

### How the data is fetched

Google blocks direct datacenter fetches, so this Actor does **not** scrape Google itself. It starts one batched run of Apify's official **Google Search Results Scraper** (`apify/google-search-scraper`) for all your keywords, then analyses that run's dataset. One source failing never kills the run: failures are isolated per keyword, and the Bing fallback covers keywords Google missed.

### Pricing — read this before you run it

- **This Actor: $0.01 per successfully processed keyword** (pay-per-event `keyword-pack`).
- **Plus the Google data:** the sub-run of `apify/google-search-scraper` is billed to the same account at its own rate — about **$0.0045 per results page on the Free plan** ($0.0025 Starter, $0.0018 Business) plus a $0.00005 run start (one run per pack, shared across all keywords). So the **all-in cost is roughly $0.0145 / keyword on the Free plan** (~$0.73 for a 50-keyword pack), ~$0.0125 on Starter.
- The AI Overview in the output comes from the scraper's base page extraction, at no extra cost. Only the optional add-on costs extra.

### Limits

- A "gap topic" is a heuristic: a PAA question or related search Google associates with the keyword, where the target domain does not appear in that keyword's top-10 organic results. It is a brief for writers, not proof the target has no page on the topic.
- PAA answers are not expanded (questions only); AI Overview text is truncated to 4,000 characters.
- Competitor domains are clustered by registrable domain (last two labels, with a small list of two-level suffixes like `co.uk`).
- Google result counts vary by query (typically 9–10 organic results per page).
- The Bing fallback returns organic results only and may itself be rate-limited on some networks; those items are always flagged.
- Max 100 keywords per run; batch larger lists across runs.

# Actor input Schema

## `countryCode` (type: `string`):

Google gl parameter, e.g. us, gb, de.

## `enableAiOverviewAddon` (type: `boolean`):

Ask the Google scraper to use its specialized proxy to capture the full AI Overview more often. OFF by default: the base scrape already returns the AI Overview when Google shows one, and the add-on costs extra per captured overview on your account.

## `googleSearchScraperActorId` (type: `string`):

Actor used for the Google SERP data. Defaults to Apify's official Google Search Results Scraper. Its usage is billed to your account on top of this Actor's per-keyword price.

## `includeAiOverview` (type: `boolean`):

Include the AI Overview text in the output when Google shows one. Presence is always reported; this only toggles the full text. No extra cost.

## `keywords` (type: `string`):

One keyword per line (up to maxKeywords). Each keyword gets one Google SERP: organic results, People Also Ask, related searches, and AI Overview presence.

## `languageCode` (type: `string`):

Google hl parameter, e.g. en, de, fr.

## `maxKeywords` (type: `integer`):

Maximum keywords processed per run (1-100).

## `maxResultsPerKeyword` (type: `integer`):

How many organic results to keep per keyword (1-10).

## `targetDomain` (type: `string`):

The domain to check for ranking and content gaps, e.g. example.com. Gap topics are the PAA questions and related searches for which this domain does not rank in the top 10.

## `useBingFallback` (type: `boolean`):

If the Google scraper returns nothing for a keyword, fall back to Bing HTML organic results for that keyword (flagged as source bing-fallback, without PAA / related searches / AI Overview).

## Actor input object example

```json
{
  "countryCode": "us",
  "enableAiOverviewAddon": false,
  "googleSearchScraperActorId": "apify/google-search-scraper",
  "includeAiOverview": true,
  "keywords": "best CRM software for small business\ncrm for freelancers",
  "languageCode": "en",
  "maxKeywords": 50,
  "maxResultsPerKeyword": 10,
  "targetDomain": "hubspot.com",
  "useBingFallback": true
}
```

# Actor output Schema

## `contentGapCsv` (type: `string`):

No description

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

No description

## `summary` (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 = {
    "countryCode": "us",
    "enableAiOverviewAddon": false,
    "googleSearchScraperActorId": "apify/google-search-scraper",
    "includeAiOverview": true,
    "keywords": `best CRM software for small business
crm for freelancers
how to choose a CRM`,
    "languageCode": "en",
    "maxKeywords": 50,
    "maxResultsPerKeyword": 10,
    "targetDomain": "example.com",
    "useBingFallback": true
};

// Run the Actor and wait for it to finish
const run = await client.actor("vesperxiv/serp-content-gap-pack").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 = {
    "countryCode": "us",
    "enableAiOverviewAddon": False,
    "googleSearchScraperActorId": "apify/google-search-scraper",
    "includeAiOverview": True,
    "keywords": """best CRM software for small business
crm for freelancers
how to choose a CRM""",
    "languageCode": "en",
    "maxKeywords": 50,
    "maxResultsPerKeyword": 10,
    "targetDomain": "example.com",
    "useBingFallback": True,
}

# Run the Actor and wait for it to finish
run = client.actor("vesperxiv/serp-content-gap-pack").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 '{
  "countryCode": "us",
  "enableAiOverviewAddon": false,
  "googleSearchScraperActorId": "apify/google-search-scraper",
  "includeAiOverview": true,
  "keywords": "best CRM software for small business\\ncrm for freelancers\\nhow to choose a CRM",
  "languageCode": "en",
  "maxKeywords": 50,
  "maxResultsPerKeyword": 10,
  "targetDomain": "example.com",
  "useBingFallback": true
}' |
apify call vesperxiv/serp-content-gap-pack --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,vesperxiv/serp-content-gap-pack"
        }
    }
}
```

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/2CzBCVT8vVZyLsQUg/builds/2fJ6MMRLVykezkLNI/openapi.json
