# Sitemap Health Check – Find Bad Sitemap Entries (`plainwren/sitemap-health-check`) Actor

For your own or authorised sites. Give it a sitemap or sitemap-index URL and it reports which entries redirect, return errors, are noindexed, have a canonical mismatch, or break sitemap format rules. $0.0008 per URL checked; timeouts and guard blocks are free.

- **URL**: https://apify.com/plainwren/sitemap-health-check.md
- **Developed by:** [Plainwren Studio](https://apify.com/plainwren) (community)
- **Categories:** SEO tools, Developer tools, Automation
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 85.7% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $0.80 / 1,000 entry checkeds

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

### What is Sitemap Health Check?

**Sitemap Health Check** checks a sitemap or sitemap-index URL (or a site root, which is read for `Sitemap:` lines in robots.txt) and reports which listed URLs redirect, return errors, are noindexed, have a canonical mismatch, are blocked by robots.txt, or carry a bad `lastmod`, for your own or authorised sites. It also flags sitemap format problems (invalid XML, over 50,000 URLs, over 50 MB, index loops, off-host entries).

- It only fetches the sitemap URLs you supply and the URLs inside those documents, up to a cap, through the URL guard.
- It does not crawl the rest of the site, does not log in, and does not keep page content.

Try it: leave the input empty and click **Start**. The Actor runs a free demo of <https://tools.plainwrenstudio.com/sitemap.xml>.

Support: <support@plainwrenstudio.com>.

### Who is it for?

- 🧑‍💻 **Site owners and developers** checking that their sitemap lists live, canonical pages.
- 📈 **SEO teams and agencies** reviewing their own or their clients' sitemaps (with permission), with a CSV or HTML report.
- 🤖 **Automations and agents** through the Apify API, schedules and integrations.

### Use cases

- Give it a sitemap or sitemap-index URL and get which listed entries redirect, return errors, are noindexed, have a canonical mismatch, are blocked by robots.txt, or carry a bad `lastmod`.
- Check sitemap format only (`checkEntries` off): invalid XML, over 50,000 URLs, over 50 MB, index loops and off-host entries, at $0.005 per sitemap assessed.
- Run a no-config check of <https://tools.plainwrenstudio.com/sitemap.xml> to see the output shape before you list your own sitemaps. The demo, timeouts and guard blocks are free.

### How to check a sitemap

1. Open the **Input** tab and add sitemap, sitemap-index, or site-root URLs, or leave the list empty to run the free demo.
2. Optional: turn off **Check entries** to validate format only, or change the URL cap, hop cap, polite rate or timeout.
3. Click **Start**.
4. Read the dataset, or download `REPORT.csv` / `REPORT.html` from the key-value store.

#### Input example

```json
{
  "sitemapUrls": [
    { "url": "https://tools.plainwrenstudio.com/sitemap.xml" }
  ],
  "checkEntries": true,
  "maxUrls": 5000,
  "requestsPerSecond": 2
}
```

| Field | Type | What it does |
|---|---|---|
| `sitemapUrls` | array | Sitemap, sitemap-index, or site-root URLs (strings or `{ url }` objects). Leave empty, or list exactly `https://tools.plainwrenstudio.com/sitemap.xml`, for a free demo of that sitemap. |
| `checkEntries` | boolean (default `true`) | When `false`, only sitemap format is checked (`sitemap-validated`). |
| `maxUrls` | integer (default 5,000, max 50,000) | Cap on listed entries checked. Extra URLs are skipped, not charged. |
| `maxHops` | integer (default 5) | Redirect hops followed per URL. |
| `requestsPerSecond` | number (default 2) | Per-host rate. |
| `maxConcurrency` | integer (default 4) | How many different hosts are checked at once. |
| `timeoutSecs` | integer (default 15) | Per request. A timeout is free. |

### How much does it cost?

Sitemap Health Check uses **pay-per-event** pricing:

- **$0.0008 per URL checked** (`entry-checked`) when entry checks are on and the check completed with a usable HTTP answer (OK and the mismatch or broken results).
- **$0.005 per sitemap assessed** (`sitemap-validated`) when `checkEntries` is off and the sitemap's format was assessed.
- A **run start** fee of **$0.001 per GB** of run memory: $0.001 per run at the default 1 GB.
- **Free:** the demo run, timeouts, DNS or TLS failures, guard blocks, bad URLs, duplicates, sitemap summaries during an entry run, URLs over the cap, and `ROBOTS_BLOCKED` entries (robots.txt disallows our UA or `*`; they are skipped, not fetched, and not charged).

You can set a spending limit on any run. When it is reached, the run stops cleanly and tells you how many URLs were skipped (not charged).

### Limits

- **For your own or authorised sites.**
- **No crawling.** It fetches only the sitemap URLs you list and the entries inside those documents, after running the address guard.
- **Up to 50 sitemap URLs per run.** Extra sitemap URLs are skipped, not charged.
- **No page body is kept.** Only status, redirect targets, robots/canonical/noindex signals and lastmod are recorded.
- **No logins, cookies or custom headers.**
- **No private or internal addresses**, including through redirects.
- **Polite by design:** one request at a time per host, two per second by default. Up to four hosts at once by default. If robots.txt sets a Crawl-delay, that gap is honoured per host, capped at 10 seconds, and the run notes when this limits throughput.
- **Memory:** 1024 MB by default (this is a plain HTTP Actor; it does not launch Chrome).

### FAQ

#### Do I need to tick anything for the demo?

No. Leave the sitemap list empty, or list exactly `https://tools.plainwrenstudio.com/sitemap.xml`, and the run is free.

#### What user agent does it use?

`PlainwrenSitemapHealth/1.0 (+https://tools.plainwrenstudio.com/bots/sitemap-health-check/)`.

#### Does it obey robots.txt?

Yes, for our own fetches of listed entries. It reads `Sitemap:` lines from robots.txt when you give it a site root. It also loads `/robots.txt` for each entry's host and applies the group for our user agent (`PlainwrenSitemapHealth`) or, if none is listed, `*`. Entries that are disallowed are **not fetched**. They are reported as `ROBOTS_BLOCKED`, marked `skipped`, and are not charged (no request was made). A `Crawl-delay` for that group is honoured as a per-host gap, capped at 10 seconds; the run log and summary note when this is slower than the default rate. The sitemap documents you listed (and child sitemaps in an index) are still fetched, so the listed entries can be reported.

#### How does it detect noindex and canonical?

A short GET of the first 64 KB of the page (then discarded), plus `X-Robots-Tag` and `Link` headers. Most CMS sites put `<meta name="robots">` and `<link rel="canonical">` in HTML `<head>` and do not repeat them as headers, so a headers-only check would miss the usual cases. 64 KB is enough to see a normal `<head>` without downloading the rest of the page, and a single capped GET avoids a second HEAD request.

#### Am I charged when a check fails?

Timeouts, DNS or TLS failures, guard blocks, bad URLs, duplicates, and `ROBOTS_BLOCKED` (skipped) entries are free. An HTTP 4xx/5xx response is reported as `BROKEN` and is charged, because the check completed with an HTTP answer.

# Actor input Schema

## `sitemapUrls` (type: `array`):

Sitemap, sitemap-index, or site-root URLs to check (for your own or authorised sites). A site root (path /) is read for Sitemap: lines in robots.txt. Only these documents and the URLs they list are fetched, through the URL guard, up to the cap. Empty input uses the built-in tools.plainwrenstudio.com sitemap as a free demo.

## `checkEntries` (type: `boolean`):

When on (default), each sitemap entry is fetched with one capped GET. When off, only sitemap format is checked and billed as sitemap-validated.

## `maxUrls` (type: `integer`):

Hard cap on sitemap entries checked in one run (1-50,000). Extra URLs are skipped and not charged. Default 5,000.

## `maxHops` (type: `integer`):

Follow at most this many redirects per URL (1-10). Default 5.

## `requestsPerSecond` (type: `number`):

Polite per-host rate (0.2-4). Default 2.

## `maxConcurrency` (type: `integer`):

How many different hosts may be in flight at once (1-10). Default 4.

## `timeoutSecs` (type: `integer`):

Give up on a request after this many seconds (5-60). Default 15.

## Actor input object example

```json
{
  "sitemapUrls": [
    {
      "url": "https://tools.plainwrenstudio.com/sitemap.xml"
    }
  ],
  "checkEntries": true,
  "maxUrls": 5000,
  "maxHops": 5,
  "requestsPerSecond": 2,
  "maxConcurrency": 4,
  "timeoutSecs": 15
}
```

# Actor output Schema

## `dataset` (type: `string`):

Dataset of sitemap summaries and checked (or failed) entries.

## `OUTPUT` (type: `string`):

Compact run totals for the Console.

## `SUMMARY` (type: `string`):

Full run summary, including counts per issue.

## `REPORT_html` (type: `string`):

Human-readable HTML report.

## `REPORT_csv` (type: `string`):

CSV of every result row.

# 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 = {
    "sitemapUrls": [
        {
            "url": "https://tools.plainwrenstudio.com/sitemap.xml"
        }
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("plainwren/sitemap-health-check").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 = { "sitemapUrls": [{ "url": "https://tools.plainwrenstudio.com/sitemap.xml" }] }

# Run the Actor and wait for it to finish
run = client.actor("plainwren/sitemap-health-check").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 '{
  "sitemapUrls": [
    {
      "url": "https://tools.plainwrenstudio.com/sitemap.xml"
    }
  ]
}' |
apify call plainwren/sitemap-health-check --silent --output-dataset

```

## MCP server setup

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

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/UuEnIHhDUij5QWM81/builds/jxaMvXNmN1YbJMSIl/openapi.json
