# Sitemap Extractor & Broken Link Checker: All URLs of a Site (`swiftkit/sitemap-urls`) Actor

Get every URL of a website from its sitemaps (found automatically via robots.txt, indexes and .gz followed), with last-modified dates, images and hreflang. Optional status check finds broken pages, redirects and slow URLs.

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

## Pricing

from $0.20 / 1,000 url listeds

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

## Sitemap Extractor & Broken Link Checker: All URLs of a Site

Get **every URL a website lists in its sitemaps**, then optionally **check each one** for broken
pages, redirects and slow responses.

- **Finds sitemaps for you:** reads `robots.txt`, then tries the usual addresses
  (`/sitemap.xml`, `/sitemap_index.xml`, `/wp-sitemap.xml`…)
- Follows **sitemap indexes**, **.gz** files and plain-text sitemaps
- For each URL: **last modified** date, change frequency, priority, number of **images** and
  **hreflang** alternates
- **Include / exclude filters**, e.g. only `/blog/`
- **Status check (optional):** HTTP status, redirect target and response time for each URL.
  Turn on "Only show problems" to get just the broken and redirected ones.

### Who it's for

- **SEO:** audit what a site submits to search engines, find 404s and redirect chains in the sitemap,
  spot stale pages by last-modified date.
- **Site migrations:** list all old URLs before a redesign and check them afterwards.
- **Scraping and AI pipelines:** a clean list of a site's pages to feed into the next tool.
- **Competitor research:** see how many product, blog or landing pages a competitor has, and when
  they last changed.

### Input

| Option | Default | What it does |
|---|---|---|
| Websites or sitemap URLs | – | `apify.com` or `https://example.com/sitemap.xml` |
| Max URLs per site | 1,000 | Stop after this many |
| Only URLs containing | – | Text or regular expressions to keep |
| Skip URLs containing | – | Text or regular expressions to drop |
| Check each URL's status | off | HTTP status, redirects, response time |
| Only show problems | off | With status checks, output only non-200 URLs |

### Output

Listing only:

```json
{
  "input": "https://github.blog/sitemap.xml",
  "url": "https://github.blog/news-insights/the-library/benchmarking-github-enterprise/",
  "sitemap": "https://github.blog/post-sitemap.xml",
  "lastmod": "2015-07-22T07:00:00+00:00",
  "changefreq": null,
  "priority": null,
  "images": 10
}
```

With status checks, each row also has `httpStatus`, `ok`, `redirectTo` and `responseMs`.

Sources without a sitemap get one free row with `status: "no_sitemap_found"`.

### Pricing

- **Listing:** per URL returned.
- **Status check:** per URL checked (a higher price, since each URL is requested). With "Only show
  problems", you pay for every URL checked, even the ones that are fine and not shown.

See the Pricing tab.

### Limits, honestly

- It only knows the URLs the site puts in its sitemaps. Pages left out of the sitemap won't appear.
  For a full crawl you need a crawler.
- Status checks use a HEAD request (GET when a site refuses HEAD) and don't follow redirects, so you
  see the first hop. Some sites answer bots differently than browsers.
- Checks run a few at a time per site, to stay polite.

### More tools from SwiftKit

- [Lighthouse Audit](https://apify.com/swiftkit/lighthouse-audit): bulk page speed, SEO and Core Web Vitals scores
- [Website Screenshot Tool](https://apify.com/swiftkit/website-screenshots): bulk full-page and mobile screenshots, PNG/JPEG/PDF
- [Tech Stack Detector](https://apify.com/swiftkit/tech-stack): what a website is built with: CMS, analytics, ecommerce, hosting
- [Website to Markdown for AI](https://apify.com/swiftkit/web-to-markdown): clean page content as Markdown, with token counts and RAG chunks
- [SEO Audit Crawler](https://apify.com/swiftkit/seo-audit): score every page for SEO basics and find broken links

### Questions?

Open an issue on the Issues tab.

# Actor input Schema

## `websites` (type: `array`):

A domain like apify.com (sitemaps are found automatically) or a direct sitemap URL.

## `maxUrlsPerSite` (type: `integer`):

Stop after this many URLs for each site.

## `includePatterns` (type: `array`):

Keep URLs matching any of these texts or regular expressions, e.g. /blog/

## `excludePatterns` (type: `array`):

Drop URLs matching any of these, e.g. /tag/

## `checkStatus` (type: `boolean`):

Request every URL and report the HTTP status, redirects and response time. Finds broken pages. Priced per URL checked.

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

With status checks on: output only URLs that aren't 200 OK (broken, redirected, errors).

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

Parallel status checks per site. Keep it low to be polite.

## Actor input object example

```json
{
  "websites": [
    "apify.com"
  ],
  "maxUrlsPerSite": 1000,
  "checkStatus": false,
  "onlyProblems": false,
  "maxConcurrency": 5
}
```

# Actor output Schema

## `results` (type: `string`):

One row per URL.

# 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 = {
    "websites": [
        "apify.com"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("swiftkit/sitemap-urls").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 = { "websites": ["apify.com"] }

# Run the Actor and wait for it to finish
run = client.actor("swiftkit/sitemap-urls").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 '{
  "websites": [
    "apify.com"
  ]
}' |
apify call swiftkit/sitemap-urls --silent --output-dataset

```

## MCP server setup

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

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/FjGErEGZHe2WoUdty/builds/hKtlogM6z4M8pQkuB/openapi.json
