# Sitemap Monitor & Integrity Auditor (`vincesoft/sitemap-monitor-integrity-auditor`) Actor

Audit sitemap infrastructure and conservatively monitor URL inventory changes without crawling pages by default.

- **URL**: https://apify.com/vincesoft/sitemap-monitor-integrity-auditor.md
- **Developed by:** [VinceSoft](https://apify.com/vincesoft) (community)
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $20.00 / 1,000 site checks

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?

Actors are web data automations that power AI and operations. They run on the Apify platform to scrape websites, process data, connect APIs, and automate workflows.
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.
Actors are written with capital "A".

## 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.
The best way to integrate Actors is as follows.

- **AI agents and MCP clients** — the [Apify MCP server](https://docs.apify.com/integrations/mcp.md) at `https://mcp.apify.com` (remote, streamable HTTP, OAuth on first use).
- **Agentic workflows and local Actor development** — [Agent Skills](https://apify.com/.well-known/agent-skills/index.json) with the [Apify CLI](https://docs.apify.com/cli/docs.md): `npm install -g apify-cli`, then `apify login`.
- **JavaScript/TypeScript projects** — the official [JS/TS client](https://docs.apify.com/api/client/js/docs.md): `npm install apify-client`.
- **Python projects** — the official [Python client](https://docs.apify.com/api/client/python/docs.md): `pip install apify-client`.
- **Any other language** — the [REST API](https://docs.apify.com/api/v2.md).

For usage examples, see the [API](#api) section below.

For more details, see Apify documentation as [Markdown index](https://docs.apify.com/llms.txt) and [Markdown full-text](https://docs.apify.com/llms-full.txt).

# README

### What does Sitemap Monitor & Integrity Auditor do?

Sitemap Monitor & Integrity Auditor is an **HTTP-only sitemap audit and change-monitoring API**. It discovers sitemap declarations through `robots.txt`, walks sitemap indexes, validates XML, gzip, and text sitemaps, and reports trustworthy URL inventory changes without crawling every listed page by default.

It distinguishes publisher-declared `<lastmod>` changes from actual page-content changes and never turns an incomplete sitemap tree into a wave of false URL removals.

### Why use Sitemap Monitor & Integrity Auditor?

- Detect missing, broken, malformed, oversized, or circular sitemap infrastructure.
- Track new URLs, declared `lastmod` changes, and conservatively confirmed removals.
- Reuse unchanged sitemap state with `ETag`, `Last-Modified`, and HTTP 304 responses.
- Feed crawler queues, RAG ingestion, migration checks, Make, n8n, Zapier, or webhooks.
- Schedule monitors and consume results through the Apify API.
- Process large inventories with streaming XML parsing, SQLite working state, and sharded persistent storage.

The Actor does not use a browser, proxy, CAPTCHA service, or AI. It only fetches pages listed in a sitemap when page-status checking is explicitly enabled.

### What data can it return?

| Record type | What it contains |
| --- | --- |
| `site_summary` | Overall status, URL counts, issues, requests, bytes, and duration |
| `url_observation` | Current URL inventory or changes such as `URL_ADDED` |
| `sitemap_observation` | HTTP validators, hashes, sizes, reuse, and parse status |
| `audit_finding` | Deterministic issue code, severity, resource, and explanation |

Every input site ends as `SUCCESS`, `PARTIAL`, or `FAILED`. Only a complete `SUCCESS` run can advance monitor state.

### How much does sitemap monitoring cost?

The pay-per-event model charges **$0.02 per site check**, **$0.0001 per delivered URL record**, and **$0.0001 per optional page check**. An unchanged scheduled monitor still performs and charges for a site check; a `changesOnly` run does not pay for URLs it does not deliver. Actual platform pricing appears in the Actor's Pricing tab.

### Input

See the Input tab for every safety limit and timeout. A snapshot:

```json
{
  "sites": [{"url": "https://example.com", "externalId": "main-site"}],
  "mode": "snapshot",
  "outputMode": "all"
}
```

A scheduled monitor:

```json
{
  "sites": [{"url": "https://example.com", "monitorKey": "production"}],
  "mode": "monitor",
  "outputMode": "changesOnly"
}
```

Changing include or exclude patterns creates a new baseline. Do not run the same `monitorKey` concurrently.

### Output

You can download the dataset in JSON, HTML, CSV, or Excel. The default key-value store also contains an `OUTPUT` summary for automation conditions.

```json
{
  "recordType": "url_observation",
  "changeType": "URL_ADDED",
  "url": "https://example.com/new-page",
  "currentLastmod": "2026-09-09"
}
```

### Tips

- Use `changesOnly` for scheduled monitors to minimize result volume and cost.
- Leave page checks disabled unless HTTP status validation is required.
- Start with one site, inspect audit findings, and then expand a batch.
- A `PARTIAL` result intentionally preserves the last successful baseline.

### FAQ and support

#### Does a lastmod change mean the page content changed?

No. `URL_LASTMOD_CHANGED` means only that the sitemap publisher changed its declared value.

#### Why is a missing URL initially pending?

The default requires two consecutive complete runs before confirming removal. This protects automations from temporary sitemap failures.

#### Is it safe to audit internal URLs?

No. The Actor rejects localhost, private, link-local, reserved, metadata-service, credential-bearing, non-HTTP(S), and nonstandard-port URLs, including redirect destinations.

Use only sites you are authorized to access and comply with applicable terms and laws. This Actor reads publicly accessible sitemap infrastructure and does not intentionally collect private user data. If output may contain personal data, ensure you have a legitimate basis to process it. For help, use the Actor's Issues tab; use the API tab for programmatic integration.

# Actor input Schema

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

One to 100 public website, robots.txt, or sitemap URLs.

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

Snapshot extracts current state; monitor compares successful runs.

## `outputMode` (type: `string`):

Return every URL or changes only.

## `discoverFromRobots` (type: `boolean`):

Read Sitemap directives before falling back to /sitemap.xml.

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

Optional case-sensitive wildcard patterns.

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

Case-sensitive wildcard patterns removed from inventory and monitoring state.

## `checkPageStatus` (type: `boolean`):

Disabled by default because it greatly increases requests.

## `pageCheckMode` (type: `string`):

Choose which sitemap URLs receive a lightweight HEAD/GET status check.

## `maxSitemapDepth` (type: `integer`):

Maximum recursive index depth, capped at 8.

## `maxSitemapFiles` (type: `integer`):

Safety limit per site, capped at 10,000.

## `maxUrls` (type: `integer`):

Safety limit per site, capped at 5,000,000.

## `requestTimeoutSecs` (type: `integer`):

Per-request timeout, capped at 120 seconds.

## `maxRequestRetries` (type: `integer`):

Retries for temporary HTTP and network failures.

## `confirmRemovalsAfterRuns` (type: `integer`):

Number of consecutive successful missing observations before confirmation.

## Actor input object example

```json
{
  "sites": [
    {
      "url": "https://www.djangoproject.com/sitemap.xml",
      "externalId": "automatic-check"
    }
  ],
  "mode": "snapshot",
  "outputMode": "all",
  "discoverFromRobots": true,
  "includePatterns": [
    "https://www.djangoproject.com/"
  ],
  "excludePatterns": [],
  "checkPageStatus": false,
  "pageCheckMode": "none",
  "maxSitemapDepth": 8,
  "maxSitemapFiles": 10000,
  "maxUrls": 5000000,
  "requestTimeoutSecs": 30,
  "maxRequestRetries": 3,
  "confirmRemovalsAfterRuns": 2
}
```

# Actor output Schema

## `dataset` (type: `string`):

URL observations, sitemaps, findings, and site summaries.

## `output` (type: `string`):

Concise aggregate run status for automations.

# 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": [
        {
            "url": "https://www.djangoproject.com/sitemap.xml",
            "externalId": "automatic-check"
        }
    ],
    "includePatterns": [
        "https://www.djangoproject.com/"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("vincesoft/sitemap-monitor-integrity-auditor").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": [{
            "url": "https://www.djangoproject.com/sitemap.xml",
            "externalId": "automatic-check",
        }],
    "includePatterns": ["https://www.djangoproject.com/"],
}

# Run the Actor and wait for it to finish
run = client.actor("vincesoft/sitemap-monitor-integrity-auditor").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": [
    {
      "url": "https://www.djangoproject.com/sitemap.xml",
      "externalId": "automatic-check"
    }
  ],
  "includePatterns": [
    "https://www.djangoproject.com/"
  ]
}' |
apify call vincesoft/sitemap-monitor-integrity-auditor --silent --output-dataset

```

## MCP server setup

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

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/ksexWHlqk09YAxVWg/builds/UTiErJnskfcFZl972/openapi.json
