# Sitemap URLs: every URL of a website from its XML sitemaps (`steadydata/sitemap-urls`) Actor

Sitemap URL extractor: every URL a website lists in its XML sitemaps, up to 100 sites per run: sitemaps are found through robots.txt and the usual paths, sitemap indexes and gzip are followed, and each URL comes with its sitemap, last modification date, change frequency and priority. Pay per URL.

- **URL**: https://apify.com/steadydata/sitemap-urls.md
- **Developed by:** [Steadydata Team](https://apify.com/steadydata) (community)
- **Categories:** AI, 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.28 / 1,000 url listeds

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 URLs: every URL of a website from its XML sitemaps

Every URL a website lists in its XML sitemaps, up to 100 sites per run: sitemaps are found through robots.txt and the usual paths, sitemap indexes and gzip are followed, and each URL comes with its sitemap, last modification date, change frequency and priority. Pay per URL.

### Why this scraper

- **Only delivered results are charged.** Inputs that fail come back as clear error
  records at no cost.
- No crawling: the site's own sitemap files are read, so a whole site is listed in a handful of requests. Measured on apify.com and gov.uk: 300 URLs each, discovered through robots.txt and a sitemap index, for less than a tenth of a cent.
- Discovery and etiquette built in: sitemaps are found through the Sitemap: lines of robots.txt and the usual paths, sitemap indexes and gzip files are followed, plain-text sitemaps are read too, duplicates are dropped, and every sitemap fetch is checked against the host's robots.txt rules first. Each URL keeps the sitemap it came from, its lastmod, changefreq and priority.

### Who this is for

Paste domains, site URLs or sitemap URLs in `sites` (up to 100 per run) and set `maxUrlsPerSite` (default 5,000, ceiling 50,000). Every row carries the site, the sitemap file the URL came from, the URL, its last modification date, change frequency, priority and the number of image entries attached to it.

### Who this is not for

A sitemap lists what the site owner chose to list; pages missing from it are not found, and a site without any sitemap comes back as one free `NO_SITEMAP` error row. `lastmod`, `changefreq` and `priority` are optional in the sitemap standard and empty when the site leaves them out (apify.com gives none of them, gov.uk gives lastmod and priority). URLs are delivered in sitemap order up to the ceiling; on very large sites the cap decides which part you get.

### Input example

```json
{
    "sites": [
        "apify.com"
    ],
    "maxUrlsPerSite": 5000
}
```

### Output example

- `site`
- `sitemapUrl`
- `url`
- `lastmod`
- `changefreq`
- `priority`
- `imageCount`

Error codes: `INVALID_SITE`, `NO_SITEMAP`, `BLOCKED`, `FETCH_FAILED`.

One delivered row looks like this:

```json
{
  "site": "apify.com",
  "sitemapUrl": "https://apify.com/sitemap/pages.xml",
  "url": "https://apify.com/",
  "lastmod": null,
  "changefreq": null,
  "priority": null,
  "imageCount": 0,
  "status": "ok"
}
```

### Related actors from steadydata

- [technical-seo-audit](https://apify.com/steadydata/technical-seo-audit): audit the pages the sitemap lists
- [website-tech-stack](https://apify.com/steadydata/website-tech-stack): the technology behind the site
- [rss-feed-reader](https://apify.com/steadydata/rss-feed-reader): the site's feeds, discovered from the homepage
- Used together with webpage-to-markdown and pdf-text-extractor in a recipe: [Feed a RAG pipeline with clean page text](https://steadydata.io/recipes/rag-pipeline-clean-page-text.html).

### Pricing

Pay per event: one `url-listed` event per delivered result. No charge for inputs
that fail, no separate platform-usage surcharge.

**Free Apify plan:** this actor delivers up to 25 rows per run for accounts on the Apify free
plan, and then stops with a message. That limit is set by us, not by Apify. It exists so the
actor keeps paying for itself for the people who do pay. Any paid Apify plan runs it at full
size, billed per delivered row, with failed rows never charged.

**Reviews:** if this actor saves you time, a short review on this page is the one thing that
helps most. Ratings are what other buyers look at first, and we have no other way to ask.

### FAQ

**Does it crawl the pages?** No, it only reads the sitemap files; that is what makes it fast and cheap. Use the Technical SEO Audit actor from the related actors below to fetch and check the pages themselves.

**What if I know the sitemap URL?** Paste it directly; discovery is skipped and that file (and any index it points to) is read.

**Are gzip sitemaps supported?** Yes, `.xml.gz` and gzip-encoded bodies are unpacked.

**Does it respect robots.txt?** Yes. A sitemap path a site disallows in its robots.txt is skipped, not fetched.

**Do I pay for a site without a sitemap?** No. Only delivered URL rows are charged.

**Is personal data collected?**
`lastmod` is passed through as the site wrote it (a date or a full timestamp); `imageCount` counts the image entries the sitemap attaches to the URL.

**What happens when the source changes?**
Sources change from time to time; that is the nature of this work. The actor is
monitored daily and fixed fast, and while it is broken you are not charged, because
only delivered results cost anything.

# Changelog

This Actor's version history is a separate document: https://apify.com/steadydata/sitemap-urls/changelog.md

# Actor input Schema

## `sites` (type: `array`):

One per row, up to 100: a domain (example.com), a site URL, or a sitemap URL (https://example.com/sitemap.xml).

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

Cost ceiling per site, in sitemap order.

## Actor input object example

```json
{
  "sites": [
    "apify.com"
  ],
  "maxUrlsPerSite": 5000
}
```

# Actor output Schema

## `results` (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 = {
    "sites": [
        "apify.com"
    ]
};

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

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

```

## MCP server setup

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

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/3JG7ssZwwefjLULtq/builds/whgHvy37dfeH2u7ju/openapi.json
