# Sitemap Extractor: All URLs from Any Website, $0.50/1K (`conserving_celerytop/sitemap-url-extractor`) Actor

Get every page URL of a website from its XML sitemaps: sitemaps are found through robots.txt, sitemap indexes are followed, and each URL comes with last modified date, change frequency and priority. Filter by text. $0.50 per 1,000 URLs.

- **URL**: https://apify.com/conserving\_celerytop/sitemap-url-extractor.md
- **Developed by:** [Don Mangu](https://apify.com/conserving_celerytop) (community)
- **Categories:** SEO tools, Developer tools, Marketing
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $0.35 / 1,000 sitemap urls

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 Extractor: All URLs from Any Website, $0.50/1K

This sitemap extractor gets every page URL of a website from its XML sitemaps. Enter a bare domain such as `gov.uk` or a sitemap address, and it finds the sitemaps through robots.txt, falls back to the usual addresses (/sitemap.xml, /sitemap\_index.xml, /wp-sitemap.xml), follows sitemap indexes, unpacks .gz files and also reads plain text sitemaps. Each URL comes with last modified date, change frequency and priority.

**Cost:** $0.0005 per URL ($0.50 per 1,000). Websites without a sitemap, unreadable sitemaps and invalid entries are free. No login or API key.

### How to extract all URLs from a sitemap

1. Enter websites or sitemap addresses under **Websites or sitemaps**.
2. Optionally set **URL contains** to keep one section such as /blog/ or /docs/, and **URLs per website**.
3. Click **Start**, then open the **Sitemap URLs** table or download the list.

The form opens with GOV.UK and one NASA post sitemap, 50 URLs each. It takes a few seconds and costs about 5 cents. Typical uses are SEO audits (every indexable URL with its last modified date), content inventories and migration checks (compare the URL lists of an old and a new site), and URL lists for other Actors such as a scraper, a screenshot or a Markdown Actor.

### How much does the sitemap URL extractor cost?

| Event | Price |
|---|---|
| Sitemap URL (`sitemap-url`) | $0.0005 ($0.50 per 1,000) |
| Website without a sitemap, unreadable sitemap or invalid entry | Free |

Apify adds only its small standard fee per run start. You can set a spending limit on any run, and the Actor stops cleanly when it is reached.

Example: a full inventory of a 40,000-page store costs 40,000 x $0.0005 = $20.

### Input

```json
{
  "startUrls": [
    "https://www.gov.uk",
    "https://www.nasa.gov/wp-sitemap-posts-post-1.xml"
  ],
  "maxUrlsPerSite": 50
}
```

### Output

One row per result:

```json
{
  "input": "https://www.gov.uk",
  "url": "https://www.gov.uk/browse/benefits",
  "lastModified": "2026-09-20T10:15:00.000Z",
  "changeFrequency": null,
  "priority": null,
  "sitemapUrl": "https://www.gov.uk/sitemaps/sitemap_1.xml",
  "status": "ok",
  "charged": true
}
```

`status` is `ok` for URLs, which are charged. A website where no sitemap could be read gives one free row with `no_sitemap`, `no_urls` or `robots_disallowed` and the reason. A STATS record counts URLs, free rows and requests.

### Related Actors

- [Broken Link Checker](https://apify.com/conserving_celerytop/broken-link-checker): Use it to find broken internal and external links on a website.
- [Web Page to Markdown for AI](https://apify.com/conserving_celerytop/web-page-to-markdown): Use it to turn web pages into clean Markdown for LLMs, RAG and AI agents.
- [AI Crawler Access Audit](https://apify.com/conserving_celerytop/ai-crawler-access-audit): Use it to check which AI crawlers a website allows or blocks in robots.txt.
- [Website Screenshot API](https://apify.com/conserving_celerytop/website-screenshot-api): Use it to capture full-page screenshots or PDFs of a list of URLs.

### FAQ

**Does it crawl pages?** No. It reads sitemap files only, which is fast and cheap. Pages that are missing from the sitemap are not found.

**Does it respect robots.txt?** Yes. Sitemaps are read only where robots.txt allows the token DonMangu-SitemapExtractor or all crawlers.

**Which formats work?** XML sitemaps and sitemap indexes, gzipped files, image sitemap entries (counted) and plain text sitemaps.

**Can I limit it to one section?** Set **URL contains** to a path such as /blog/ or /docs/.

# Actor input Schema

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

Enter websites (example.com), whose sitemaps are found through robots.txt and the usual addresses, or sitemap addresses directly. One per line.

## `urlContains` (type: `string`):

Keep only URLs that contain this text, for example /blog/ or /products/. Leave empty for all.

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

Return at most this many URLs for each website or sitemap you enter.

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

Read at most this many sitemap files per website, counting the files inside sitemap indexes.

## `maxResults` (type: `integer`):

Stop after this many URLs in total.

## Actor input object example

```json
{
  "startUrls": [
    "https://www.gov.uk",
    "https://www.nasa.gov/wp-sitemap-posts-post-1.xml"
  ],
  "maxUrlsPerSite": 50,
  "maxSitemapsPerSite": 50,
  "maxResults": 5000
}
```

# Actor output Schema

## `overview` (type: `string`):

Sitemap URLs

## `errors` (type: `string`):

Sites without URLs

## `all` (type: `string`):

Every row with every field.

## `stats` (type: `string`):

Results, free rows, requests and time.

# 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": [
        "https://www.gov.uk",
        "https://www.nasa.gov/wp-sitemap-posts-post-1.xml"
    ],
    "maxUrlsPerSite": 50
};

// Run the Actor and wait for it to finish
const run = await client.actor("conserving_celerytop/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": [
        "https://www.gov.uk",
        "https://www.nasa.gov/wp-sitemap-posts-post-1.xml",
    ],
    "maxUrlsPerSite": 50,
}

# Run the Actor and wait for it to finish
run = client.actor("conserving_celerytop/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": [
    "https://www.gov.uk",
    "https://www.nasa.gov/wp-sitemap-posts-post-1.xml"
  ],
  "maxUrlsPerSite": 50
}' |
apify call conserving_celerytop/sitemap-url-extractor --silent --output-dataset

```

## MCP server setup

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