# Sitemap Extractor & SEO Audit: URLs, robots.txt, Status (`kayorama/sitemap-extractor-seo-audit`) Actor

Extract every URL from a site's XML sitemaps (index, gzip, hreflang, images) and audit them: robots.txt conflicts, stale lastmod, duplicates, status, redirects, canonical, noindex.

- **URL**: https://apify.com/kayorama/sitemap-extractor-seo-audit.md
- **Developed by:** [Kayorama](https://apify.com/kayorama) (community)
- **Categories:** SEO tools, Developer tools, Automation
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $0.30 / 1,000 url rows

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/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

## Sitemap Extractor & SEO Audit: URLs, robots.txt, Status

Give it a website and get every URL from its XML sitemaps, plus an audit of what's wrong with them. The Actor finds the sitemaps through robots.txt, follows nested sitemap index files, reads gzip and plain-text sitemaps, and returns each URL with its lastmod, changefreq, priority, hreflang alternates and images.

On top of the list it checks the things that quietly hurt indexing: URLs your own robots.txt blocks, stale or broken lastmod dates, duplicates, URLs on the wrong host, and (if you want) live status codes, redirects, canonicals and noindex tags. Every site also gets one summary row with the totals.

Schedule it with change tracking and it tells you which URLs were added to or dropped from the sitemap since the last run.

No login, no proxy, no browser. It follows each site's robots.txt for its own requests and waits between requests.

### Good for

- **Technical SEO audits:** find sitemap URLs that robots.txt blocks, that redirect, 404, carry a noindex or point their canonical somewhere else. Each of those wastes crawl budget.
- **Content inventory:** a full URL list with lastmod dates for a migration, a content audit or a competitor's site.
- **Competitor monitoring:** schedule it on a rival's sitemap and see every new page, product or blog post the day it is added.
- **Migration checks:** run it before and after a relaunch to see what disappeared.
- **Feeding other tools:** use the URL list as input for a crawler, a screenshot tool or a rank tracker.

### What you get

#### One row per URL (`type: url`)

| Field | Example |
| --- | --- |
| `url`, `sitemap`, `site` | https://www.shopify.com/plus/platform |
| `lastmod`, `lastmodIso`, `lastmodAgeDays` | 2026-10-02, 2026-10-02T00:00:00Z, 45 |
| `changefreq`, `priority` | weekly, 0.5 |
| `hreflang` | `[{"lang": "de", "href": "https://docs.python.org/de/3.13/"}]` |
| `imageCount`, `images`, `videoCount`, `newsTitle` | from the image, video and news sitemap extensions |
| `blockedByRobotsTxt`, `robotsRule` | true, `Disallow: /*/submit$` |
| `duplicateCount` | how often the URL is listed |
| `statusCode`, `finalStatusCode`, `finalUrl`, `redirectHops`, `redirectChain` | 301, 200, https://www.shopify.com/platform/enterprise, 1 |
| `canonical`, `canonicalMismatch` | the page's canonical and whether it differs from the sitemap URL |
| `noindex`, `noindexSource` | true, meta robots / X-Robots-Tag header |
| `responseMs`, `contentType`, `checkError` | live check details |
| `issues` | for example `["redirects", "canonicalMismatch"]` |
| `changeType` | `new` or `unchanged` with tracking on |

Live-check fields are filled only for URLs you choose to check.

Possible `issues`: `blockedByRobotsTxt`, `missingLastmod`, `invalidLastmod`, `futureLastmod`, `staleLastmod`, `duplicate`, `otherHost`, `httpUrl`, `invalidChangefreq`, `invalidPriority`, `redirects`, `clientError`, `serverError`, `noindex`, `canonicalMismatch`, `checkFailed`, `notCheckedRobots`, `invalidUrl`.

#### Removed URLs (`type: removed-url`)

With tracking on, URLs that were in the sitemap last run and are gone now get their own row with `changeType: removed`.

#### One summary row per site (`type: site-summary`)

robots.txt status and its Sitemap: lines, where the sitemaps were found, every sitemap file with its URL count and size, sitemap errors (HTTP errors, HTML instead of XML, over 50,000 URLs or 50 MB), and counts: URLs, duplicates, blocked by robots.txt, missing/invalid/future/stale lastmod, other-host and http URLs, hreflang and image coverage, status code buckets, redirects, 4xx, 5xx, noindex, canonical mismatches, new and removed URLs. Plus plain-English notes such as "robots.txt has no Sitemap: line".

### Input

| Field | What it does |
| --- | --- |
| `startUrls` | Websites (`example.com`) or direct sitemap links (`.xml`, `.xml.gz`, `.txt`) |
| `maxUrlsPerSite`, `maxSitemapsPerSite` | Caps, so a 2-million-URL shop doesn't surprise you |
| `urlContains`, `urlExcludes` | Keep or skip URLs by path, for example `/blog/` |
| `checkUrls`, `checkSampleSize`, `maxChecksPerSite` | No live check, an evenly spread sample, or every URL |
| `staleDays` | When a lastmod counts as stale (default 365 days) |
| `auditUserAgent` | Which crawler's robots.txt rules to test against (default Googlebot) |
| `includeUrlRows`, `onlyUrlsWithIssues` | Full list, problems only, or summary only |
| `trackChanges`, `outputMode`, `stateStoreName` | New and removed URLs between runs |
| `requestDelayMs` | Pause between requests to one host (default 1 second) |

Example, a weekly audit of your own site:

```json
{
    "startUrls": ["https://www.example.com"],
    "checkUrls": "sample",
    "checkSampleSize": 200,
    "onlyUrlsWithIssues": true
}
```

Example, a daily watch on a competitor's blog:

```json
{
    "startUrls": ["https://competitor.com/sitemap.xml"],
    "urlContains": ["/blog/"],
    "trackChanges": true,
    "outputMode": "changesOnly"
}
```

### Pricing

Pay per event, no start fee:

| Event | Price |
| --- | --- |
| URL row (one URL or removed-URL row written) | $0.0003 |
| URL checked live (status, redirects, canonical, noindex) | $0.0008 |
| Site audited (one summary row per site) | $0.003 |

A 2,000-URL sitemap with a 50-URL sample check costs about $0.65. With "Only new and removed URLs" a daily competitor watch usually costs a few cents, because you only pay for rows that changed plus the summary.

### FAQ

**Does it crawl my whole site?**
No. It reads sitemap files and, only if you ask, requests the URLs listed in them. It does not follow links on pages.

**Why is a URL marked blocked by robots.txt but still checked?**
`blockedByRobotsTxt` tests the URL against the rules for Googlebot (or the crawler you choose). The live check uses this Actor's own user agent and also respects robots.txt. If the site blocks us, the row says `notCheckedRobots` and nothing is requested.

**My sitemap has 500,000 URLs. Will this work?**
Yes. Raise `maxUrlsPerSite`. Reading sitemaps is quick. Live checks are paced at about one per second per site, so check a sample rather than everything on big sites.

**Why are new and removed URLs empty on the first run?**
The first tracked run saves the baseline. Changes show from the second run. If the URL list hits `maxUrlsPerSite`, the snapshot isn't saved, because a capped list would make URLs look removed.

**Some sitemaps return 403.**
Some sites block unknown crawlers. The summary lists those under `sitemapErrors`. We don't work around blocks.

### Support

Found a bug or want another check? Open an issue on the Actor's Issues tab and I'll take a look.

# Actor input Schema

## `startUrls` (type: `array`):

A website (example.com) to find its sitemaps through robots.txt, or a direct sitemap link (XML, .xml.gz or .txt). One per line.

## `maxUrlsPerSite` (type: `integer`):

Stop reading sitemaps after this many URLs for one site.

## `maxSitemapsPerSite` (type: `integer`):

Upper limit on sitemap files (including nested index files) read per site.

## `urlContains` (type: `array`):

Keep only URLs that contain one of these, for example /blog/ or /products/.

## `urlExcludes` (type: `array`):

Drop URLs that contain any of these.

## `checkUrls` (type: `string`):

Request URLs to get status code, redirects, canonical and noindex. Sample spreads the checks evenly across the list.

## `checkSampleSize` (type: `integer`):

How many URLs to check per site in sample mode.

## `maxChecksPerSite` (type: `integer`):

Safety cap for live checks per site, also in 'every URL' mode. At the default pace that is about 1 check per second.

## `staleDays` (type: `integer`):

Flag URLs whose lastmod is older than this.

## `auditUserAgent` (type: `string`):

Which crawler's robots.txt rules to test sitemap URLs against, for example Googlebot or Bingbot.

## `includeUrlRows` (type: `boolean`):

Turn off to get only the summary row per site.

## `onlyUrlsWithIssues` (type: `boolean`):

Output only URL rows that have at least one issue. The summary still counts everything.

## `trackChanges` (type: `boolean`):

Save the URL list of each site and compare the next run against it. Rows get changeType new or unchanged, and removed URLs get their own rows. The first run only saves the baseline.

## `outputMode` (type: `string`):

With tracking on, output every URL or only new and removed URLs. Summary rows are always written.

## `stateStoreName` (type: `string`):

Named key-value store that keeps the URL snapshots. Use a different name per schedule.

## `requestDelayMs` (type: `integer`):

Pause between requests to the same host. A Crawl-delay in robots.txt is respected when it is longer.

## Actor input object example

```json
{
  "startUrls": [
    "https://docs.python.org",
    "https://crawlee.dev"
  ],
  "maxUrlsPerSite": 5000,
  "maxSitemapsPerSite": 200,
  "urlContains": [],
  "urlExcludes": [],
  "checkUrls": "none",
  "checkSampleSize": 50,
  "maxChecksPerSite": 1000,
  "staleDays": 365,
  "auditUserAgent": "Googlebot",
  "includeUrlRows": true,
  "onlyUrlsWithIssues": false,
  "trackChanges": false,
  "outputMode": "all",
  "stateStoreName": "sitemap-audit-state",
  "requestDelayMs": 1000
}
```

# Actor output Schema

## `urls` (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 = {
    "startUrls": [
        "https://docs.python.org",
        "https://crawlee.dev"
    ],
    "urlContains": [],
    "urlExcludes": []
};

// Run the Actor and wait for it to finish
const run = await client.actor("kayorama/sitemap-extractor-seo-audit").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 = {
    "startUrls": [
        "https://docs.python.org",
        "https://crawlee.dev",
    ],
    "urlContains": [],
    "urlExcludes": [],
}

# Run the Actor and wait for it to finish
run = client.actor("kayorama/sitemap-extractor-seo-audit").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 '{
  "startUrls": [
    "https://docs.python.org",
    "https://crawlee.dev"
  ],
  "urlContains": [],
  "urlExcludes": []
}' |
apify call kayorama/sitemap-extractor-seo-audit --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,kayorama/sitemap-extractor-seo-audit"
        }
    }
}
```

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/2Hy52cgrsVgvXu1K1/builds/E1z4a208eEuBiQenS/openapi.json
