# Robots.txt & Sitemap Checker - Bulk Validation (`extas_corp/robots-sitemap-checker`) Actor

Validate the robots.txt and sitemaps of many sites in one run: syntax problems, a blocked site, missing or broken Sitemap lines, sitemap index children, 50,000-URL limit, bad lastmod dates, duplicate or off-host URLs, dead sample URLs. No login, no browser, no proxy.

- **URL**: https://apify.com/extas_corp/robots-sitemap-checker.md
- **Developed by:** [Extas Corp](https://apify.com/extas_corp) (community)
- **Categories:** Developer tools, SEO tools
- **Features:** Limited permissions
- **Stats:** 1 total users, 0 monthly users, 0.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

Pay per usage

This Actor is paid per platform usage. The Actor is free to use, and you only pay for the Apify platform usage, which gets cheaper the higher subscription plan you have.

Learn more: https://docs.apify.com/actors/store.md#pay-per-usage

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

## Robots.txt & Sitemap Checker: Bulk Validation of robots.txt and XML Sitemaps

Paste a list of sites and get, for each one, a **list of problems** in its `robots.txt` and in the sitemaps it declares. It reads `/robots.txt`, follows the `Sitemap:` lines (and sitemap index files, up to 10 files per site), and checks what a crawler would trip over. It reads only public files that the server gives to any crawler.

- **robots.txt**: HTTP status (a 5xx can make Google stop crawling; a 404 means "everything allowed"), `Disallow: /` for `User-agent: *` (the whole site blocked), rules placed before any `User-agent`, unknown directives, paths that do not start with `/`, relative `Sitemap:` URLs. The list of user-agents and the declared sitemaps are returned too.
- **Sitemaps**: declared in robots.txt, or `/sitemap.xml` when none is declared. Handles `urlset` and `sitemapindex`, gzip files, and checks: invalid XML, wrong root element, more than 50,000 URLs in one file, `<lastmod>` values that are not W3C dates, duplicate `<loc>`, URLs on another host than the site (search engines ignore them), entries with no `<loc>`.
- **Dead links**: requests the first 0 to 3 URLs of each sitemap file (your choice) and reports any status 400 or above.
- Errors are reported per site, they never stop the run.
- **Safe by design**: hosts that resolve to private, local or link-local addresses are refused (also after a redirect). XML with a DOCTYPE/ENTITY declaration is refused (entity-expansion attacks). Files are read with a size cap (robots.txt 500 KB, sitemaps 5 MB).
- **Free during launch**: no per-site fee at the moment, you only pay Apify platform usage (covered by the Free plan's monthly credit for normal use).

### Input example

```json
{
  "urls": ["github.com", "example.com", "https://www.python.org"],
  "sampleUrls": 3
}
```

A bare domain is checked over HTTPS. Duplicates are checked once.

### Example output

`github.com` (real run):

```json
{
  "url": "https://github.com",
  "robotsStatus": 200,
  "robots": {"agents": ["*", "bingbot", "gptbot", "claudebot", "..."], "sitemaps": ["https://github.com/sitemap_marketing.xml"], "blocksAll": false},
  "sitemaps": [
    {"url": "https://github.com/sitemap_marketing.xml", "status": 200, "kind": "urlset", "entries": 376, "problems": ["1 duplicate <loc> values"]}
  ],
  "problems": ["https://github.com/sitemap_marketing.xml: 1 duplicate <loc> values"],
  "error": null
}
```

(agents shortened here.)

`example.com` (real run) returns `robotsStatus: 404` and the problems `robots.txt returns 404: crawlers treat the site as fully crawlable`, `no Sitemap line in robots.txt (tried /sitemap.xml)` and `https://example.com/sitemap.xml: returns 404`.

### Pricing

**Free during launch**: no per-site fee, only Apify platform usage. A price per checked site may be introduced later, with advance notice.

### Limits

- It **validates the files, it does not apply your rules**: it does not tell you whether a given URL is allowed or blocked for a given crawler. Wildcard and precedence rules are not evaluated.
- Only the site root `/robots.txt` is read. Subdomains are separate sites: pass them as separate inputs.
- Sitemaps are read up to **5 MB** (after decompression). A larger file is reported as "not validated", not as valid. Sitemap index files are followed for up to 10 files per site in total, so a huge index is only partly checked.
- The dead-link check requests at most 3 URLs per sitemap file: it is a smoke test, not a full link audit. Image, video and news sitemap extensions are not validated.
- Sites that block automated clients (Cloudflare challenge, 403) are reported with their HTTP status.
- It sends normal GET requests with a clear User-Agent. Only check sites you are allowed to look at.

# Actor input Schema

## `urls` (type: `array`):

One per line. A bare domain (example.com) is checked over HTTPS; /robots.txt is read at the site root. Duplicates are checked once.

## `sampleUrls` (type: `integer`):

How many of the first URLs of each sitemap file to request, to catch dead links (0 to 3).

## Actor input object example

```json
{
  "urls": [
    "github.com",
    "example.com",
    "https://www.mozilla.org"
  ],
  "sampleUrls": 3
}
```

# 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 = {
    "urls": [
        "github.com",
        "example.com",
        "https://www.mozilla.org"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("extas_corp/robots-sitemap-checker").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 = { "urls": [
        "github.com",
        "example.com",
        "https://www.mozilla.org",
    ] }

# Run the Actor and wait for it to finish
run = client.actor("extas_corp/robots-sitemap-checker").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 '{
  "urls": [
    "github.com",
    "example.com",
    "https://www.mozilla.org"
  ]
}' |
apify call extas_corp/robots-sitemap-checker --silent --output-dataset

```

## MCP server setup

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

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/YegLA0K6mzuSRTP3N/builds/E70boj90w314G6xcl/openapi.json
