# XML sitemap API: URLs and source metadata (`hadi.kanj/sitemap-change-proof`) Actor

Read recursive XML and gzip sitemaps with URL, lastmod and source evidence. Inspect caps before treating the returned URL set as exhaustive. Demo: https://market-data-gateway-production-2084.up.railway.app/launch/sitemap-change-proof

- **URL**: https://apify.com/hadi.kanj/sitemap-change-proof.md
- **Developed by:** [Hadi Kanj](https://apify.com/hadi.kanj) (community)
- **Categories:** SEO tools
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

$0.50 / 1,000 observed 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.

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 Change Proof — URL & Metadata Monitor

Recursively extract sitemap URLs, lastmod and image metadata. Monitor new, changed and no-longer-listed URLs using complete-tree baselines.

### Quick start

```json
{
  "sitemaps": [
    "https://www.sitemaps.org/sitemap.xml"
  ],
  "maxUrls": 100,
  "stateKey": "release-smoke"
}
```

Run once for a snapshot. Schedule repeated runs with the same stateKey for change monitoring. Export the dataset as JSON, CSV or Excel; inspect the SUMMARY record for every source's completeness and baselineUpdated state.

### What you receive

URL, publisher-provided lastModified, priority, changeFrequency and image URLs, with root and child sitemap evidence. Nested sitemap indexes and .gz files supported. Metadata change is not proof of page-content change. NO_LONGER_LISTED is not proof of HTTP deletion. Only complete, fully billed scans replace the baseline; partial or capped scans never confirm removals.

### Limits and accuracy

1–10 root sitemaps; 1–50,000 URLs and 1–200 sitemap files per root (default 10,000 and 50); depth five; eight MB compressed and decompressed file limits. Sitemap listing alone does not establish that a URL is live or indexed. Public feeds only, with robots checks, protected DNS/redirects, bounded reads and explicit errors. No authenticated or blocked content bypass.

### Pricing

$0.0005 per successfully observed URL ($0.5/1,000), including unchanged checks even with onlyChanges. Errors and removal rows are not charged. Platform usage is included under the standard Apify pay-per-event model. A spending-limited run stops before an additional charge and preserves its previous history.

### API

POST https://api.apify.com/v2/acts/hadi.kanj~sitemap-change-proof/run-sync-get-dataset-items with your own Apify Bearer token and JSON input. For larger runs use /runs, poll /actor-runs/{id}, then fetch /datasets/{defaultDatasetId}/items. Never share your token. Source text is publisher-provided; downstream licensing remains your responsibility.

# Actor input Schema

## `sitemaps` (type: `array`):

Public source URLs

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

Maximum records per source

## `stateKey` (type: `string`):

Reuse this name for repeat monitoring; history is isolated to your Apify account.

## `onlyChanges` (type: `boolean`):

Billing still counts all successfully observed records.

## `maxSitemaps` (type: `integer`):

Maximum sitemap files per root

## Actor input object example

```json
{
  "sitemaps": [
    "https://www.sitemaps.org/sitemap.xml"
  ],
  "maxUrls": 10000,
  "stateKey": "default",
  "onlyChanges": false,
  "maxSitemaps": 50
}
```

# Actor output Schema

## `records` (type: `string`):

Export JSON, CSV or Excel.

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

Completeness, errors and baseline status.

# 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 = {
    "sitemaps": [
        "https://www.sitemaps.org/sitemap.xml"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("hadi.kanj/sitemap-change-proof").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 = { "sitemaps": ["https://www.sitemaps.org/sitemap.xml"] }

# Run the Actor and wait for it to finish
run = client.actor("hadi.kanj/sitemap-change-proof").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 '{
  "sitemaps": [
    "https://www.sitemaps.org/sitemap.xml"
  ]
}' |
apify call hadi.kanj/sitemap-change-proof --silent --output-dataset

```

## MCP server setup

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

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/b4yzBA1IhalU9kPHS/builds/l89En3g3o3xwkKAXD/openapi.json
