# Sitemap Extractor: Get All URLs from Any Website (`tidyfold/sitemap-url-extractor`) Actor

$0.0003 per URL. Get every URL from a site's sitemaps (auto-found via robots.txt, indexes, .gz, text, RSS) with lastmod. Optional 404/redirect check.

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

## Pricing

from $0.30 / 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 Extractor: Get All URLs from Any Website

**Sitemap Extractor** gets **every URL from a website's sitemaps**. Give it a domain; it finds the sitemaps via robots.txt, walks sitemap indexes and `.gz` files, and returns each URL with `lastmod`. Optionally it **checks the HTTP status** of each page to catch 404s and redirects. **From $0.0003 per URL**.

### How to use it

1. Enter a domain or a sitemap URL in *Websites or sitemap URLs*.
2. Optionally add *Only URLs matching* / *Skip URLs matching* patterns, a *Modified on or after* date, or turn on the status check.
3. Click **Start** and export the URL list as Excel, CSV or JSON.

### Why this one

- **Finds sitemaps for you:** reads `Sitemap:` lines in robots.txt, then tries the common paths (`/sitemap.xml`, `/sitemap_index.xml`, `/wp-sitemap.xml`, `.gz`, `.txt`)
- **Walks sitemap indexes** of any depth, de-duplicates URLs, and keeps going when one child sitemap is broken (errors are listed in the run summary)
- **Reads every format:** XML, gzipped `.xml.gz`, plain-text sitemaps, and RSS/Atom feeds
- **Filters before you pay:** include/exclude regex patterns, "modified after" date, and a per-site cap, so you're only charged for the URLs you keep
- **Optional status check** with HEAD and automatic GET fallback for servers that reject HEAD

### Output

| Field | Example |
|---|---|
| site | https://docs.apify.com |
| url | https://docs.apify.com/platform/actors |
| lastmod, changefreq, priority | 2026-10-12, weekly, 0.7 |
| images, hreflang | 3, \["en","de"] |
| sitemap | The sitemap file the URL came from |
| httpStatus, finalUrl | 200 / 301 / 404, and the URL after redirects (status check only) |

A summary per site (how the sitemap was found, sitemaps read, URL count, errors) is saved in the run's key-value store.

### Use cases

Feeding a clean URL list to a crawler or RAG pipeline, SEO audits (404s and redirects in the sitemap), monitoring competitors' new pages with "modified after", content inventories and site migrations.

### Input example

```json
{
  "startUrls": ["docs.apify.com", "https://example.com/sitemap_index.xml"],
  "includePatterns": ["/blog/"],
  "modifiedAfter": "2026-09-01",
  "checkStatus": false
}
```

### How much does it cost to extract all URLs from a sitemap?

Pay per event: you pay only for results.

**Example:** 10,000 URLs cost **$3.00** listed only, or **$8.00** with the status check ($0.0008 per checked URL instead of $0.0003). Filtered-out URLs and failed sitemaps are not charged.

Apify also charges its standard run-start fee of $0.00005 per GB of run memory (a fraction of a cent per run). The exact prices are always on the **Pricing** tab, and you can cap any run with *Maximum cost per run*.

### FAQ

**Do I need the sitemap address?**
No. A domain is enough; it reads robots.txt and tries the common sitemap paths.

**Which formats are supported?**
XML, gzipped `.xml.gz`, plain-text sitemaps and RSS/Atom feeds.

**Do I pay for URLs my filters remove?**
No. You're only charged for URLs you keep.

### More Tidyfold tools

| Tool | Use it for |
|---|---|
| [Website Screenshot API: Bulk, Full-Page & Mobile](https://apify.com/tidyfold/website-screenshot) | website screenshot API |
| [HTML to PDF Converter API: URL & HTML to PDF](https://apify.com/tidyfold/web-to-pdf) | HTML to PDF |
| [PDF Table Extractor: PDF to Excel, CSV & JSON](https://apify.com/tidyfold/pdf-tables-to-csv) | PDF to Excel |
| [Invoice & Receipt Parser: PDF to JSON (No AI Key)](https://apify.com/tidyfold/invoice-pdf-to-json) | invoice parser |
| [PDF OCR: Scanned PDF to Text Extractor](https://apify.com/tidyfold/pdf-text-ocr) | PDF OCR |
| [NPI Registry Scraper: US Healthcare Provider Leads](https://apify.com/tidyfold/npi-provider-lookup) | NPI registry scraper |
| [Contractor License Scraper: Texas, Colorado & Washington](https://apify.com/tidyfold/trade-license-lookup) | contractor license lookup |
| [New Business Leads: Newly Registered LLCs (CO, NY, OR)](https://apify.com/tidyfold/new-business-filings) | new business leads |
| [Contact Details Scraper: Emails, Phones & Tech Stack](https://apify.com/tidyfold/website-contact-finder) | contact details scraper |
| [Bulk WHOIS Lookup: Domain Expiry & Availability (RDAP)](https://apify.com/tidyfold/domain-whois-lookup) | bulk WHOIS lookup |

### Use it from code or no-code tools

Every run can be started from the Apify API, the Apify Python/JS clients, or connected to n8n, Make, Zapier and Google Sheets through Apify integrations. Results download as JSON, CSV, Excel or XML.

```python
from apify_client import ApifyClient
client = ApifyClient("<YOUR_APIFY_TOKEN>")
run = client.actor("tidyfold/sitemap-url-extractor").call(run_input={'startUrls': ['docs.apify.com', 'https://example.com/sitemap_index.xml'], 'includePatterns': ['/blog/'], 'modifiedAfter': '2026-09-01', 'checkStatus': False})
for item in client.dataset(run["defaultDatasetId"]).iterate_items():
    print(item)
```

### Support

Found a bug or need a field added? Open an issue on the **Issues** tab. Tidyfold maintains these tools daily and usually replies within 1 business day.

# Actor input Schema

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

A domain (we find its sitemaps via robots.txt and common paths) or a direct sitemap / sitemap index URL. XML, .xml.gz, plain-text and RSS/Atom sitemaps all work.

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

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

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

Keep only URLs matching at least one of these regular expressions, e.g. /blog/ or /products/.

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

Drop URLs matching any of these regular expressions, e.g. /tag/ or ?page=.

## `modifiedAfter` (type: `string`):

Keep only URLs whose sitemap lastmod is on or after this date. URLs without lastmod are dropped when this is set.

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

Send a HEAD request (GET fallback) to every URL and add httpStatus and finalUrl, to find 404s, redirects and errors listed in your sitemap. Priced per checked URL instead of per extracted URL.

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

When the sitemap was found automatically, skip URLs on other domains.

## Actor input object example

```json
{
  "startUrls": [
    "docs.apify.com"
  ],
  "maxUrlsPerSite": 200,
  "checkStatus": false,
  "sameDomainOnly": true
}
```

# Actor output Schema

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

URLs returned by the run (one item per row).

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

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

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

```

## MCP server setup

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