# Google SERP Scraper & AI Competitor Content-Gap Analyzer (`cautious_canteen_a8q/my-actor`) Actor

Scrapes Google SERPs, crawls top-ranking competitor pages in parallel, and extracts structured content gaps and AI SEO blueprints without headless browser overhead.

- **URL**: https://apify.com/cautious_canteen_a8q/my-actor.md
- **Developed by:** [Oki ei](https://apify.com/cautious_canteen_a8q) (community)
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $21.00 / 1,000 keyword analyzed (byok)s

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 & Competitor Content-Gap Analyzer (AI SEO Blueprint)

**Automate Google SERP competitor research, extract full H1/H2/H3 heading structures, word counts, and JSON-LD schema markup, and generate an AI-powered content-gap & outrank blueprint using Google Gemini.**

Built for **SEO agencies, content marketers, niche site builders, and AI workflow engineers (n8n, Make, Zapier, MCP)** who want to turn any target keyword into a data-backed article outline in seconds—without manual tab-hopping or bloated SEO suite subscriptions.

***

### Why Use This Actor?

Instead of manually opening the top 10 Google results, counting words, inspecting source code for schema markup, and guessing what topics competitors missed, this Actor executes the entire SEO research pipeline in a single automated run:

1. **Live Localized Google SERP Extraction**: Fetches top-ranking organic pages, featured snippets, and *People Also Ask* (PAA) questions for any country (`gl`) and language (`hl`).
2. **Concurrent Competitor Page Crawler**: Visits top-ranking URLs in parallel to extract:
   - Meta Title & Meta Description
   - Clean body word count (excluding nav/footer boilerplate)
   - Full `H1` and `H2` heading outlines + `H3` subheading counts
   - JSON-LD Schema types (`Article`, `FAQPage`, `Product`, `Review`, etc.)
   - FAQ section detection & internal/external link counts
3. **AI Content-Gap & Outrank Blueprint (Gemini 2.5 Flash)**: Synthesizes all competitor metrics and PAA questions to output:
   - Search Intent classification (`Informational`, `Commercial Investigation`, `Transactional`, `Navigational`)
   - Keyword Difficulty estimate & recommended target word count
   - **Competitor Blind Spots**: Specific angles, data points, and subtopics missing from current top results
   - High-CTR SEO Title tag & structured `H2` Outrank Outline
   - Strategic 2-sentence differentiation hook on how to beat the #1 ranking page

***

### Bring Your Own Key (BYOK) Architecture

This Actor runs on a **BYOK (Bring Your Own Key)** model for maximum transparency, rate-limit control, and zero markup on underlying API tokens:

- **Serper.dev API Key** (`userSerperApiKey`): Used for fast, real-time Google Search SERP & People Also Ask extraction (free tier available at [serper.dev](https://serper.dev)).
- **Google Gemini API Key** (`userGeminiApiKey`): Used for structured content-gap analysis and outrank outline generation (free tier available at [Google AI Studio](https://aistudio.google.com)).

> **Demo Mode:** If you run the Actor with both API key fields left blank, it returns a complete sample output record without charging any usage fee—ideal for testing JSON schemas and n8n/Make webhook integrations.

***

### Input Parameters

| Field | Type | Default | Description |
| :--- | :--- | :--- | :--- |
| `keywords` | `array` | `["best warehouse automation software"]` | List of target Google search keywords to analyze. |
| `countryCode` | `string` | `"us"` | Two-letter Google country code (`us`, `uk`, `ca`, `au`, `jp`, `de`, etc.). |
| `languageCode` | `string` | `"en"` | Language code for Google search results (`en`, `ja`, `es`, `de`, etc.). |
| `topCompetitorsCount` | `integer` | `5` | Number of top organic search results to crawl and analyze (`1` to `10`). |
| `userSerperApiKey` | `string` (secret) | `""` | Your Serper.dev API key for live SERP retrieval. |
| `userGeminiApiKey` | `string` (secret) | `""` | Your Google Gemini API key for AI SEO blueprint generation. |

***

### Example Output (JSON)

```json
{
  "keyword": "best warehouse automation software",
  "countryCode": "us",
  "languageCode": "en",
  "serpFeaturesDetected": ["PeopleAlsoAsk", "OrganicResults"],
  "peopleAlsoAsk": [
    "What is the ROI of warehouse automation?",
    "How much does warehouse automation software cost?"
  ],
  "averageCompetitorWordCount": 2150,
  "topCompetitors": [
    {
      "rank": 1,
      "title": "10 Best Warehouse Automation Software Platforms (2026)",
      "url": "[https://example-logistics-blog.com/warehouse-automation-software](https://example-logistics-blog.com/warehouse-automation-software)",
      "wordCount": 2400,
      "h2Count": 11,
      "schemaTypes": ["Article", "FAQPage"],
      "hasFaqSection": true
    }
  ],
  "searchIntent": "Commercial Investigation",
  "keywordDifficultyEstimate": "Medium",
  "recommendedWordCount": 2800,
  "competitorBlindSpots": [
    "Lack of concrete WMS/ERP integration timelines and hidden implementation costs",
    "No side-by-side comparison table segmented by warehouse square footage",
    "Missing ROI payback period calculator or benchmark metrics"
  ],
  "recommendedTitle": "7 Best Warehouse Automation Software (2026 Pricing, ROI & ERP Fit)",
  "outrankH2Outline": [
    "Quick Comparison: Best Warehouse Automation Software by Facility Size",
    "Key Evaluation Criteria: WMS Integration, Latency & Total Cost",
    "Top 7 Warehouse Automation Platforms Reviewed",
    "Real-World Implementation Timeline & Hidden Setup Costs",
    "ROI Payback Calculator: How Fast Does Automation Break Even?",
    "Frequently Asked Questions"
  ],
  "differentiationHook": "Current top results read like generic vendor roundups without pricing tiers or ERP integration timelines. Lead with a facility-size comparison matrix and concrete ROI payback benchmarks to capture high-intent buyers.",
  "pricingMode": "BYOK"
}
```

***

### Ideal Use Cases & Integrations

- **Automated Content Brief Pipelines (n8n / Make / Zapier)**: Feed a Google Sheet of target keywords into this Actor and send the generated `outrankH2Outline` and `competitorBlindSpots` straight to your writers or LLM drafting agents.
- **SEO Agency Client Audits**: Quickly benchmark why a client's page is losing to the top 5 results in terms of word count, heading coverage, and missing schema markup.
- **AI Agent Tool Use (MCP)**: Connect via Apify MCP Server so AI assistants can perform live SERP gap research before drafting SEO articles.

# Actor input Schema

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

List of Google search keywords to analyze (e.g., 'best crm for small business').

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

Two-letter country code for Google Search localization (e.g., us, uk, ca, au, jp).

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

Language code for Google Search results (e.g., en, ja, es, de).

## `topCompetitorsCount` (type: `integer`):

Number of top organic Google results to crawl and analyze per keyword.

## `userSerperApiKey` (type: `string`):

Bring Your Own Serper.dev API key for live Google SERP extraction. Leave blank only for sample demo output.

## `userGeminiApiKey` (type: `string`):

Bring Your Own Google Gemini API key for AI content-gap & outrank outline generation.

## `geminiModel` (type: `string`):

Leave blank to automatically use the latest available Gemini Flash model.

## Actor input object example

```json
{
  "keywords": [
    "best warehouse automation software"
  ],
  "countryCode": "us",
  "languageCode": "en",
  "topCompetitorsCount": 5,
  "geminiModel": ""
}
```

# 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": [
        "best warehouse automation software"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("cautious_canteen_a8q/my-actor").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": ["best warehouse automation software"] }

# Run the Actor and wait for it to finish
run = client.actor("cautious_canteen_a8q/my-actor").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": [
    "best warehouse automation software"
  ]
}' |
apify call cautious_canteen_a8q/my-actor --silent --output-dataset

```

## MCP server setup

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

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/5A385sfmBRkAqsido/builds/5Mvb5bcwNqm4MoWYb/openapi.json
