# Find 404s and redirects in a sitemap

**Use case:** 

Reads a sitemap and checks the HTTP status of every URL in it: 404 and other errors, redirects with their targets, response times and URLs blocked by robots.txt.

## Input

```json
{
  "startUrls": [
    {
      "url": "https://blog.python.org/sitemap.xml"
    }
  ],
  "maxUrls": 200,
  "keepUrlsWithoutLastmod": false,
  "onlyNewUrls": false,
  "checkStatus": true,
  "maxConcurrency": 5,
  "includeImagesVideosNews": true,
  "respectRobotsTxt": true,
  "maxSitemapsPerSite": 1000
}
```

## Output

```json
{
  "url": {
    "label": "URL",
    "format": "link"
  },
  "statusCode": {
    "label": "Status",
    "format": "number"
  },
  "finalStatusCode": {
    "label": "Final status",
    "format": "number"
  },
  "finalUrl": {
    "label": "Redirects to",
    "format": "link"
  },
  "redirects": {
    "label": "Redirects",
    "format": "number"
  },
  "statusError": {
    "label": "Error",
    "format": "text"
  },
  "responseTimeMs": {
    "label": "Response time (ms)",
    "format": "number"
  },
  "sitemapUrl": {
    "label": "Sitemap",
    "format": "link"
  }
}
```

## How it works

### 1. Sign up on Apify or log in

The Sitemap Extractor: All URLs from sitemap.xml, robots.txt & .gz Actor is ready to run with the inputs already set for "Find 404s and redirects in a sitemap". [Sign up or log in](https://console.apify.com/create-task-from-example/EotPgThokP7r1dfsP) and you'll land in Apify Console with a copy of this exact task.

### 2. Start the "Find 404s and redirects in a sitemap" task

The Sitemap Extractor: All URLs from sitemap.xml, robots.txt & .gz Actor will start running based on the input automatically. You can also change all the input fields, like websites or sitemap urls, max urls, and more, to match your specific use case.

### 3. Receive the "Find 404s and redirects in a sitemap" output

Monitor the progress in real time. You will be notified as soon as your dataset is complete and ready for review. Each result includes data such as URL, status, final status, and more.

### 4. Integrate into your workflow

The final output is delivered in JSON, CSV, or Excel format, ready to be plugged into your workflow. You can also [run the "Find 404s and redirects in a sitemap" task via API](https://apify.com/makerio/sitemap-extractor.md).

## FAQ

### What does the sitemap status check task return?

One row per URL from the sitemaps: lastmod, changefreq, priority, images, videos, news and hreflang, plus the HTTP status, redirect target and response time. The summary lists every sitemap file and any errors.

### How much does one run of this task cost?

$0.30 per 1,000 URLs saved; reading the sitemaps is free. As set up, at most 200 URLs, so a run costs up to $0.06, usually less.

### Can I use it for my own site?

Yes. Duplicate the "Find 404s and redirects in a sitemap" task and put in your website or sitemap URL. The sitemaps are found through robots.txt and the usual locations.

### What if the site has no sitemap?

The run still succeeds, and the summary lists every location that was tried. This Actor reads sitemaps only and does not crawl pages.

## About this Actor

This example demonstrates how to use [Sitemap Extractor: All URLs from sitemap.xml, robots.txt & .gz](https://apify.com/makerio/sitemap-extractor.md) with a specific input configuration. Visit the [Actor detail page](https://apify.com/makerio/sitemap-extractor.md) to learn more, explore other use cases, and run it yourself.


## How to integrate an Actor?

This Task's input is already configured above. Use it as-is rather than inventing a new one.

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 full API examples (JavaScript, Python, CLI, MCP, OpenAPI), see this Task's Actor page: https://apify.com/makerio/sitemap-extractor.md

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`).
