# Sitemap Extractor - All URLs from sitemap.xml, New Pages (`sophisticated_occasion/sitemap-url-extractor-monitor`) Actor

Extract every URL from a website's XML sitemaps (index, .gz, robots.txt discovery) with lastmod, hreflang and images. Filter by date or regex, get only pages new since the last run, optionally check status codes. $0.00045 per URL.

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

## Pricing

from $0.44 / 1,000 url extracted from a sitemaps

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 - All URLs from sitemap.xml, New Pages

Get **every URL from a website's XML sitemaps** in seconds, with `lastmod`, `changefreq`, `priority`, **hreflang alternates** and image counts. Give it a plain site URL: sitemaps are found via robots.txt, `/sitemap.xml` or `/sitemap_index.xml`, nested sitemap indexes and `.xml.gz` files are followed.

**$0.00045 per URL**, no start fee. Optional status checks: $0.0005 each. Failed sitemaps are free.

### Quick start: example input, output and cost

Get all URLs from XML sitemaps with lastmod and hreflang. Monitor competitors for new pages, filter by date, optional status checks. Pay per URL.

**Example input**

```json
{
  "startUrls": [
    "https://www.rfc-editor.org/"
  ]
}
```

**Cost example:** A 10,000-URL sitemap x $0.00045 = **$4.50**; with only-new mode later runs pay only for new URLs.

### Use cases

- **Monitor competitors for new pages** (products, blog posts, landing pages): switch on `onlyNewUrls`, schedule daily, and you pay only for URLs that are new since the last run.
- **SEO audits:** list every indexed URL, find stale pages with `lastmodAfter`, check hreflang coverage, spot redirects with `checkStatus`.
- **Crawl seeding:** feed the URL list to our *Website to Markdown Crawler* or *On-Page SEO Audit* actors.

### Why this one

- Extraction does **not** request every page (unlike tools that always status-check), so it is fast and light on the target site. Status checks are optional, capped and polite.
- Hard `maxUrlsPerSite` limit: max cost known before the run.
- Filters: `lastmodAfter`, include/exclude regex, same-host only.
- Safe parsing: XML bomb/XXE protection, size limits.

### Output

URL items: `url, lastmod, changefreq, priority, alternates[], images, sitemap, site, isNew, extractedAt`.
Status-check items (`type: "status-check"`): `url, statusCode, finalUrl, redirected`. Totals in **SUMMARY**, problems in **ERRORS**.

### Limits

- Sites without a sitemap.xml (or one robots.txt does not point to) return nothing to extract.
- A sitemap lists what the site chose to publish; it can be stale or incomplete.
- Pages are only requested when you switch on the status check.

### Responsible use

Sitemaps are published by site owners for crawlers. We still obey **robots.txt** for every request, make at most about one request per second per site, use an honest User-Agent (`SitemapReader/1.0`), and never log in or bypass bot protection.

| Event | Price |
|---|---|
| URL extracted | $0.00045 |
| URL status checked (optional) | $0.0005 |

*Maintained by DigiVibeTech. Questions or bugs: use the Issues tab; we reply within 2–5 business days.*

# Actor input Schema

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

A site URL (sitemaps are found via robots.txt, /sitemap.xml or /sitemap_index.xml) or a direct sitemap URL (.xml, .xml.gz, index or plain text). Up to 500.

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

Hard limit per start URL, so the cost is predictable: at most this many URLs x $0.0002.

## `onlyNewUrls` (type: `boolean`):

Remembers URLs in a named key-value store and returns (and charges) only URLs not seen before. Schedule the actor to get new pages, products or posts of a site.

## `monitorName` (type: `string`):

Separate memory for different monitors (letters, digits, '-').

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

Optional, e.g. 2026-01-31. URLs without a lastmod date are then skipped.

## `includeUrlRegex` (type: `string`):

Optional regular expression, e.g. /blog/|/products/

## `excludeUrlRegex` (type: `string`):

Optional regular expression.

## `sameHostOnly` (type: `boolean`):

Ignore sitemap URLs that point to other domains (www. is ignored).

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

Sends a polite HEAD request (max 1 per second per site) to the first URLs and reports status code and redirects. $0.0005 per check.

## `maxStatusChecksPerSite` (type: `integer`):

Cap for status checks (they run at 1 per second per site).

## Actor input object example

```json
{
  "startUrls": [
    "https://www.rfc-editor.org/"
  ],
  "maxUrlsPerSite": 10000,
  "onlyNewUrls": false,
  "monitorName": "default",
  "sameHostOnly": true,
  "checkStatus": false,
  "maxStatusChecksPerSite": 100
}
```

# Actor output Schema

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

All result items (overview view)

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

Inputs that could not be processed, with the reason

## `summary` (type: `string`):

Counts of processed, billed and failed items

# 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.rfc-editor.org/"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("sophisticated_occasion/sitemap-url-extractor-monitor").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.rfc-editor.org/"] }

# Run the Actor and wait for it to finish
run = client.actor("sophisticated_occasion/sitemap-url-extractor-monitor").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.rfc-editor.org/"
  ]
}' |
apify call sophisticated_occasion/sitemap-url-extractor-monitor --silent --output-dataset

```

## MCP server setup

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

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/tZ73BRfTIOzpq4UMs/builds/xnP12HNmJwJktq1dL/openapi.json
