# Sitemap URL Extractor – All URLs from XML Sitemaps (`quillbit-tools/sitemap-url-extractor`) Actor

Extract every URL from a website's XML sitemaps. Auto-discovers sitemaps via robots.txt, follows sitemap indexes and .gz files, returns lastmod, priority and changefreq. Fast, no browser, $0.50 per 1,000 URLs.

- **URL**: https://apify.com/quillbit-tools/sitemap-url-extractor.md
- **Developed by:** [Quillbit Tools](https://apify.com/quillbit-tools) (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

from $0.50 / 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.

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 from XML Sitemaps

**Sitemap URL Extractor** gives you every page URL listed in a website's XML sitemaps, with `lastmod`, `changefreq` and `priority`. Give it a domain and it finds the sitemaps for you: it reads `Sitemap:` lines in `robots.txt`, then tries `/sitemap.xml`, `/sitemap_index.xml`, `/sitemap-index.xml` and `/wp-sitemap.xml`. It follows nested **sitemap indexes** and unzips **`.xml.gz`** sitemaps automatically.

You can also pass a sitemap URL directly, filter URLs with include / exclude regex, and cap the number of URLs per site. No browser, so it is fast and very cheap.

### What can you use it for?

#### Extract all URLs from a sitemap

Get a clean list of every page of a website for an SEO audit, content inventory or migration mapping.

#### Get all pages of a website (without crawling)

A sitemap is the fastest way to list a site's pages. Feed the URLs into a scraper, link checker or LLM pipeline.

#### Monitor new pages on competitor sites

Schedule a run and compare `lastmod` dates to see which pages were added or updated.

#### Sitemap index and .gz support

Large sites split sitemaps into indexes and gzip files. This Actor follows all of them.

#### Filter to one section

Use `includePattern` like `/blog/` or `/products/` to export only the URLs you need.

### How to use it

1. Click **Try for free** (or **Start**).
2. Enter your input (see the example below) and click **Save & Start**.
3. Download results as JSON, CSV, Excel or HTML, or read them via the API.

### Input

- `startUrls` — Domains (`example.com`), homepages, or direct sitemap URLs.
- `maxUrls` — Stop after this many URLs per site (default 100; 0 = no limit).
- `maxSitemaps` — Max sitemap files fetched per site, including nested ones (default 500).
- `includePattern` — Optional regex; only output matching URLs.
- `excludePattern` — Optional regex; skip matching URLs.

Example input:

```json
{
  "startUrls": [
    "apify.com"
  ],
  "maxUrls": 100
}
```

### Output example

| url | lastmod | sitemap | site |
|---|---|---|---|
| https://apify.com/ |  | https://apify.com/sitemap/pages.xml | https://apify.com |
| https://apify.com/about |  | https://apify.com/sitemap/pages.xml | https://apify.com |

All output fields: `url`, `lastmod`, `changefreq`, `priority` (number), `sitemap` (the file it came from), `site`. If no sitemap is found you get one row with `error: "No sitemap found"` (not charged).

### How much does it cost?

This Actor uses **pay-per-event** pricing. You pay only for results, not for servers or subscriptions:

- **$0.0005 per URL extracted**, which is **$0.50 per 1,000 URLs**
- plus Apify's standard **Actor start** event of $0.00005 per run (per GB of memory; the default 512 MB memory = one event)

| You process | You pay (approx.) |
|---|---|
| 100 URLs | $0.05 |
| 1,000 URLs | $0.50 |
| 10,000 URLs | $5.00 |
| 100,000 URLs | $50.00 |

Apify's free plan includes monthly platform credit, which is enough to try this Actor at no cost.

### Run it via API, schedule or AI agents

Run from your own code with the Apify API, JavaScript or Python client, schedule it in Apify Console, connect it to Make, Zapier, n8n or Google Sheets, or let an AI agent call it through the Apify MCP server (`https://mcp.apify.com`).

```bash
curl -X POST "https://api.apify.com/v2/acts/quillbit-tools~sitemap-url-extractor/run-sync-get-dataset-items?token=YOUR_APIFY_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"startUrls": ["apify.com"], "maxUrls": 100}'
```

### FAQ

**Why did I only get 100 URLs?**
`maxUrls` defaults to 100 so a test run stays cheap (about $0.05). Set it higher, or to 0 for no limit.

**What if a site has no sitemap?**
You get one row with `error: "No sitemap found"` and are not charged for URLs. Use the Broken Link Checker to crawl such sites instead.

**Does it crawl the website?**
No. It reads only the sitemap files, which is why it is fast and cheap. Pages missing from the sitemap won't appear.

**Are duplicates removed?**
Yes, each URL is output once per site, even if it appears in several sitemaps.

**Can I pass a sitemap URL directly?**
Yes. Any URL ending in `.xml`, `.xml.gz` or containing `sitemap` in its path is read directly.

### Related tools by Quillbit Tools

- [Bulk URL Status & Redirect Chain Checker](https://apify.com/quillbit-tools/bulk-redirect-status-checker)
- [Broken Link Checker – crawl a site for 404s](https://apify.com/quillbit-tools/broken-link-crawler)
- [Domain Expiry, DNS & SSL Certificate Checker](https://apify.com/quillbit-tools/domain-expiry-dns-ssl-checker)
- [Website Tech Stack Detector](https://apify.com/quillbit-tools/tech-stack-detector)
- [Webpage to Markdown for LLMs & RAG](https://apify.com/quillbit-tools/webpage-to-markdown)
- [RSS & Atom Feed to JSON Reader](https://apify.com/quillbit-tools/rss-feed-to-json)

Questions or a feature request? Open an issue on the Actor's **Issues** tab.

# Actor input Schema

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

Domains (example.com), homepages or direct sitemap.xml URLs. Sitemaps are discovered via robots.txt and common paths.

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

Stop after this many URLs per site (0 = no limit).

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

Limit on sitemap files fetched per site, including nested indexes.

## `includePattern` (type: `string`):

Only output URLs matching this regular expression (optional).

## `excludePattern` (type: `string`):

Skip URLs matching this regular expression (optional).

## Actor input object example

```json
{
  "startUrls": [
    "apify.com"
  ],
  "maxUrls": 100,
  "maxSitemaps": 500
}
```

# Actor output Schema

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

All result items in the default dataset.

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

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

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

```

## MCP server setup

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