# Sitemap URL Extractor & Checker - All URLs, lastmod, Status (`paperlinenstudio/sitemap-url-extractor`) Actor

Get all URLs of any website from its sitemaps: auto-discovery via robots.txt, nested sitemap indexes, .gz, RSS/Atom/TXT, image/video/news/hreflang. Date & pattern filters that skip old sub-sitemaps, plus an optional HTTP status check for broken links, redirects and bot-blocked pages.

- **URL**: https://apify.com/paperlinenstudio/sitemap-url-extractor.md
- **Developed by:** [Paper & Linen Studio](https://apify.com/paperlinenstudio) (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

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/running/actors-in-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

## Sitemap URL Extractor & Checker – Get All URLs of Any Website

Get **every URL a website lists in its sitemaps** in seconds. Just enter a domain: the Actor finds the sitemaps itself (from `robots.txt` and the usual locations), follows sitemap indexes recursively, reads gzip-compressed, XML, RSS/Atom and plain-text sitemaps, and returns one clean row per URL. Optionally it **checks the HTTP status of every URL**, so you can find broken links, redirects and blocked pages in your sitemap. No browser and no proxy are needed, so it is fast and cheap: **200,000 URLs from apify.com in about 60 seconds** in our test.

### Why this Actor

- 🔍 **Auto-discovery.** Uses `Sitemap:` lines in robots.txt, then `/sitemap.xml`, `/sitemap_index.xml`, `/wp-sitemap.xml`, `/sitemap.xml.gz`, `/sitemap.txt` and more.
- 🌲 **Sitemap indexes of any depth,** e.g. heise.de with 200+ monthly sitemaps.
- 📦 **All formats.** XML urlset, sitemap index, `.gz`, RSS 2.0, Atom, TXT, plus image, video, news and hreflang extensions.
- 🗓️ **Smart date filter.** With `lastmodWithinDays`, child sitemaps whose own `lastmod` is older are skipped entirely. On heise.de, 204 of 206 sitemap files were skipped, so a run that would read 12,600 URLs finished in 3 seconds.
- ✅ **Status check included.** A HEAD request with a GET fallback (many servers break HEAD) adds `statusCode`, `finalUrl`, `redirected`, `contentType`, `isOk` and `possiblyBlocked` (bot-protection challenge detected).
- 🎯 **Include / exclude patterns.** Plain text, wildcards, or regex with the `re:` prefix.
- 🧾 **Per-website summary** (`SUMMARY` record): sitemaps found, processed and skipped, errors, URLs found, filtered and saved.
- 💸 **Free to use right now** – you only pay the tiny Apify platform usage (no browser, no proxy).

### Use cases

- **SEO audits:** find 404s, redirects and non-HTML URLs listed in a sitemap
- **Content inventory and migrations:** a full URL list with last-modified dates
- **Feed a crawler or an LLM/RAG pipeline:** crawl only the URLs that really exist, or only those changed in the last N days
- **Competitor monitoring:** which pages did a competitor publish or update this week?
- **Indexing tools:** submit fresh URLs to IndexNow or Google Search Console

### Input

| Field | Description |
|---|---|
| `startUrls` | Websites (`https://example.com`) or direct sitemap/feed URLs |
| `includePatterns` / `excludePatterns` | e.g. `/blog/`, `*.pdf`, `re:/20(25|26)/` |
| `lastmodWithinDays` / `lastmodAfter` | Date filter on `<lastmod>` |
| `keepUrlsWithoutLastmod` | Keep URLs without a date when filtering (default on) |
| `checkStatus` | Check the HTTP status of each URL (default off) |
| `sameDomainOnly` | Drop URLs on foreign domains (default on) |
| `tryCommonPaths` | Probe common sitemap paths if robots.txt has none (default on) |
| `maxUrls`, `maxSitemaps`, `concurrency` | Limits |

```json
{
  "startUrls": [{"url": "https://wordpress.org/news/"}],
  "includePatterns": ["/news/20"],
  "lastmodWithinDays": 30,
  "checkStatus": true,
  "maxUrls": 5000
}
```

### Output (real example)

```json
{
  "url": "https://wordpress.org/news/2014/04/smith/",
  "lastmod": "2014-04-15T21:49:40Z",
  "lastmodIso": "2014-04-15T21:49:40+00:00",
  "changefreq": null,
  "priority": null,
  "imageCount": 0,
  "videoCount": 1,
  "alternates": [],
  "newsTitle": null,
  "sitemapUrl": "https://wordpress.org/news/video-sitemap-1.xml",
  "sitemapType": "urlset",
  "website": "https://wordpress.org/news/",
  "path": "/news/2014/04/smith/",
  "statusCode": 200,
  "finalUrl": "https://wordpress.org/news/2014/04/smith/",
  "redirected": false,
  "contentType": "text/html",
  "isOk": true,
  "checkError": null,
  "possiblyBlocked": false
}
```

Export as JSON, CSV, Excel, XML, or via API, webhooks, Make, n8n or Zapier.

### Pricing

**The Actor is currently free** – you only pay Apify platform usage, which is very low because no browser or proxy is used (a 20-URL test run with status check cost about $0.0001). A fair pay-per-result price may be introduced later; Apify announces such changes at least 14 days in advance. Set *Max cost per run* to cap your spend.

### Notes

- Only URLs listed in sitemaps are returned. This Actor does not crawl links on pages.
- Some websites protect pages with bot challenges. These are flagged with `possiblyBlocked: true`. Lower `concurrency` for such sites.
- Respect each website's terms of service. The Actor reads only sitemap files that the website publishes for machines, and it sends at most one lightweight request per URL when checking status.

***

### 🇩🇪 Deutsch: Sitemap-URL-Extraktor & Statusprüfung

Liest **alle URLs aus den Sitemaps einer Website** aus. Die Sitemaps werden automatisch über die robots.txt und typische Pfade gefunden. Sitemap-Indizes, `.gz`, RSS/Atom und TXT werden unterstützt. Optional wird für jede URL der **HTTP-Status geprüft** (404, Weiterleitungen, Bot-Schutz).

**Ideal für:** SEO-Audits, Relaunch und Migration, Content-Inventur, Wettbewerbsbeobachtung ("Was wurde diese Woche neu veröffentlicht?") und als Vorstufe für Crawler oder KI/RAG-Pipelines.

**Besonderheiten:** Der Datumsfilter überspringt komplette Teil-Sitemaps, deren lastmod älter ist (das ist sehr schnell). Dazu kommen Include/Exclude-Muster (auch Regex), eine Zusammenfassung pro Website und die Nutzung ist derzeit kostenlos (nur geringe Apify-Plattformkosten).

# Actor input Schema

## `startUrls` (type: `array`):

Homepages (sitemaps are discovered via robots.txt and common locations) or direct sitemap URLs (.xml, .xml.gz, .txt, RSS/Atom feeds).

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

Keep only URLs matching at least one pattern. Plain text = 'contains', wildcards \* and ? allowed, or prefix with re: for a regular expression (e.g. re:/blog/\d{4}/).

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

Drop URLs matching any pattern (same syntax as include).

## `lastmodWithinDays` (type: `integer`):

Uses the <lastmod> date from the sitemap. Leave empty to keep all.

## `lastmodAfter` (type: `string`):

ISO date, e.g. 2026-01-31. Leave empty to keep all.

## `keepUrlsWithoutLastmod` (type: `boolean`):

If a date filter is set, URLs that have no <lastmod> are kept when this is on.

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

Sends a lightweight HEAD request (GET fallback) to each URL and adds statusCode, finalUrl, redirected, contentType and isOk. Finds broken links and redirects in your sitemap.

## `sameDomainOnly` (type: `boolean`):

Drop URLs pointing to other domains (subdomains are kept).

## `tryCommonPaths` (type: `boolean`):

If robots.txt lists no sitemap, try /sitemap.xml, /sitemap_index.xml, /wp-sitemap.xml and others.

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

Maximum number of URLs saved in this run.

## `maxSitemaps` (type: `integer`):

Safety limit for huge sitemap indexes.

## `concurrency` (type: `integer`):

Parallel requests when checking status codes (1–50).

## Actor input object example

```json
{
  "startUrls": [
    {
      "url": "https://apify.com"
    }
  ],
  "includePatterns": [],
  "excludePatterns": [],
  "keepUrlsWithoutLastmod": true,
  "checkStatus": false,
  "sameDomainOnly": true,
  "tryCommonPaths": true,
  "maxUrls": 100000,
  "maxSitemaps": 1000,
  "concurrency": 10
}
```

# Actor output Schema

## `urls` (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 = {
    "startUrls": [
        {
            "url": "https://apify.com"
        }
    ]
};

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

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

```

## MCP server setup

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

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/HnsrgBdNEHVHRO1ho/builds/O9q2Xox803TOz1c2l/openapi.json
