# Sitemap Extractor & Indexability Auditor (No Proxy & AI Bots) (`ajisai-labs/sitemap-extractor-indexability-auditor`) Actor

Fast, proxy-free Sitemap extractor (XML, nested index, .xml.gz, plain text, broken XML recovery) with 4-point Indexability audit (HTTP/redirects, robots.txt, noindex, 5-way canonical), AI search bot reachability diff (GPTBot/ClaudeBot/PerplexityBot), and /llms.txt diagnostics in 512 MB.

- **URL**: https://apify.com/ajisai-labs/sitemap-extractor-indexability-auditor.md
- **Developed by:** [Ajisai-Labs](https://apify.com/ajisai-labs) (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.20 / 1,000 sitemap url extracteds

This Actor is paid per event and usage. You are charged both the fixed price for specific events and for Apify platform usage.
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 & Indexability Auditor — Fast, No Proxy, Broken Links & AI Bots

Extract every URL from XML, nested `sitemap_index.xml`, `.xml.gz`, plain-text, and even malformed Sitemaps at **512 MB** with **no proxy required by default** — then run a **4-point Indexability audit** (HTTP status & redirect chains, `robots.txt` conflicts, `noindex`, 5-way Canonical checks), **HTML SEO & JSON-LD validation**, **AI search bot reachability differential checks** (`OAI-SearchBot`, `GPTBot`, `ClaudeBot`, `Claude-SearchBot`, `PerplexityBot`), and **`/llms.txt` diagnostics**.

***

### Why Use This Actor?

- **512 MB & No Proxy by Default:** Pure async HTTP/2 (`httpx` + `lxml` + `protego`) with zero headless browser overhead. Starts with direct HTTP and automatically escalates to Apify Proxy only when HTTP `403 / 429 / 503` or a WAF challenge is detected (`autoEscalateProxy: true`).
- **Complete Sitemap Format & Quality Coverage:**
  - Auto-discovers Sitemaps from `robots.txt` (`Sitemap:` directives) with automatic fallback to `/sitemap.xml` → `/sitemap_index.xml` → `/sitemap.xml.gz`, or accepts explicit Sitemap URLs directly.
  - Recursively expands nested `sitemapindex` files (up to depth 5 with cycle protection), decompresses `.xml.gz` via magic-byte detection (`1f 8b` with 30 MB decompression bomb cap), supports plain-text Sitemaps, and recovers broken XML (`recovered_xml: true`) with XXE disabled.
  - Flags duplicate URLs, cross-host URLs, files exceeding the 50,000-URL protocol limit, and invalid W3C `<lastmod>` dates.
- **4-Point Indexability Reconciliation:**
  - **HTTP & Redirects:** Detects `HTTP_4XX`, `HTTP_5XX`, `FETCH_ERROR`, `HTTP_NON_HTTPS`, 1-hop `REDIRECT_CHAIN` warnings, 2+ hop / `REDIRECT_LOOP` / `TOO_MANY_REDIRECTS` criticals.
  - **`robots.txt` Conflicts:** RFC 9309 compliant checks via `protego>=0.6.2` (`DISALLOWED_BY_ROBOTS`).
  - **`noindex` Conflicts:** Inspects both HTTP `X-Robots-Tag` headers and HTML `<meta name="robots|googlebot">` tags (`NOINDEX_IN_SITEMAP`).
  - **5-Way Canonical Classification:** `self`, `index_file_equivalent` (treats trailing `/` vs `/index.html`, `/index.htm`, `/index.php` as `info` without false-positive penalties), `cross_path_same_host` (`warning`), `cross_host` (`critical`), and `missing` (`info`).
- **AI Search Bot Differential Probing & `/llms.txt` Audit:**
  - Tests `OAI-SearchBot`, `GPTBot`, `ClaudeBot`, `Claude-SearchBot`, and `PerplexityBot` against both `robots.txt` and live HTTP status compared to a desktop browser UA — flagging unintended CDN/WAF differential blocks (`AI_BOT_CDN_BLOCK`).
  - Validates `/llms.txt` (requires HTTP 200, non-HTML payload, and `>= 20` bytes) and reports byte size, Markdown heading count, and link count.
- **Actionable 0–100 Health Score & Top Priority Fixes:** Capped per-category scoring prevents single issues from collapsing scores to 0, paired with up to 10 prioritized remediation items.

***

### Execution Modes

| Mode | What It Runs | Best For |
|---|---|---|
| `extract_only` | `robots.txt` discovery + recursive Sitemap extraction + Sitemap hygiene stats & score (0 page fetches, 0 AI probes) | Ultra-fast bulk URL extraction up to 50,000 URLs/domain |
| `indexability_audit` *(default)* | Sitemap extraction + HTTP/redirect/robots/noindex/canonical audit on up to `maxAuditPagesPerDomain` URLs + optional AI bot & `/llms.txt` audit | Broken link detection, redirect cleanup, indexability QA |
| `full_audit` | Everything in `indexability_audit` + HTML SEO (`title`, `meta description`, `h1`, `<200` char `SSR_THIN_CONTENT`) + `application/ld+json` syntax validation + 3-axis 0–100 health score | Complete technical SEO, AI search readiness, and monitoring |

***

### Input Example

```json
{
  "startUrls": [
    "https://docs.python.org",
    "https://docs.perplexity.ai"
  ],
  "mode": "full_audit",
  "maxUrlsPerDomain": 500,
  "maxAuditPagesPerDomain": 25,
  "includeAiBotAudit": true,
  "outputMode": "both",
  "onlyIssuesInDataset": false,
  "autoEscalateProxy": true,
  "proxyConfiguration": {
    "useApifyProxy": false
  }
}
```

> `startUrls` accepts both plain URL strings (`["https://example.com"]`) and Apify RequestList objects (`[{"url": "https://example.com"}]`).

***

### Output Format

The Actor writes flat JSON records to the **Default Dataset** (`record_type: "summary"` and `record_type: "url"`) and always persists the complete aggregated run payload to the **Key-Value Store** under key **`SUMMARY`**.

#### Dataset `summary` Record Example

```json
{
  "record_type": "summary",
  "domain": "docs.perplexity.ai",
  "start_url": "https://docs.perplexity.ai/",
  "mode": "full_audit",
  "health_score": 100,
  "robots_status": "loaded",
  "sitemap_stats": {
    "discovery_method": "robots_txt",
    "sitemap_files_fetched": 1,
    "sitemap_files_failed": 0,
    "total_urls_found": 210,
    "unique_urls_count": 210,
    "duplicate_urls_count": 0,
    "cross_host_urls_count": 0,
    "recovered_xml_files_count": 0,
    "over_50k_files_count": 0,
    "lastmod_coverage_rate": 1.0
  },
  "pages_audited": 10,
  "indexable_count": 10,
  "non_indexable_count": 0,
  "canonical_breakdown": {
    "self": 10,
    "index_file_equivalent": 0,
    "cross_path_same_host": 0,
    "cross_host": 0,
    "missing": 0
  },
  "ai_audit": {
    "target_url": "https://docs.perplexity.ai/",
    "browser_http_status": 200,
    "any_cdn_or_waf_diff_block": false,
    "llms_txt": {
      "url": "https://docs.perplexity.ai/llms.txt",
      "http_status": 200,
      "llms_txt_present": true,
      "byte_size": 48435,
      "heading_count": 3,
      "link_count": 217
    }
  },
  "top_priority_fixes": [],
  "proxy_escalated": false,
  "elapsed_sec": 3.42
}
```

#### Dataset `url` Record Example

```json
{
  "record_type": "url",
  "domain": "docs.python.org",
  "url": "https://docs.python.org/3/",
  "sitemap_source": "https://docs.python.org/sitemap.xml",
  "audited": true,
  "http_status": 200,
  "final_url": "https://docs.python.org/3/",
  "redirect_hops": 0,
  "robots_allowed": true,
  "indexable": true,
  "noindex": false,
  "canonical_status": "index_file_equivalent",
  "canonical_url": "https://docs.python.org/3/index.html",
  "issues": [
    {
      "code": "CANONICAL_INDEX_FILE_EQUIVALENT",
      "severity": "info",
      "detail": "Canonical differs only by trailing '/' vs index file: https://docs.python.org/3/index.html"
    }
  ],
  "issue_codes": ["CANONICAL_INDEX_FILE_EQUIVALENT"],
  "issue_severities": ["info"],
  "elapsed_ms": 148
}
```

***

### Pay-Per-Event Pricing (No Double-Charging)

- `sitemap-url-extracted`: Charged once per extracted-only (unaudited) URL row pushed to the Dataset.
- `page-indexability-audited`: Charged once per HTTP/HTML audited URL row pushed to the Dataset (never double-charged with `sitemap-url-extracted`).
- `domain-audit-summary`: Charged once per audited domain summary (with deterministic idempotency key and automatic safe stop when `maxTotalChargeUsd` is reached).

***

### MCP & AI Agent Prompt Examples

This Actor's flat JSON schema and Key-Value Store `SUMMARY` record are designed for direct tool invocation via the **Apify MCP Server**:

- **Technical SEO & Broken Links Check:**
  > "Run `ajisai-labs/sitemap-extractor-indexability-auditor` in `indexability_audit` mode on `https://example.com` with `onlyIssuesInDataset: true` and summarize all 4xx/5xx URLs, redirect chains, noindex conflicts, and canonical mismatches."
- **AI Search Readiness & `/llms.txt` Audit:**
  > "Audit `https://example.com` in `full_audit` mode (`maxAuditPagesPerDomain: 10`, `includeAiBotAudit: true`) and check whether `OAI-SearchBot`, `GPTBot`, `ClaudeBot`, `Claude-SearchBot`, or `PerplexityBot` are blocked by `robots.txt` or CDN/WAF rules, and report whether `/llms.txt` is valid."
- **Fast Bulk Sitemap Extraction:**
  > "Extract up to 2,000 URLs from `https://example.com` using `mode: extract_only` and report duplicate URLs, cross-host links, and broken XML files."

# Actor input Schema

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

Domain root URLs (e.g. https://www.sitemaps.org) or explicit Sitemap URLs (e.g. https://example.com/sitemap.xml). Also accepts Apify RequestList objects ({ "url": "..." }) via API.

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

Choose between ultra-fast Sitemap extraction only, 4-point Indexability auditing, or full technical SEO + JSON-LD + AI crawler diagnostics.

## `maxUrlsPerDomain` (type: `integer`):

Maximum unique URLs extracted and emitted per domain from discovered Sitemaps.

## `maxAuditPagesPerDomain` (type: `integer`):

Maximum URLs to fetch and audit per domain (automatically treated as 0 in extract_only mode).

## `includeAiBotAudit` (type: `boolean`):

Compare desktop browser reachability against OAI-SearchBot, GPTBot, ClaudeBot, Claude-SearchBot, and PerplexityBot on the domain root, and inspect /llms.txt (skipped in extract_only mode).

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

Choose whether to write domain summaries, URL rows, or both to the default Dataset. Key-Value Store record SUMMARY is always saved.

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

Maximum number of Sitemap files (including nested sitemapindex children) fetched per domain.

## `concurrency` (type: `integer`):

Maximum simultaneous HTTP requests per domain.

## `onlyIssuesInDataset` (type: `boolean`):

When enabled, only URL records with at least one detected issue are pushed to the Dataset (noise reduction mode).

## `autoEscalateProxy` (type: `boolean`):

Start with free direct HTTP requests and automatically escalate to Apify Proxy only if HTTP 403/429/503 or a WAF challenge is detected.

## `proxyConfiguration` (type: `object`):

Optional Apify Proxy settings. Disabled by default for fast, zero-proxy operation.

## Actor input object example

```json
{
  "startUrls": [
    "https://www.sitemaps.org"
  ],
  "mode": "indexability_audit",
  "maxUrlsPerDomain": 500,
  "maxAuditPagesPerDomain": 50,
  "includeAiBotAudit": true,
  "outputMode": "both",
  "maxSitemapFiles": 30,
  "concurrency": 5,
  "onlyIssuesInDataset": false,
  "autoEscalateProxy": true,
  "proxyConfiguration": {
    "useApifyProxy": false
  }
}
```

# Actor output Schema

## `overview` (type: `string`):

No description

## `summary` (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 = {
    "startUrls": [
        "https://www.sitemaps.org"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("ajisai-labs/sitemap-extractor-indexability-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 = { "startUrls": ["https://www.sitemaps.org"] }

# Run the Actor and wait for it to finish
run = client.actor("ajisai-labs/sitemap-extractor-indexability-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 '{
  "startUrls": [
    "https://www.sitemaps.org"
  ]
}' |
apify call ajisai-labs/sitemap-extractor-indexability-auditor --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,ajisai-labs/sitemap-extractor-indexability-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/gzCmI6cid2UQvpOpy/builds/1ZpUkBGpwcO2TSUQD/openapi.json
