# XML Sitemap Validator — Errors, Limits, Bad Dates (`kadro/sitemap-validator`) Actor

Check the XML sitemaps you give: exists or not, type, number of URLs and child sitemaps, invalid or cross-host URLs, bad lastmod dates, duplicates and protocol limits.

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

## Pricing

$2.00 / 1,000 sitemap 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

## XML Sitemap Validator

Check an XML sitemap before you send it to Google Search Console: one row per sitemap tells you if it parses and what is wrong with it.

### What you get

| Field | What it tells you |
|---|---|
| `sitemap, finalUrl` | Sitemap you gave and the final address after redirects |
| `statusCode, error` | HTTP status and any request error |
| `found` | Whether the sitemap exists |
| `type` | `urlset`, `sitemapindex` or `invalid` |
| `urls` | Number of URLs in the file |
| `childSitemaps` | Number of child sitemaps (for an index) |
| `invalidUrls` | URLs that are malformed or on another host |
| `badLastmod` | Dates that are not in W3C format |
| `issues` | List of problems, or `ok` when nothing is wrong |

### How to use it in 3 steps

1. Paste sitemap URLs (or just domains; then `/sitemap.xml` is checked), up to 200.
2. Leave `followRedirects` on to read the final file.
3. Press Start. Filter the dataset where `issues` is not `ok` and fix those sitemaps.

### Pricing

**$2 per 1,000 sitemaps checked.** Example: 50 sitemaps = $0.10. Sitemaps that could not be requested (errors, private addresses) are free; a 404 is charged because it is a valid answer. Set a maximum cost per run and the robot stops when it is reached.

### Integrations

- **Apify API and webhooks**: start a run and read the dataset from any language.
- **Make, n8n and Zapier**: use the Apify module or node, run this robot and pass the dataset on.
- **Google Sheets**: export the dataset or use the Apify integration to fill a sheet on a schedule.
- **Claude, Cursor and other agents (MCP)**: Use the Apify MCP server (`https://mcp.apify.com?actors=kadro/sitemap-validator`) from Claude or Cursor and ask: "Validate the sitemap of example.com and tell me what to fix before submitting it"

### FAQ

**What does it check?**
Existence, XML validity, type (URL list or index), URL and child-sitemap counts, invalid or cross-host URLs, bad lastmod dates, duplicates and the protocol limits (50,000 URLs, 50 MB).

**Does it check that the URLs respond?**
No. Use Bulk URL Status Checker for that; Sitemap URL Extractor gives you the URLs.

**Does it download the child sitemaps of an index?**
No. They are counted and listed, not downloaded. Give the child URLs as inputs to validate them.

**What is free?**
Sitemaps that could not be requested (errors, private or local addresses).

**Is it legal?**
It reads only the public sitemap files you list, nothing else.

### Limitations

- Reads only the sitemap files you give; child sitemaps are not followed.
- Does not check whether the listed URLs respond.
- Up to 200 sitemaps per run.
- Only public URLs: private and local addresses are blocked.

### Other Kadro tools

Part of the **Kadro SEO toolkit**: validate the file here, then extract or check its URLs with the tools below.

- [Sitemap URL Extractor](https://apify.com/kadro/sitemap-url-extractor): exports every URL from a sitemap or sitemap index.
- [Robots.txt Validator](https://apify.com/kadro/robots-txt-validator): validates robots.txt rules, sitemaps and blocked bots.
- [Bulk URL Status & Redirect Checker](https://apify.com/kadro/bulk-url-status-redirect-checker): checks status codes and full redirect chains in bulk.
- [SEO On-Page Audit Crawler](https://apify.com/kadro/seo-onpage-audit): crawls a whole site and gives every page a 0-100 SEO score.
- [Hreflang & Canonical Checker](https://apify.com/kadro/hreflang-canonical-checker): finds canonical and hreflang errors on multilingual sites.

Found it useful? Please leave a review ⭐ — it helps a lot. Bugs or feature ideas: open an issue, I answer within 24 h.

# Actor input Schema

## `sitemaps` (type: `array`):

Sitemap URLs (e.g. https://example.com/sitemap.xml) or just a domain (then /sitemap.xml is checked), one per line, up to 200. Only these files are read.

## `followRedirects` (type: `boolean`):

Read the final sitemap after redirects (on by default).

## Actor input object example

```json
{
  "sitemaps": [
    "https://schema.org/sitemap.xml"
  ],
  "followRedirects": true
}
```

# 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 = {
    "sitemaps": [
        "https://schema.org/sitemap.xml"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("kadro/sitemap-validator").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 = { "sitemaps": ["https://schema.org/sitemap.xml"] }

# Run the Actor and wait for it to finish
run = client.actor("kadro/sitemap-validator").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 '{
  "sitemaps": [
    "https://schema.org/sitemap.xml"
  ]
}' |
apify call kadro/sitemap-validator --silent --output-dataset

```

## MCP server setup

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

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/x47CFAdsgPNe7jAwL/builds/mykNdRcBH7YjkNRd4/openapi.json
