# Broken Link & Sitemap Checker: HTTP Status, 404 & Redirects (`lineagersiui/sitemap-url-health-checker`) Actor

Broken link checker for your sitemap: checks the HTTP status of every URL listed in your sitemap and flags 404s, server errors, redirects, redirect chains and noindex headers. Honours robots.txt. Free demo.

- **URL**: https://apify.com/lineagersiui/sitemap-url-health-checker.md
- **Developed by:** [Lineage RSIUI](https://apify.com/lineagersiui) (community)
- **Categories:** SEO tools, Developer tools
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

$0.50 / 1,000 url 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

## Broken Link & Sitemap Checker: HTTP Status, 404 & Redirects

**Find broken and redirected URLs in your sitemap.** Give it your site or sitemap. It reads `robots.txt` and the sitemap (including sitemap indexes and `.xml.gz`), then checks every listed URL, up to 5,000 per run. For each one it reports:

- the HTTP status;
- the redirect chain;
- a `noindex` header, if set;
- `lastmod`.

**Scope:** it checks the URLs listed in your sitemap. It does not crawl your pages to follow the links inside them.

### Try it free first

Run it with empty input. It runs a **free demo** on 20 URLs of apify.com, which isn't billed, so you can see the output format.

### Broken link checker for your sitemap: HTTP status codes, 404s and redirects it flags

| Flag | Meaning |
|---|---|
| `not_found` / `client_error` / `server_error` | The URL answered 404/410, another 4xx, or 5xx |
| `redirected` / `redirect_chain` / `too_many_redirects` | The URL redirects once, more than once, or more than 5 times |
| `https_downgrade` | An https URL redirects to http |
| `noindex_header` | The response sends `X-Robots-Tag: noindex` |
| `blocked_by_robots` | Your robots.txt disallows the URL for this checker, so it was skipped and not billed |
| `timeout`, `network_error`, `blocked_private_address` | The URL couldn't be checked (not billed) |
| `ok` | 2xx with no redirect |

### How to use it as a sitemap checker

1. Enter your **sites** (e.g. `example.com`) or **sitemap URLs**.
2. Tick **I own these sites or have permission to check them**. Runs without it are refused.
3. Optionally set **Maximum URLs** (up to 5,000) and **Only output URLs with problems**.
4. Schedule it weekly to catch new broken URLs.

Output: one dataset item per URL, with `url`, `status`, `flags`, `redirects`, `redirectStatuses`, `finalUrl`, `lastmod` and `sitemap`. A `SUMMARY` record holds the counts. Page content is never downloaded or stored.

### Polite by design

- **robots.txt:** honoured, including `Crawl-delay`.
- **Pacing:** each site gets at most one request at a time, at least 500 ms apart.
- **Request cost:** HEAD requests are used where possible.
- **Scope:** only URLs on the same site as the sitemap are checked.
- **What it never sends:** cookies or credentials. It also never tries to get around anti-bot protection.
- **Addresses:** private and internal network addresses are refused.
- **Identification:** the user agent is `SitemapURLHealthChecker/1.0`, with a link to this page.

**Site owners:**

- **To opt out:** add `User-agent: SitemapURLHealthChecker` and `Disallow: /` to your robots.txt. The checker honours it on the next request.
- **To report misuse:** open an issue on this Actor's **Issues** tab. Reports are reviewed within one business day, and reported sites can be added to a permanent block list.

### Pricing

- **Pay per event:** each URL that returns an HTTP status is one `url-checked` event.
- **Not billed:** skipped, blocked or failed URLs, and the demo.
- The price is shown on the Pricing tab. You can cap the maximum charge per run in Apify's run options.

### Terms of use and limits

- Only check sites you own or have permission to check. This isn't a load-testing tool.
- Limits per run:
  - 5,000 URLs;
  - 50 sitemap files, nested to a depth of 3;
  - 50 MB per sitemap;
  - 15 s timeout per request;
  - a time limit you set.
- Results reflect what the server returned to this checker at run time. Some sites answer automated requests differently.

### About

- **Independent:** made by an independent developer. Unofficial; not affiliated with or endorsed by Apify.
- **Built with AI:** built and maintained with the help of AI tools, under the developer's direction.

# Actor input Schema

## `siteUrls` (type: `array`):

Site addresses (e.g. example.com). Sitemaps are found from robots.txt, or /sitemap.xml. Up to 10.

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

Direct sitemap or sitemap-index URLs (.xml, .xml.gz or plain-text lists). Up to 10.

## `confirmPermission` (type: `boolean`):

Required for non-demo runs. This Actor is not for load testing or checking sites you don't control.

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

Hard cap per run (5,000). Each URL that returns an HTTP status is one billed event.

## `onlyProblems` (type: `boolean`):

Leave out URLs that answered 2xx without redirects.

## `timeLimitSecs` (type: `integer`):

The run stops starting new checks after this time. Unchecked URLs are not charged.

## Actor input object example

```json
{
  "confirmPermission": false,
  "maxUrls": 500,
  "onlyProblems": false,
  "timeLimitSecs": 1500
}
```

# Actor output Schema

## `results` (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 = {};

// Run the Actor and wait for it to finish
const run = await client.actor("lineagersiui/sitemap-url-health-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 = {}

# Run the Actor and wait for it to finish
run = client.actor("lineagersiui/sitemap-url-health-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 '{}' |
apify call lineagersiui/sitemap-url-health-checker --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,lineagersiui/sitemap-url-health-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/mT9ocSsW0odTtlbEa/builds/kGIUDoLYh2E41b7v8/openapi.json
