# Programmatic SEO Opportunity Mapper (`monty15/programmatic-seo-opportunity-mapper`) Actor

Turn competitor sitemaps into a scored, prioritized programmatic-SEO opportunity matrix — deterministic title/meta/slug suggestions, schema type, and optional AI-citability scoring. No API key required.

- **URL**: https://apify.com/monty15/programmatic-seo-opportunity-mapper.md
- **Developed by:** [Monty](https://apify.com/monty15) (community)
- **Categories:** SEO tools, Automation, Developer tools
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $0.01 / 1,000 results

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.

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

## What's an Apify Actor?

Actors are a software tools running on the Apify platform, for all kinds of web data extraction and automation use cases.
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.
Actors are written with capital "A".

## 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.
The best way to integrate Actors is as follows.

In JavaScript/TypeScript projects, use official [JavaScript/TypeScript client](https://docs.apify.com/api/client/js.md):

```bash
npm install apify-client
```

In Python projects, use official [Python client library](https://docs.apify.com/api/client/python.md):

```bash
pip install apify-client
```

In shell scripts, use [Apify CLI](https://docs.apify.com/cli/docs.md):

````bash
# MacOS / Linux
curl -fsSL https://apify.com/install-cli.sh | bash
# Windows
irm https://apify.com/install-cli.ps1 | iex
```bash

In AI frameworks, you might use the [Apify MCP server](https://docs.apify.com/platform/integrations/mcp.md).

If your project is in a different language, use the [REST API](https://docs.apify.com/api/v2.md).

For usage examples, see the [API](#api) section below.

For more details, see Apify documentation as [Markdown index](https://docs.apify.com/llms.txt) and [Markdown full-text](https://docs.apify.com/llms-full.txt).


# README

## Programmatic SEO Opportunity Mapper

Turn competitor sitemaps into a scored, prioritized programmatic-SEO opportunity
matrix — with deterministic title, meta description, slug, schema type, and optional
AI-citability scoring. No API key required.

### What it does

1. Crawls your target domain's sitemap to build your current coverage set.
2. Crawls each competitor's sitemap, filters obvious ecommerce product/SKU URLs by
   default, and clusters their SEO/editorial page families using Jaccard similarity
   (same engine as the Competitor Sitemap Content Gap Analyzer).
3. Computes the coverage gap: competitor families you don't yet cover.
4. Scores and ranks each opportunity with a deterministic heuristic score
   (`priority_heuristic`) and action (`auto` / `review` / `skip`).
5. Generates a starter title, meta description, URL slug, and Schema.org type
   for each opportunity — deterministically, no LLM.
6. Optionally fetches the top competitor URL for each row and attaches an
   AI-citability score (0–100) and grade (A–D) using the same adapter as the
   GEO Readiness Auditor.

### Use after `apify/google-search-scraper`

Wave-2 MVP: sitemap-only. SERP enrichment (real volume / difficulty / competitor
URLs from `apify/google-search-scraper`) back-fills in Wave 3.

### Inputs

| Field | Type | Default | Notes |
|---|---|---|---|
| `targetDomain` | string | — | **Required.** Your domain. |
| `competitorDomains` | array | — | **Required.** 1–10 competitor domains. |
| `maxRows` | integer | 500 | Hard cap on output rows. |
| `maxUrlsPerDomain` | integer | 1000 | Hard cap on sitemap URLs read per domain before filtering. |
| `urlFocus` | string | `content` | `content` filters obvious product/category/SKU pages for ecommerce SEO/editorial opportunities. Use `all` only when you intentionally want product/assortment URL gaps. |
| `crawlPages` | boolean | false | Fetch pages for richer topics (slower). |
| `similarityThreshold` | number | 0.6 | Jaccard threshold to merge families. |
| `includeAIGeoReadiness` | boolean | false | Attach citability score/grade per row. |

### Output (one row per opportunity)

```json
{
  "topic": "best running shoes for men",
  "keyword": "best running shoes for men",
  "modifier": "best",
  "page_type": "comparison",
  "search_intent": "commercial",
  "competitor_urls": ["https://competitor-a.com/best-running-shoes-for-men"],
  "source_urls": ["competitor-a.com"],
  "missing_from_target": true,
  "priority_heuristic": 230.0,
  "priority_action": "auto",
  "est_effort_hours": 3,
  "pseo_template_suggestion": "comparison-guide",
  "title": "Best Running Shoes for Men - example.com",
  "meta_description": "Compare best running shoes for men with expert analysis...",
  "recommended_slug": "best-running-shoes-for-men",
  "internal_link_targets": ["...sibling families..."],
  "schema_type": "Article",
  "member_topics": ["best running shoes for men", "best running shoes for women"],
  "topic_count": 2,
  "provenance": {"source_url": "...", "extractor_method": "sitemap_xml", "status": "ok", "caveats": ["..."]},
  "status": "ok"
}
````

Rows with `status != ok` (blocked / not\_found / timeout) are reconcilable failures,
not run crashes.

### Promises

- A ranked, deduped opportunity matrix derived from your and competitor sitemaps.
- Ecommerce-safe default focus: product/category/SKU pages are filtered unless `urlFocus=all`.
- Starter title / meta description / slug / schema type for every row.
- Provenance on every row — you can trace every recommendation to a source URL.
- No-key run path: runs completely without any external API.
- Robots honored before any third-party fetch; per-domain delay ≥ 1 s.

### Non-promises

- `priority_heuristic` is a deterministic keyword heuristic — **not** a
  search-volume or difficulty ranking. No P1–P4 tiers are shown without real
  volume data.
- This actor does not scrape Google. Bring a `apify/google-search-scraper`
  dataset for SERP enrichment (Wave 3).
- Difficulty without provider data is omitted, labeled as such.

# Actor input Schema

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

The domain you want to grow. Its sitemap defines what you already cover.

## `competitorDomains` (type: `array`):

1–10 competitor domains. Their sitemaps are crawled to find opportunities you are missing.

## `maxRows` (type: `integer`):

Hard cap on output rows (bounds compute and cost).

## `maxUrlsPerDomain` (type: `integer`):

Hard cap on sitemap URLs read per domain before filtering.

## `urlFocus` (type: `string`):

Default content mode filters obvious ecommerce product/category/SKU pages so results emphasize SEO/editorial opportunities. Use all only when you intentionally want assortment/product URL gaps.

## `crawlPages` (type: `boolean`):

When on, fetch each page for titles/headings instead of inferring topics from URL slugs. Slower but more accurate.

## `similarityThreshold` (type: `number`):

Jaccard similarity (0–1) required to merge two topics into one family. Lower = bigger families.

## `includeAIGeoReadiness` (type: `boolean`):

When on, fetch the top competitor URL for each opportunity and attach a citability score (0–100) and grade (A–D) using the same adapter as the GEO Readiness Auditor. Robots-honored, capped at 50 page fetches.

## Actor input object example

```json
{
  "targetDomain": "example.com",
  "competitorDomains": [
    "competitor-a.com",
    "competitor-b.com"
  ],
  "maxRows": 500,
  "maxUrlsPerDomain": 1000,
  "urlFocus": "content",
  "crawlPages": false,
  "similarityThreshold": 0.6,
  "includeAIGeoReadiness": false
}
```

# 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 = {
    "targetDomain": "example.com",
    "competitorDomains": [
        "competitor-a.com",
        "competitor-b.com"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("monty15/programmatic-seo-opportunity-mapper").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 = {
    "targetDomain": "example.com",
    "competitorDomains": [
        "competitor-a.com",
        "competitor-b.com",
    ],
}

# Run the Actor and wait for it to finish
run = client.actor("monty15/programmatic-seo-opportunity-mapper").call(run_input=run_input)

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

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

```

## CLI example

```bash
echo '{
  "targetDomain": "example.com",
  "competitorDomains": [
    "competitor-a.com",
    "competitor-b.com"
  ]
}' |
apify call monty15/programmatic-seo-opportunity-mapper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "command": "npx",
            "args": [
                "mcp-remote",
                "https://mcp.apify.com/?tools=monty15/programmatic-seo-opportunity-mapper",
                "--header",
                "Authorization: Bearer <YOUR_API_TOKEN>"
            ]
        }
    }
}

```

## OpenAPI specification

```json
{
    "openapi": "3.0.1",
    "info": {
        "title": "Programmatic SEO Opportunity Mapper",
        "description": "Turn competitor sitemaps into a scored, prioritized programmatic-SEO opportunity matrix — deterministic title/meta/slug suggestions, schema type, and optional AI-citability scoring. No API key required.",
        "version": "1.0",
        "x-build-id": "cC51YIEZ0ne4piI0r"
    },
    "servers": [
        {
            "url": "https://api.apify.com/v2"
        }
    ],
    "paths": {
        "/acts/monty15~programmatic-seo-opportunity-mapper/run-sync-get-dataset-items": {
            "post": {
                "operationId": "run-sync-get-dataset-items-monty15-programmatic-seo-opportunity-mapper",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor, waits for its completion, and returns Actor's dataset items in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK"
                    }
                }
            }
        },
        "/acts/monty15~programmatic-seo-opportunity-mapper/runs": {
            "post": {
                "operationId": "runs-sync-monty15-programmatic-seo-opportunity-mapper",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor and returns information about the initiated run in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/runsResponseSchema"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/acts/monty15~programmatic-seo-opportunity-mapper/run-sync": {
            "post": {
                "operationId": "run-sync-monty15-programmatic-seo-opportunity-mapper",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor, waits for completion, and returns the OUTPUT from Key-value store in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK"
                    }
                }
            }
        }
    },
    "components": {
        "schemas": {
            "inputSchema": {
                "type": "object",
                "required": [
                    "targetDomain",
                    "competitorDomains"
                ],
                "properties": {
                    "targetDomain": {
                        "title": "Your domain",
                        "type": "string",
                        "description": "The domain you want to grow. Its sitemap defines what you already cover."
                    },
                    "competitorDomains": {
                        "title": "Competitor domains",
                        "type": "array",
                        "description": "1–10 competitor domains. Their sitemaps are crawled to find opportunities you are missing.",
                        "items": {
                            "type": "string"
                        }
                    },
                    "maxRows": {
                        "title": "Max opportunity rows",
                        "minimum": 1,
                        "maximum": 5000,
                        "type": "integer",
                        "description": "Hard cap on output rows (bounds compute and cost).",
                        "default": 500
                    },
                    "maxUrlsPerDomain": {
                        "title": "Max sitemap URLs per domain",
                        "minimum": 1,
                        "maximum": 5000,
                        "type": "integer",
                        "description": "Hard cap on sitemap URLs read per domain before filtering.",
                        "default": 1000
                    },
                    "urlFocus": {
                        "title": "URL focus",
                        "enum": [
                            "content",
                            "all"
                        ],
                        "type": "string",
                        "description": "Default content mode filters obvious ecommerce product/category/SKU pages so results emphasize SEO/editorial opportunities. Use all only when you intentionally want assortment/product URL gaps.",
                        "default": "content"
                    },
                    "crawlPages": {
                        "title": "Fetch each page (richer topics)",
                        "type": "boolean",
                        "description": "When on, fetch each page for titles/headings instead of inferring topics from URL slugs. Slower but more accurate.",
                        "default": false
                    },
                    "similarityThreshold": {
                        "title": "Clustering similarity threshold",
                        "minimum": 0,
                        "maximum": 1,
                        "type": "number",
                        "description": "Jaccard similarity (0–1) required to merge two topics into one family. Lower = bigger families.",
                        "default": 0.6
                    },
                    "includeAIGeoReadiness": {
                        "title": "Include AI / GEO citability score",
                        "type": "boolean",
                        "description": "When on, fetch the top competitor URL for each opportunity and attach a citability score (0–100) and grade (A–D) using the same adapter as the GEO Readiness Auditor. Robots-honored, capped at 50 page fetches.",
                        "default": false
                    }
                }
            },
            "runsResponseSchema": {
                "type": "object",
                "properties": {
                    "data": {
                        "type": "object",
                        "properties": {
                            "id": {
                                "type": "string"
                            },
                            "actId": {
                                "type": "string"
                            },
                            "userId": {
                                "type": "string"
                            },
                            "startedAt": {
                                "type": "string",
                                "format": "date-time",
                                "example": "2025-01-08T00:00:00.000Z"
                            },
                            "finishedAt": {
                                "type": "string",
                                "format": "date-time",
                                "example": "2025-01-08T00:00:00.000Z"
                            },
                            "status": {
                                "type": "string",
                                "example": "READY"
                            },
                            "meta": {
                                "type": "object",
                                "properties": {
                                    "origin": {
                                        "type": "string",
                                        "example": "API"
                                    },
                                    "userAgent": {
                                        "type": "string"
                                    }
                                }
                            },
                            "stats": {
                                "type": "object",
                                "properties": {
                                    "inputBodyLen": {
                                        "type": "integer",
                                        "example": 2000
                                    },
                                    "rebootCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "restartCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "resurrectCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "computeUnits": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            },
                            "options": {
                                "type": "object",
                                "properties": {
                                    "build": {
                                        "type": "string",
                                        "example": "latest"
                                    },
                                    "timeoutSecs": {
                                        "type": "integer",
                                        "example": 300
                                    },
                                    "memoryMbytes": {
                                        "type": "integer",
                                        "example": 1024
                                    },
                                    "diskMbytes": {
                                        "type": "integer",
                                        "example": 2048
                                    }
                                }
                            },
                            "buildId": {
                                "type": "string"
                            },
                            "defaultKeyValueStoreId": {
                                "type": "string"
                            },
                            "defaultDatasetId": {
                                "type": "string"
                            },
                            "defaultRequestQueueId": {
                                "type": "string"
                            },
                            "buildNumber": {
                                "type": "string",
                                "example": "1.0.0"
                            },
                            "containerUrl": {
                                "type": "string"
                            },
                            "usage": {
                                "type": "object",
                                "properties": {
                                    "ACTOR_COMPUTE_UNITS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_WRITES": {
                                        "type": "integer",
                                        "example": 1
                                    },
                                    "KEY_VALUE_STORE_LISTS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_INTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_EXTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_SERPS": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            },
                            "usageTotalUsd": {
                                "type": "number",
                                "example": 0.00005
                            },
                            "usageUsd": {
                                "type": "object",
                                "properties": {
                                    "ACTOR_COMPUTE_UNITS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_WRITES": {
                                        "type": "number",
                                        "example": 0.00005
                                    },
                                    "KEY_VALUE_STORE_LISTS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_INTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_EXTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_SERPS": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}
```
