# Sitemap Extractor: All URLs + New Pages Since Last Run (`fabricable_steel/sitemap-extractor`) Actor

Every URL a website lists in its sitemaps, with last-modified dates, found automatically from robots.txt. Schedule it to get only the pages a competitor added or removed since the last run. $0.30 per 1,000 URLs.

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

## Pricing

from $0.21 / 1,000 url rows

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: Every URL on a Site, and New Pages Since Last Run

Give it websites and get every page they list in their sitemaps, with last
modified date, change frequency and priority. It finds the sitemaps itself
(from `robots.txt`, or the standard locations), follows sitemap indexes and
reads compressed `.xml.gz` files.

**Watch competitors for new pages.** Switch **Mode** to *Only new and removed
pages*, save it as a task and schedule it daily or weekly: each run returns
only the pages a site added or took down since the last run. New product
pages, blog posts, landing pages, job pages, docs.

### What you get

| field | meaning |
|---|---|
| `site` | the site you asked for |
| `url` | a page listed in the sitemap |
| `change_type` | `null` in *All pages* mode; `new` or `removed` in changes mode |
| `lastmod`, `changefreq`, `priority` | as the site published them (null when not given) |
| `sitemap` | the sitemap file that listed the page |

Filter with **URL contains** (e.g. `/blog/`, `/products/`) and **URL excludes**.
Filters decide what you receive; the run still remembers the whole site, so
changing a filter never produces a burst of false "new" pages.

### Pricing

Pay per row: one `url` event per page delivered (all mode) or per new or
removed page (changes mode). **Never charged:** sites with no readable
sitemap, files that fail or are refused, rows your filters exclude, duplicate
sites or URLs, and the first changes run for a site, which saves a free
baseline.

### How it stays reliable

- **A page is `removed` only after a complete read.** If any sitemap file
  fails or the size cap cuts the read short, new pages are still reported but
  removals are not, and unseen pages stay remembered.
- **No false alarms from a broken sitemap.** A site that suddenly lists fewer
  than half its pages (10 or more before) has its removals held for one run;
  a second run that sees the same confirms them.
- **Spending limits are safe.** Only what was delivered is remembered; the rest
  arrives on the next run.
- **Separate memory per task** (or **Monitor name**).

### What it will not do

It reads only `robots.txt` and the sitemaps sites publish for automated
readers, honours `robots.txt`, names itself honestly, and stops when a site
says no: no login, cookies, proxies or CAPTCHA solving, and no retrying a
refusal under another identity. It does not crawl pages; a site with no
sitemap shows up as `no_sitemap` and is not charged.

### For AI agents

Input: `sites` (websites or sitemap URLs), `mode` (`all` or `changes`),
`maxUrlsPerSite` (default 10,000), `urlContains`, `urlExcludes` (lists of
substrings), `monitorName`. The run's SUMMARY record lists each site's
status, sitemap files read and failed, URLs found and rows delivered.

# Actor input Schema

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

Websites (the sitemaps are found from robots.txt) or direct sitemap addresses, one per line.

## `mode` (type: `string`):

all: every page, every run. changes: only pages added or removed since this site's previous run; the first changes run saves a free baseline.

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

Stop reading a site's sitemaps after this many URLs. A capped read never reports removals.

## `urlContains` (type: `array`):

Deliver only URLs containing one of these, e.g. /blog/ or /products/.

## `urlExcludes` (type: `array`):

Skip URLs containing any of these, e.g. /tag/ or ?page=

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

Saved tasks keep their own memory automatically. For API or ad-hoc runs, name each monitor so two monitors on one site do not share it.

## Actor input object example

```json
{
  "sites": [
    "apify.com"
  ],
  "mode": "all",
  "maxUrlsPerSite": 200
}
```

# Actor output Schema

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

One row per page listed in the sitemaps, or per new or removed page in changes mode.

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

Each site's status, sitemap files read and failed, URLs found and rows delivered.

# 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"
    ],
    "maxUrlsPerSite": 200
};

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

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

```

## MCP server setup

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