# Sitemap URL Extractor – All URLs of Any Website (`rowharbor1988/sitemap-url-extractor`) Actor

Get every URL of a website from its sitemaps in seconds: finds sitemaps via robots.txt, follows nested indexes, reads .gz, text and RSS sitemaps. Filter by path or last-modified date, get hreflang and image counts, optional HTTP status check.

- **URL**: https://apify.com/rowharbor1988/sitemap-url-extractor.md
- **Developed by:** [rowharbor1988](https://apify.com/rowharbor1988) (community)
- **Categories:** SEO tools, Developer tools, AI
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $0.14 / 1,000 url extracteds

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.
Since this Actor supports Apify Store discounts, the price gets lower the higher subscription plan you have.

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 URL Extractor – All URLs of Any Website

Enter a website and get **every URL listed in its sitemaps** as a clean table, usually within seconds. The Actor finds the sitemaps for you, follows nested sitemap indexes, reads compressed `.gz` files and returns one row per URL with last-modified date, priority, language versions and image count.

Need to know which pages are broken or redirected? Switch on **HTTP status check** and every URL gets its status code (200, 301, 404 …) and redirect target.

### Try it in one minute

1. Click **Try for free**. The input is already filled in (`https://apify.com`), so you can start right away.
2. Click **Start**. A few seconds later you get a table like this. It is real output from a test run on `crawlee.dev` with *Check HTTP status* switched on, shortened:

| url | priority | statusCode | sitemapUrl |
|---|---|---|---|
| https://crawlee.dev/blog | 0.5 | 200 | https://crawlee.dev/sitemap.xml |
| https://crawlee.dev/blog/archive | 0.5 | 200 | https://crawlee.dev/sitemap.xml |
| https://crawlee.dev/blog/common-problems-in-web-scraping | 0.5 | 200 | https://crawlee.dev/sitemap.xml |
| https://crawlee.dev/blog/crawlee-blog-launch | 0.5 | 200 | https://crawlee.dev/sitemap.xml |

3. Put in your own website and download the list as **CSV, Excel or JSON**, or get it via API.

**What it costs:** $0.20 per 1,000 URLs, plus $0.30 per 1,000 URLs if you switch on the status check. A website with 2,000 pages costs about $0.40. Paid Apify plans get up to 30 % off. Apify's free plan includes monthly platform credit, so you can try it on your own sites at no cost.

**Ready-made setups:** [Extract all URLs from a sitemap](https://apify.com/rowharbor1988/sitemap-url-extractor/examples/extract-all-urls-from-a-sitemap) · [Find broken URLs in a sitemap](https://apify.com/rowharbor1988/sitemap-url-extractor/examples/find-broken-urls-in-a-sitemap)

### What you can use it for

- **SEO audits** – get the full URL inventory of a site and find 404s and redirects that should not be in the sitemap.
- **Website migrations** – export all old URLs to build your redirect map.
- **One section only** – enter `https://example.com/blog/` and get only the URLs of the blog.
- **Content monitoring** – use *Changed after* to list only pages that were added or updated since a date (e.g. new products or articles of a competitor).
- **Feeding other scrapers and AI pipelines** – pass the URL list to a crawler, a screenshot tool or a RAG/LLM indexer instead of crawling the whole site.
- **International SEO** – see all hreflang language versions per URL.

### How it works

1. **Finds the sitemaps**: reads `Sitemap:` lines in `robots.txt`; if there are none, tries `/sitemap.xml`, `/sitemap_index.xml`, `/sitemap-index.xml`, `/wp-sitemap.xml` and `/sitemap.txt`. You can also give a sitemap URL directly.
2. **Follows sitemap indexes** to any depth (with a safety limit), reads `.xml`, `.xml.gz`, plain-text and RSS/Atom sitemaps.
3. **Cleans the result**: removes duplicates and URLs from other domains, applies your filters.
4. **Optionally checks** each URL's HTTP status.

### Input

| Field | Description |
|---|---|
| Websites or sitemap URLs | `https://example.com` or `https://example.com/sitemap.xml` – one or many |
| Only URLs matching | e.g. `/blog/` – regular expressions, case-insensitive |
| Skip URLs matching | e.g. `/tag/` |
| Changed after | only URLs with `lastmod` on/after this date |
| Check HTTP status | adds status code and redirect target (extra charge) |
| Only URLs under the start path | enter `https://example.com/blog/` to get only the blog URLs (on by default) |
| Same domain only | on by default |
| Max URLs per website | default 100,000 |

```json
{
  "startUrls": [{ "url": "https://example.com" }],
  "includePatterns": ["/blog/"],
  "lastmodAfter": "2026-10-01",
  "checkStatus": true
}
```

### Output

One row per URL:

```json
{
  "url": "https://example.com/blog/new-post",
  "domain": "example.com",
  "path": "/blog/new-post",
  "lastmod": "2026-11-10",
  "changefreq": "weekly",
  "priority": 0.8,
  "imageCount": 3,
  "videoCount": 0,
  "isNews": false,
  "alternates": [{ "hreflang": "de", "href": "https://example.com/de/blog/neuer-beitrag" }],
  "statusCode": 200,
  "redirectTo": null,
  "sitemapUrl": "https://example.com/post-sitemap.xml",
  "startUrl": "https://example.com/"
}
```

A per-website summary (sitemaps found, sitemaps that failed, how many URLs were skipped and why) is saved in the key-value store record **SUMMARY**.

### Pricing

Pay per event – you only pay for URLs you receive:

- **URL extracted** – $0.0002 per URL in the results ($0.20 per 1,000)
- **Status check** – $0.0003 per URL, only if *Check HTTP status* is on ($0.30 per 1,000)

Sitemaps that cannot be read and URLs removed by your filters are free. Set a maximum cost per run in the run options; the Actor stops cleanly when it is reached.

### Tips

- Use **Changed after** together with a **schedule** to get a weekly list of new or updated pages.
- Big e-commerce sites can have millions of URLs – use *Only URLs matching* and *Max URLs per website* to keep runs small.
- A website without any sitemap returns no URLs (it is listed in SUMMARY as "no sitemap found"). This Actor does not crawl links.

### Limitations

- Only reads sitemaps – it does not crawl pages to find links.
- Sitemaps behind a login or blocked for automated requests cannot be read.
- No proxy support yet.

### Support

Missing a feature or found a sitemap that is not read correctly? Open an issue on the **Issues** tab – we usually reply within a few days.

# Actor input Schema

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

A website (e.g. https://example.com) – its sitemaps are found automatically via robots.txt and common locations – or a direct sitemap URL (.xml, .xml.gz, .txt, RSS).

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

Keep only URLs that contain one of these patterns (regular expressions, case-insensitive), e.g. '/blog/' or '/products?/'. Empty = keep all.

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

Drop URLs that match one of these patterns, e.g. '/tag/' or '?page='.

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

Only URLs whose <lastmod> is on or after this date (YYYY-MM-DD). URLs without a date are skipped when this is set. Great for 'what's new since last week'.

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

Sends a lightweight request to each URL and adds its status code (200, 301, 404 …) and redirect target. Finds broken and redirected URLs in your sitemap. Charged as an extra event per URL.

## `restrictToStartPath` (type: `boolean`):

If you enter a website URL with a path (e.g. https://example.com/blog/), return only URLs under that path. Has no effect for a plain domain or a direct sitemap URL.

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

Keep only URLs on the website's own domain and its subdomains.

## `includeAlternates` (type: `boolean`):

Add the language versions (hreflang) listed in the sitemap to each URL.

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

Stop after this many URLs per website.

## `maxSitemapsPerSite` (type: `integer`):

Safety limit for very large sites with thousands of sitemap files.

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

Used for status checks and when several websites are given.

## `userAgent` (type: `string`):

Optional custom User-Agent header.

## Actor input object example

```json
{
  "startUrls": [
    {
      "url": "https://apify.com"
    }
  ],
  "includePatterns": [],
  "excludePatterns": [],
  "checkStatus": false,
  "restrictToStartPath": true,
  "sameDomainOnly": true,
  "includeAlternates": true,
  "maxUrlsPerSite": 100000,
  "maxSitemapsPerSite": 500,
  "maxConcurrency": 10
}
```

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

// Run the Actor and wait for it to finish
const run = await client.actor("rowharbor1988/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("rowharbor1988/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 rowharbor1988/sitemap-url-extractor --silent --output-dataset

```

## MCP server setup

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