# Broken Link Checker, Sitemap and AI SEO (llms.txt) Auditor (`xenikii/broken-link-sitemap-llms-txt-auditor`) Actor

Broken link checker and AI SEO auditor: verify internal/external links, XML sitemaps, GPTBot/ClaudeBot rules, and generate llms.txt.

- **URL**: https://apify.com/xenikii/broken-link-sitemap-llms-txt-auditor.md
- **Developed by:** [Xenikii](https://apify.com/xenikii) (community)
- **Categories:** SEO tools, AI, Developer tools
- **Security:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $3.00 / 1,000 audited websites

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

## Broken Link Checker, Sitemap and AI SEO (llms.txt) Auditor

Audit any website for **broken internal and external links** (with automatic `GET` fallback so WAF/CDN endpoints never cause `HEAD` false positives), **XML & gzipped sitemaps**, **technical on-page SEO**, **AI search crawler permissions** (`GPTBot`, `OAI-SearchBot`, `ClaudeBot`, `PerplexityBot`, `Google-Extended`), and **spec-compliant `llms.txt` generation** in one lightweight run.

### Why AI-SEO + Technical Link Auditing in One Actor?

Most websites silently block AI search engines in `robots.txt` or ship broken links inside `/llms.txt` and XML sitemaps. For every domain you pass, this Actor checks:

1. **AI Search Readiness (`aiSeo` & `aiReadinessScore`):** Parses `robots.txt` rules across **11 AI crawlers** (`GPTBot`, `OAI-SearchBot`, `ChatGPT-User`, `ClaudeBot`, `anthropic-ai`, `PerplexityBot`, `Google-Extended`, `Applebot-Extended`, `CCBot`, `Bytespider`, `cohere-ai`), validates `/llms.txt` and `/llms-full.txt` (rejecting SPA HTML soft-404s), verifies links inside `llms.txt`, and builds a ready-to-publish **`generatedLlmsTxt`** Markdown file.
2. **Zero-False-Positive Broken Link Checker:** Probes links with `HEAD` first, retries non-2xx responses with a byte-capped `GET` (`Range: bytes=0-4095`), and cleanly separates real dead links (`404`, `410`, `5xx`, DNS/TLS failures) from bot-protected walls (`Cloudflare`, `AWS WAF`, `LinkedIn 999`, `DataDome`).
3. **Sitemap & On-Page SEO Audit:** Expands `/sitemap.xml`, nested `<sitemapindex>`, and `.xml.gz` archives while auditing titles, meta descriptions, canonicals, `H1` tags, `HTTPS`/`HSTS`, OpenGraph, JSON-LD, and missing image `alt` attributes (plus optional Google PageSpeed Core Web Vitals).

### Who Is This For?

- **SEO & GEO (Generative Engine Optimization) Agencies:** Run bulk prospect audits showing which clients block `GPTBot` / `ClaudeBot`, lack `/llms.txt`, or leak link equity to `404` URLs — and hand them a ready-to-upload `llms.txt` file.
- **SaaS Documentation & Content Teams:** Schedule weekly `n8n` or Apify cron checks across marketing sites and `/docs` portals before broken links hurt rankings or break LLM retrieval.
- **B2B Lead Generation (Clay / Make):** Score agency prospects by `brokenLinksCount`, `seoScore`, and `aiReadinessScore` to trigger hyper-specific cold outreach.

### Input

Pass bare domains, root URLs, or documentation subfolder URLs:

```json
{
  "urls": ["anthropic.com", "https://linear.app"],
  "maxPagesPerSite": 5,
  "maxLinksPerSite": 150,
  "checkExternalLinks": true,
  "extractSitemap": true,
  "generateLlmsTxt": true
}
```

| Parameter | Type | Default | Description |
| :--- | :--- | :--- | :--- |
| `urls` *(required)* | `string[]` | `["https://linear.app", "https://cal.com"]` | Domains (`"anthropic.com"`) or full URLs (`"https://linear.app"`). |
| `maxPagesPerSite` | `integer` | `5` | Max internal HTML pages fetched and audited per website (`1–200`). |
| `maxLinksPerSite` | `integer` | `150` | Max unique links checked per website (`0–2000`). Internal links are prioritized first. |
| `checkExternalLinks` | `boolean` | `true` | Verify external outbound links in addition to internal links. |
| `extractSitemap` | `boolean` | `true` | Discover and expand XML, `.xml.gz`, and text sitemaps from `robots.txt` and standard paths. |
| `maxSitemapUrls` | `integer` | `100` | Max sitemap URLs returned in `sitemapUrls` (`0–5000`; full total is always in `sitemapUrlsCount`). |
| `generateLlmsTxt` | `boolean` | `true` | Validate existing `/llms.txt` and generate a clean `llms.txt` Markdown file from discovered pages. |
| `respectRobotsTxt` | `boolean` | `true` | Respect `User-agent: *` `Disallow` directives when crawling internal subpages. |
| `concurrency` | `integer` | `15` | Parallel HTTP worker concurrency (`1–50`). |
| `googlePageSpeedApiKey` | `string` | `""` | Optional Google PageSpeed Insights v5 API key (BYOK) to include live Lighthouse & Core Web Vitals (`LCP`, `CLS`, `TBT`). |
| `pageSpeedStrategy` | `string` | `"mobile"` | `"mobile"` or `"desktop"` when `googlePageSpeedApiKey` is set. |

### Output

Each item is written to the default **Dataset** (`JSON`, `CSV`, `Excel`, `Parquet`), and run totals are saved to `SUMMARY` in the default **Key-Value Store**. Below is an untouched live output record for `"anthropic.com"` (`maxPagesPerSite: 1`, `maxSitemapUrls: 8`):

```json
{
  "input": "anthropic.com",
  "domain": "anthropic.com",
  "rootUrl": "https://www.anthropic.com",
  "finalUrl": "https://www.anthropic.com/",
  "status": "audited",
  "overallScore": 86,
  "seoScore": 97,
  "aiReadinessScore": 60,
  "discoveryMethod": "robots_sitemap",
  "sitemapFound": true,
  "sitemapUrlsCount": 589,
  "sitemapLocations": [
    "https://www.anthropic.com/sitemap.xml"
  ],
  "sitemapUrls": [
    "https://www.anthropic.com/",
    "https://www.anthropic.com/about-anthropic-interviewer",
    "https://www.anthropic.com/ai-for-science-program-rules",
    "https://www.anthropic.com/beneficial-deployments",
    "https://www.anthropic.com/candidate-ai-guidance",
    "https://www.anthropic.com/careers",
    "https://www.anthropic.com/careers/jobs",
    "https://www.anthropic.com/claude-corps"
  ],
  "pagesAudited": 1,
  "linksChecked": 27,
  "brokenLinksCount": 0,
  "botProtectedLinksCount": 0,
  "redirectedLinksCount": 7,
  "brokenLinks": [],
  "aiSeo": {
    "hasRobotsTxt": true,
    "hasLlmsTxt": false,
    "hasLlmsFullTxt": false,
    "llmsTxtUrl": null,
    "llmsTxtValidFormat": false,
    "llmsTxtLinksCount": 0,
    "llmsTxtBrokenLinksCount": 0,
    "aiCrawlersAllowed": [
      "GPTBot",
      "OAI-SearchBot",
      "ChatGPT-User",
      "ClaudeBot",
      "anthropic-ai",
      "PerplexityBot",
      "Google-Extended",
      "Applebot-Extended",
      "CCBot",
      "Bytespider",
      "cohere-ai"
    ],
    "aiCrawlersBlocked": [],
    "aiSearchReady": true
  },
  "rootPage": {
    "url": "https://anthropic.com/",
    "finalUrl": "https://www.anthropic.com/",
    "statusCode": 200,
    "responseTimeMs": 356,
    "htmlBytes": 173179,
    "botProtected": false,
    "title": "Home \\ Anthropic",
    "metaDescription": "Anthropic is an AI safety and research company that's working to build reliable, interpretable, and steerable AI systems.",
    "canonicalUrl": "https://www.anthropic.com/",
    "h1": "AI research and products that put safety at the frontier. AI will have a vast impact on the world. Anthropic is a public benefit corporation dedicated to securing its benefits and mitigating its risks.",
    "h1Count": 1,
    "lang": "en",
    "indexable": true,
    "hasHttps": true,
    "hasHsts": true,
    "hasOpenGraph": true,
    "jsonLdTypes": [],
    "wordCount": 269,
    "imagesTotal": 4,
    "imagesMissingAlt": 4,
    "internalLinksCount": 28,
    "externalLinksCount": 5,
    "brokenLinksOnPage": 0,
    "issues": [
      "images_missing_alt"
    ]
  },
  "issues": [
    {
      "code": "images_missing_alt",
      "severity": "low",
      "message": "One or more content images are missing alt attributes.",
      "affectedCount": 1,
      "sampleUrls": [
        "https://www.anthropic.com/"
      ]
    },
    {
      "code": "missing_llms_txt",
      "severity": "low",
      "message": "No /llms.txt file found to guide LLM search engines and coding/research agents.",
      "affectedCount": 1,
      "sampleUrls": [
        "https://www.anthropic.com/llms.txt"
      ]
    }
  ],
  "auditedPages": [
    {
      "url": "https://anthropic.com/",
      "finalUrl": "https://www.anthropic.com/",
      "statusCode": 200,
      "responseTimeMs": 356,
      "htmlBytes": 173179,
      "botProtected": false,
      "title": "Home \\ Anthropic",
      "metaDescription": "Anthropic is an AI safety and research company that's working to build reliable, interpretable, and steerable AI systems.",
      "canonicalUrl": "https://www.anthropic.com/",
      "h1": "AI research and products that put safety at the frontier. AI will have a vast impact on the world. Anthropic is a public benefit corporation dedicated to securing its benefits and mitigating its risks.",
      "h1Count": 1,
      "lang": "en",
      "indexable": true,
      "hasHttps": true,
      "hasHsts": true,
      "hasOpenGraph": true,
      "jsonLdTypes": [],
      "wordCount": 269,
      "imagesTotal": 4,
      "imagesMissingAlt": 4,
      "internalLinksCount": 28,
      "externalLinksCount": 5,
      "brokenLinksOnPage": 0,
      "issues": [
        "images_missing_alt"
      ]
    }
  ],
  "generatedLlmsTxt": "# Home \\ Anthropic\n\n> Anthropic is an AI safety and research company that's working to build reliable, interpretable, and steerable AI systems.\n\n## Company & Content\n\n- [Careers](https://www.anthropic.com/careers)\n- [Jobs](https://www.anthropic.com/careers/jobs)\n- [Company](https://www.anthropic.com/company)\n- [Leadership](https://www.anthropic.com/company/leadership)\n\n## Key Pages\n\n- [Home \\ Anthropic](https://www.anthropic.com/): Anthropic is an AI safety and research company that's working to build reliable, interpretable, and steerable AI systems.\n- [About Anthropic Interviewer](https://www.anthropic.com/about-anthropic-interviewer)\n- [Ai For Science Program Rules](https://www.anthropic.com/ai-for-science-program-rules)\n- [Beneficial Deployments](https://www.anthropic.com/beneficial-deployments)\n- [Candidate Ai Guidance](https://www.anthropic.com/candidate-ai-guidance)\n- [Claude Corps](https://www.anthropic.com/claude-corps)\n- [Fellow](https://www.anthropic.com/claude-corps/fellow)\n- [Host](https://www.anthropic.com/claude-corps/host)\n- [Claude Fable And Mythos 5 1](https://www.anthropic.com/claude-fable-and-mythos-5-1)\n- [Claude Haiku 5 5](https://www.anthropic.com/claude-haiku-5-5)\n- [Claude Opus 5 5](https://www.anthropic.com/claude-opus-5-5)\n- [Claude Sonnet 5 5](https://www.anthropic.com/claude-sonnet-5-5)\n- [Fable](https://www.anthropic.com/claude/fable)\n- [Haiku](https://www.anthropic.com/claude/haiku)\n- [Mythos](https://www.anthropic.com/claude/mythos)\n- [Opus](https://www.anthropic.com/claude/opus)\n- [Sonnet](https://www.anthropic.com/claude/sonnet)\n- [Constitution](https://www.anthropic.com/constitution)\n- [Coordinated Vulnerability Disclosure](https://www.anthropic.com/coordinated-vulnerability-disclosure)\n- [Economic Futures](https://www.anthropic.com/economic-futures)\n- [Program](https://www.anthropic.com/economic-futures/program)\n",
  "lighthouse": null,
  "error": null,
  "processedAt": "2026-11-04T09:25:00.589Z"
}
```

### Pricing (Pay Per Event)

Invalid URLs and unreachable domains cost **`$0`**. Link checks (`maxLinksPerSite`) are included in the page audit price at `$0` extra.

| Event | Title | Price | Charged When |
| :--- | :--- | :--- | :--- |
| `actor-start` | Actor start | `$0.0005` | Once per run |
| `site-audited` | Audited website | `$0.0030` (`$3.00 / 1,000`) | Target website responds and its `robots.txt`, sitemaps, AI crawler rules, and `llms.txt` are audited |
| `page-audited` | Audited web page | `$0.0010` (`$1.00 / 1,000`) | Each reachable HTML page audited (includes up to `maxLinksPerSite` link checks) |

- **100 websites (5 pages + up to 150 link checks + sitemap + `llms.txt` each):** `~$0.80` total (`~625` multi-page site audits/month covered by Apify's `$5` Free plan credit).
- **1,000 single-page AI-SEO & homepage link audits (`maxPagesPerSite: 1`):** `$4.00` total.
- Respects Apify's **Maximum total charge** cap and stops cleanly when reached.

### API, Clay, n8n & MCP Integration

```bash
curl -X POST "https://api.apify.com/v2/acts/xenikii~broken-link-sitemap-llms-txt-auditor/run-sync-get-dataset-items?token=YOUR_APIFY_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"urls": ["https://linear.app", "anthropic.com"], "maxPagesPerSite": 5}'
```

- **n8n / Make Scheduled Monitoring:** Trigger weekly site health checks and alert Slack whenever `brokenLinksCount > 0` or `aiSearchReady === false`.
- **Clay Agency Prospecting:** Pass `["{{Website}}"]` with `maxPagesPerSite: 1` to personalize outreach around missing `/llms.txt`, blocked AI bots, or broken homepage links.
- **MCP (`mcp.apify.com`):** Works in Claude Desktop, Cursor, and AI coding agents as `xenikii/broken-link-sitemap-llms-txt-auditor`.

### FAQ & Data Compliance

- **Why do other link checkers flag LinkedIn, Cloudflare, or X links as `403`/`999` broken?** Many sites reject `HEAD` requests or challenge automated probes. This Actor retries non-2xx `HEAD` responses with a ranged `GET` and classifies WAF challenges separately under `botProtectedLinksCount` so `brokenLinks` stays clean.
- **Does it respect `robots.txt`?** Yes (`respectRobotsTxt: true` by default) and includes built-in SSRF protection blocking private/internal IP ranges.
- **Data & Privacy Compliance:** Audits publicly accessible web pages, `robots.txt`, sitemaps, and HTTP response headers only — zero personal data or cookies are stored.

### Other B2B Intelligence Actors

Combine these Actors in **Clay**, **n8n**, **Make**, or **MCP** to build a complete B2B signal and SEO stack:

| Actor | Best For | Pricing |
| :--- | :--- | :--- |
| **[Company Domain, Tech Stack & MX/DNS Enricher](https://apify.com/xenikii/company-domain-tech-stack-enricher)** | Resolve company names to domains, 12-category tech stacks, MX/SPF/DMARC & role contacts | `$2.50 / 1k` enriched domains |
| **[B2B Hiring Signals & Multi-ATS Job Scraper](https://apify.com/xenikii/company-career-ats-job-scraper)** | Extract hiring velocity, salary transparency & open roles across 7 ATS platforms | `$1.50 / 1k` job postings |
| **[Google Ads Transparency & Ad Library Scraper](https://apify.com/xenikii/google-ads-transparency-scraper)** | Spy on active Google Search, Display & YouTube creatives, days active & EU reach | `$1.80 / 1k` ad creatives |
| **[Broken Link, Sitemap & AI SEO (`llms.txt`) Auditor](https://apify.com/xenikii/broken-link-sitemap-llms-txt-auditor)** *(This Actor)* | Audit broken links, XML sitemaps, `GPTBot`/`ClaudeBot` rules & generate `llms.txt` | `$3.00 / 1k` audited websites |
| **[Google Trends Breakout & Comparison Scraper](https://apify.com/xenikii/google-trends-scraper)** | Track `+5,000%` breakout queries, multi-keyword share of search & live news trends | `$2.50 / 1k` keyword trend reports |

# Actor input Schema

## `urls` (type: `array`):

List of domains or URLs to audit (e.g. 'linear.app', 'https://cal.com', 'https://cloudflare.com/learning/').

## `maxPagesPerSite` (type: `integer`):

Maximum number of internal HTML pages to fetch and audit per site (discovered via sitemap.xml and internal navigation).

## `maxLinksPerSite` (type: `integer`):

Maximum number of unique internal and external links checked per site using HEAD with automatic GET Range fallback.

## `checkExternalLinks` (type: `boolean`):

Check external links in addition to internal links, separating genuine broken links (404/410/5xx/DNS) from bot-protected walls (Cloudflare/LinkedIn).

## `extractSitemap` (type: `boolean`):

Discover sitemaps from robots.txt and standard paths (/sitemap.xml, /sitemap_index.xml, /wp-sitemap.xml, .xml.gz) and expand nested sitemap indexes.

## `maxSitemapUrls` (type: `integer`):

Cap on sitemap URLs stored in sitemapUrls per site record (total count is always reported in sitemapUrlsCount).

## `generateLlmsTxt` (type: `boolean`):

Inspect existing /llms.txt and /llms-full.txt (including broken link checks inside llms.txt) and generate a clean, ready-to-publish llms.txt Markdown file.

## `respectRobotsTxt` (type: `boolean`):

Respect User-agent: \* Disallow rules in robots.txt when crawling internal subpages.

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

Parallel HTTP worker concurrency across pages and link checks.

## `googlePageSpeedApiKey` (type: `string`):

Optional Google Cloud API key with PageSpeed Insights API enabled to attach live Lighthouse Core Web Vitals scores (Performance, Accessibility, Best Practices, SEO, LCP, CLS, TBT) to each site.

## `pageSpeedStrategy` (type: `string`):

Device strategy passed to Google PageSpeed Insights v5 API when googlePageSpeedApiKey is set.

## Actor input object example

```json
{
  "urls": [
    "https://linear.app",
    "https://cal.com"
  ],
  "maxPagesPerSite": 5,
  "maxLinksPerSite": 150,
  "checkExternalLinks": true,
  "extractSitemap": true,
  "maxSitemapUrls": 100,
  "generateLlmsTxt": true,
  "respectRobotsTxt": true,
  "concurrency": 15,
  "pageSpeedStrategy": "mobile"
}
```

# Actor output Schema

## `results` (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 = {
    "urls": [
        "https://linear.app",
        "https://cal.com"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("xenikii/broken-link-sitemap-llms-txt-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 = { "urls": [
        "https://linear.app",
        "https://cal.com",
    ] }

# Run the Actor and wait for it to finish
run = client.actor("xenikii/broken-link-sitemap-llms-txt-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 '{
  "urls": [
    "https://linear.app",
    "https://cal.com"
  ]
}' |
apify call xenikii/broken-link-sitemap-llms-txt-auditor --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,xenikii/broken-link-sitemap-llms-txt-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/Fqn7vDwbe2CebqaYB/builds/VhkBRh2rKyl2lErY3/openapi.json
