# Sitemap URL Inventory and Index Auditor (`danielmichalek/sitemap-url-inventory`) Actor

Sitemap XML exports become a URL inventory with source references. Missing index targets and duplicate URLs appear in the review report. Send your XML documents through the input to inspect the results.

- **URL**: https://apify.com/danielmichalek/sitemap-url-inventory.md
- **Developed by:** [Daniel Michałek](https://apify.com/danielmichalek) (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

$30.00 / 1,000 complete sitemap inventory reports

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 URL Inventory and Index Auditor

### Overview

Turn supplied sitemap XML into a traceable URL inventory for migration planning, crawl preparation and dataset intake. The Actor resolves references between supplied documents, preserves URL occurrences across files and reports missing targets, duplicate URLs, malformed XML and invalid metadata.

Processing uses a deterministic XML parser and the supplied document set. Source requests stay at zero. Each sourceUrl labels the XML supplied by the caller. Query parameters remain part of page identity. Checking indexing, permissions, crawlability and current search-engine acceptance requires a separate workflow.

### Input example

Provide sitemaps as an array of objects with id, sourceUrl and xml. IDs contain 1 to 80 ASCII letters, digits, dots, underscores or hyphens. IDs and normalized source URLs must be unique within the input. Use absolute HTTP or HTTPS source URLs. Supply decompressed XML.

```json
{
  "sitemaps": [
    {
      "id": "pages",
      "sourceUrl": "https://example.com/sitemap.xml",
      "xml": "<urlset xmlns=\"http://www.sitemaps.org/schemas/sitemap/0.9\"><url><loc>https://example.com/page</loc><lastmod>2026-10-01</lastmod></url></urlset>"
    }
  ],
  "maxItems": 1
}
```

The working limits are 20 documents, 5000 combined url and sitemap entries, 2000000 serialized UTF-8 input bytes, and 1500000 XML bytes per document. A URL supports up to 2048 characters after normalization. Unknown input fields, duplicate document identifiers, excessive limits and malformed input types fail before report delivery.

### Output

One dataset item contains documents, indexReferences, urls and findings. Each inventory URL contains every source occurrence, including documentId, a one-based entryIndex and validated lastmod, changefreq and numeric priority. The URLS_CSV export contains one row per URL occurrence. SITEMAP_INVENTORY stores matching JSON and REPORT stores the readable finding summary.

complete means the analysis was delivered. inventoryComplete is false when error findings establish missing or invalid inventory coverage. A successfully delivered audit can have qualityStatus INCOMPLETE. Metadata warnings produce REVIEW_REQUIRED. CHECKS_PASSED covers the implemented checks.

A sitemap index reference resolves through an exact normalized match to a supplied sourceUrl. Missing children remain NOT_SUPPLIED, malformed targets remain INVALID_TARGET and supplied valid targets are RESOLVED. Supplied nested indexes produce INDEX_POINTS_TO_INDEX findings. Graph traversal identifies cycles and terminates within the bounded document set.

### Reviewing findings

REFERENCED_SITEMAP_NOT_SUPPLIED calls for adding the referenced XML to a fresh input set. XML_PARSE_ERROR calls for repairing or re-exporting that source document. DTD_OR_ENTITY_UNSUPPORTED calls for a plain sitemap export using standard XML character entities. MISSING_OR_MULTIPLE_LOC requires one location for the indicated source entry. DUPLICATE_URL identifies occurrences to inspect before migration or crawl batching.

INVALID_LASTMOD, INVALID_CHANGEFREQ and INVALID_PRIORITY preserve the page URL while leaving the affected exported field null. Review the original source entry. CROSS_ORIGIN_LOCATION_REQUIRES_REVIEW preserves the location and highlights the need to verify the publication arrangement. Review index cycles and index-to-index references against the destination consumer's supported format.

### Pricing and cost control

The local proposal is USD 0.03 per complete sitemap-inventory-report for up to 20 supplied documents and 5000 combined entries. Active pricing requires a qualified cloud release. The comparable competitor median, measured cloud cost, customer willingness to pay and realized margin remain unverified. PRICING.json preserves their explicit pending states.

The runner allows one report, zero content requests and a cooperative 45-second budget. Node starts with a 128 MiB old-generation budget and 8 MiB semi-space. SDK acceptance also measures full-process RSS and applies a process timeout. Proposed pricing remains separate from local execution evidence.

### Limits and fair use

Supported roots are urlset and sitemapindex in the standard sitemap namespace. Prefixes resolve through namespace declarations. An absent namespace produces a warning. Standard XML entities and CDATA are supported. Foreign extension fields inside entries are ignored. DTD declarations, custom entities, multiple roots and unsupported root children produce document findings.

Source and page URLs containing credentials or fragments are rejected. Query strings remain intact because they can identify different pages. Remove secrets and unnecessary personal information from supplied URLs and XML before upload. Original INPUT follows Apify retention settings. Markdown escapes supplied identifiers and CSV protects numeric identifier cells.

Validation implements a defined sitemap subset. Supply authorized exports and check any current consumer-specific rules. The inventory represents the supplied documents at the time of export.

### Development and recovery

Use Node 22 or newer, the pinned dependency lock and npm ci --offline --ignore-scripts --omit=dev --no-audit --no-fund when the packages are cached. npm test runs unit and handler regressions. npm start invokes the real Apify SDK.

PREPARED is persisted before report effects. COMPLETE requires matching delivery counters and a physical dataset readback. Replay verifies full input, runtime, pricing, JSON, CSV, Markdown and the physical report. Changed or uncertain effects require reconciliation. Run one writer per storage directory. Use fresh storage for a new intentional job.

# Actor input Schema

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

Up to 20 supplied XML documents with unique id, absolute sourceUrl and xml. Source URLs label supplied content and are not fetched.

## `maxItems` (type: `integer`):

Exactly one report. Limits are 5000 XML entries and 2 MB total input.

## Actor input object example

```json
{
  "sitemaps": [
    {
      "id": "index",
      "sourceUrl": "https://example.com/sitemap.xml",
      "xml": "<sitemapindex xmlns=\"http://www.sitemaps.org/schemas/sitemap/0.9\"><sitemap><loc>https://example.com/pages.xml</loc></sitemap></sitemapindex>"
    },
    {
      "id": "pages",
      "sourceUrl": "https://example.com/pages.xml",
      "xml": "<urlset xmlns=\"http://www.sitemaps.org/schemas/sitemap/0.9\"><url><loc>https://example.com/products?color=red&amp;size=m</loc><lastmod>2026-10-01</lastmod><priority>0.8</priority></url><url><loc>https://example.com/products?color=blue&amp;size=m</loc><changefreq>weekly</changefreq></url></urlset>"
    }
  ],
  "maxItems": 1
}
```

# Actor output Schema

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

No description

## `csv` (type: `string`):

No description

## `report` (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 = {
    "sitemaps": [
        {
            "id": "index",
            "sourceUrl": "https://example.com/sitemap.xml",
            "xml": "<sitemapindex xmlns=\"http://www.sitemaps.org/schemas/sitemap/0.9\"><sitemap><loc>https://example.com/pages.xml</loc></sitemap></sitemapindex>"
        },
        {
            "id": "pages",
            "sourceUrl": "https://example.com/pages.xml",
            "xml": "<urlset xmlns=\"http://www.sitemaps.org/schemas/sitemap/0.9\"><url><loc>https://example.com/products?color=red&amp;size=m</loc><lastmod>2026-10-01</lastmod><priority>0.8</priority></url><url><loc>https://example.com/products?color=blue&amp;size=m</loc><changefreq>weekly</changefreq></url></urlset>"
        }
    ],
    "maxItems": 1
};

// Run the Actor and wait for it to finish
const run = await client.actor("danielmichalek/sitemap-url-inventory").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": [
        {
            "id": "index",
            "sourceUrl": "https://example.com/sitemap.xml",
            "xml": "<sitemapindex xmlns=\"http://www.sitemaps.org/schemas/sitemap/0.9\"><sitemap><loc>https://example.com/pages.xml</loc></sitemap></sitemapindex>",
        },
        {
            "id": "pages",
            "sourceUrl": "https://example.com/pages.xml",
            "xml": "<urlset xmlns=\"http://www.sitemaps.org/schemas/sitemap/0.9\"><url><loc>https://example.com/products?color=red&amp;size=m</loc><lastmod>2026-10-01</lastmod><priority>0.8</priority></url><url><loc>https://example.com/products?color=blue&amp;size=m</loc><changefreq>weekly</changefreq></url></urlset>",
        },
    ],
    "maxItems": 1,
}

# Run the Actor and wait for it to finish
run = client.actor("danielmichalek/sitemap-url-inventory").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": [
    {
      "id": "index",
      "sourceUrl": "https://example.com/sitemap.xml",
      "xml": "<sitemapindex xmlns=\\"http://www.sitemaps.org/schemas/sitemap/0.9\\"><sitemap><loc>https://example.com/pages.xml</loc></sitemap></sitemapindex>"
    },
    {
      "id": "pages",
      "sourceUrl": "https://example.com/pages.xml",
      "xml": "<urlset xmlns=\\"http://www.sitemaps.org/schemas/sitemap/0.9\\"><url><loc>https://example.com/products?color=red&amp;size=m</loc><lastmod>2026-10-01</lastmod><priority>0.8</priority></url><url><loc>https://example.com/products?color=blue&amp;size=m</loc><changefreq>weekly</changefreq></url></urlset>"
    }
  ],
  "maxItems": 1
}' |
apify call danielmichalek/sitemap-url-inventory --silent --output-dataset

```

## MCP server setup

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

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/eBKLMlfwByplJebq1/builds/dKlfPjs7yMIQagREr/openapi.json
