# Website Content & Markdown Scraper (llms.txt) | 2Space (`2space/llms-sitemap-rag-mcp`) Actor

High-speed website content scraper and Markdown crawler for AI, ChatGPT, and RAG. Scrapes /llms.txt and XML sitemaps first, strips boilerplate, and outputs clean Markdown and RAG chunks.

- **URL**: https://apify.com/2space/llms-sitemap-rag-mcp.md
- **Developed by:** [2Space Group](https://apify.com/2space) (community)
- **Categories:** AI, MCP servers, Developer tools
- **Features:** Limited permissions
- **Stats:** 1 total users, 0 monthly users, 0.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $0.20 / 1,000 pages markdown extracted

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.
Since this Actor supports Apify Store discounts, the price gets lower the higher subscription plan you have.

Learn more: https://docs.apify.com/actors/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

> **Built by 2Space Group** — Fast, lightweight AI & B2B data Actors on Apify. Zero browser bloat, predictable Pay-Per-Event pricing, and 1-step MCP support for ChatGPT, Claude Code, Cursor, Antigravity & n8n.

### What does Sitemap & llms.txt Precision AI Docs Crawler do?

**Sitemap & llms.txt Precision AI Docs Crawler** (`reminiscent_medaka/llms-sitemap-rag-mcp`) is a fast, zero-LLM-cost **website content crawler**, **markdown scraper for AI**, **RAG web scraper**, **llms.txt & sitemap extractor**, and **ChatGPT knowledge crawler**. Instead of wasting compute on heavy headless browsers that scrape noisy navigation menus, it probes `/llms.txt`, `/llms-full.txt`, `robots.txt`, and XML sitemaps first, prioritizes high-signal sections (`docs`, `api`, `pricing`, `changelog`), strips HTML boilerplate, and outputs clean Markdown with optional heading-aligned RAG chunks and SHA-256 content hashes.

***

### Features

- **Native `/llms.txt` & `/llms-full.txt` Discovery**: Probes AI-curated Markdown endpoints first (with HTML soft-404 rejection) before falling back to `robots.txt` and nested `<sitemapindex>` XML files.
- **Zero Browser Overhead & Zero LLM Keys**: Pure HTTP `fetch` and `CheerioCrawler` keep memory footprint low (128–256 MB) and deliver up to 10x faster extraction than Playwright-based crawlers.
- **Deterministic Section Scoring & Filtering**: Ranks discovered URLs by `prioritySections` (`docs`, `api`, `pricing`, `changelog`, `about`, `security`, `blog`) and filters with `includePathPatterns` / `excludePathPatterns`.
- **Incremental RAG Deduplication**: Every item includes `wordCount`, `tokenEstimate`, `headings`, `lastModified`, and a SHA-256 `contentHash` so your vector database only re-embeds changed pages.
- **Optional RAG Chunking & Domain Bundles**: Toggle `emitRagChunks` for heading-aligned chunks (`chunkMaxTokens`) or `compileBundle` to write a consolidated `LLMS_BUNDLE_<domain>.md` to Key-Value Store.
- **Anti-1-Star Cost Protection (No Data, No Charge)**: Thin pages under `minWordCount` and failed requests are never charged. Hard `maxPagesPerDomain`, `maxTokensTotal`, and `maxCostUsd` circuit breakers protect your budget.

***

### What data can this Actor extract?

| Field | Type | Description |
| --- | --- | --- |
| `domain` | `string` | Normalized hostname (e.g. `crawlee.dev`) |
| `url` | `string` | Canonical URL of the extracted page |
| `sourceType` | `string` | Discovery source (`"llms_txt"`, `"sitemap"`, or `"direct"`) |
| `sectionBucket` | `string` | Matched `prioritySections` bucket or `"general"` |
| `title` | `string \| null` | Extracted `<h1>`, frontmatter title, or `<title>` |
| `headings` | `string[]` | Ordered Markdown headings outside fenced code blocks |
| `wordCount` | `integer` | Word count of the cleaned Markdown |
| `tokenEstimate` | `integer` | Estimated LLM tokens (`Math.ceil(markdown.length / 4)`) |
| `markdown` | `string` | Boilerplate-free Markdown ready for AI & RAG pipelines |
| `chunks` | `object[]` | Heading-aligned RAG chunks when `emitRagChunks` is enabled |
| `contentHash` | `string` | SHA-256 hex digest for incremental change detection |
| `lastModified` | `string \| null` | ISO timestamp from sitemap `<lastmod>` or HTTP headers |
| `extractedAt` | `string` | ISO-8601 extraction timestamp |

***

### How much does it cost?

This Actor uses transparent **Pay-Per-Event (PPE)** pricing with strict **No Data, No Charge** enforcement:

- **`page-markdown-extracted`** (`$0.00035` per page): Charged only when a qualifying page (`wordCount >= minWordCount`) is saved to the dataset.
- **`rag-chunks-generated`** *(optional)* (`$0.0002` per 10 chunks): Charged only when `emitRagChunks` is `true`.
- **`llms-bundle-compiled`** *(optional)* (`$0.0005` per bundle): Charged only when `compileBundle` is `true` and at least one page was saved for the domain.

A typical run of 10 documentation pages with chunking disabled costs roughly **$0.0035**.

***

### Input & Output Examples

#### Input Example

```json
{
  "startDomainsOrUrls": ["crawlee.dev"],
  "preferLlmsTxt": true,
  "prioritySections": ["docs", "api", "pricing", "changelog"],
  "maxPagesPerDomain": 10,
  "minWordCount": 50,
  "maxTokensTotal": 200000,
  "maxCostUsd": 0.5,
  "emitRagChunks": false,
  "compileBundle": false
}
```

#### Output Example

You can download the dataset in various formats such as **JSON, HTML, CSV, or Excel** via the Apify Console or API.

```json
{
  "domain": "crawlee.dev",
  "url": "https://crawlee.dev/docs/quick-start",
  "sourceType": "llms_txt",
  "sectionBucket": "docs",
  "title": "Quick Start | Crawlee",
  "headings": ["# Quick Start", "## Installation", "## First Crawler"],
  "wordCount": 420,
  "tokenEstimate": 690,
  "markdown": "# Quick Start\n\n## Installation\n\nInstall Crawlee with npm...",
  "chunks": [],
  "contentHash": "9b71d224bd62f3785d96d46ad3ea3d73319bfbc2890caadae2dff72519673ca7",
  "lastModified": null,
  "extractedAt": "2026-11-30T07:00:00.000Z"
}
```

Key-Value Store artifacts include `RUN_DIAGNOSTICS` (discovery hit rates, token totals, stop reason) and optional `LLMS_BUNDLE_<domain>.md` files.

***

### Connect Permanently to Your AI Agent (1 Step)

Use `reminiscent_medaka/llms-sitemap-rag-mcp` as a live knowledge crawler inside your favorite AI client or workflow builder:

#### ChatGPT

Open **ChatGPT -> Settings -> Apps & Connectors -> Create -> Apify MCP OAuth**, sign in with your Apify account, and attach `reminiscent_medaka/llms-sitemap-rag-mcp` (`https://mcp.apify.com?tools=reminiscent_medaka/llms-sitemap-rag-mcp`).

#### Claude Code

```bash
claude mcp add 2space "https://mcp.apify.com?tools=reminiscent_medaka/llms-sitemap-rag-mcp" -t http
```

#### Cursor / Antigravity

Add the Apify MCP server entry to your `.cursor/mcp.json` or Antigravity MCP config:

```json
{
  "mcpServers": {
    "2space": {
      "url": "https://mcp.apify.com?tools=reminiscent_medaka/llms-sitemap-rag-mcp",
      "headers": {
        "Authorization": "Bearer YOUR_APIFY_TOKEN"
      }
    }
  }
}
```

#### n8n, Make & Zapier

- **n8n**: Import the included [`n8n/competitor-docs-changelog-rag.json`](./n8n/competitor-docs-changelog-rag.json) workflow or use the official **Apify** node to trigger runs and upsert `markdown` + `contentHash` into Pinecone, Qdrant, or Supabase.
- **Make**: Add the **Apify -> Run an Actor** module targeting `reminiscent_medaka/llms-sitemap-rag-mcp`, followed by **Get Dataset Items**.
- **Zapier**: Connect the **Apify** integration (`Run Actor` or `New Dataset Item`) to sync extracted documentation into Notion, Slack, or your knowledge base.

***

### Troubleshooting & Support

- **0 pages saved?** Verify the target domain does not block HTTP requests (`403`/`429`) and lower `minWordCount` if pages are concise. Inspect `RUN_DIAGNOSTICS` in Key-Value Store for exact `llmsTxtFound`, `sitemapsParsed`, and `pagesSkippedMinWords` counts.
- **Need custom selectors or found a bug?** Please open an **Issue** in the **Issues** tab on Apify Store—we actively monitor and ship fixes quickly. See the **API** tab for REST, JavaScript, and Python code snippets.
- **Ethical Data Notice**: Our Actors only extract publicly published documentation, `/llms.txt`, and XML sitemaps. Do not scrape personal data without a lawful basis under GDPR or applicable regulations.

***

### More Tools by 2Space Group

Explore the full suite of fast, zero-bloat AI & B2B Actors on **[2Space Group on Apify](https://apify.com/reminiscent_medaka)**:

- [B2B Domain Enricher](https://apify.com/reminiscent_medaka/b2b-domain-enricher) (`b2b-domain-enricher`)
- [SaaS Pricing Extractor](https://apify.com/reminiscent_medaka/saas-pricing-extractor) (`saas-pricing-extractor`)
- [ATS Career & Jobs API](https://apify.com/reminiscent_medaka/ats-career-jobs-api) (`ats-career-jobs-api`)
- [Shopify Store Intel](https://apify.com/reminiscent_medaka/shopify-store-intel) (`shopify-store-intel`)
- [SEC EDGAR Intelligence](https://apify.com/reminiscent_medaka/sec-edgar-intelligence) (`sec-edgar-intelligence`)
- [Gov Grants & Contracts Radar](https://apify.com/reminiscent_medaka/gov-grants-contracts-radar) (`gov-grants-contracts-radar`)
- [Sitemap & llms.txt Precision AI Docs Crawler](https://apify.com/reminiscent_medaka/llms-sitemap-rag-mcp) (`llms-sitemap-rag-mcp`)
- [Tech Stack, DNS, SSL & WHOIS/RDAP Auditor](https://apify.com/reminiscent_medaka/tech-stack-dns-whois-mcp) (`tech-stack-dns-whois-mcp`)
- [GitHub Repo & Maintainer B2B Signals](https://apify.com/reminiscent_medaka/github-repo-b2b-signals) (`github-repo-b2b-signals`)
- [JSON-LD & AI SEO (GEO) Auditor](https://apify.com/reminiscent_medaka/jsonld-ai-seo-auditor) (`jsonld-ai-seo-auditor`)
- [YouTube Transcript & Metadata MCP](https://apify.com/reminiscent_medaka/youtube-transcript-metadata-mcp) (`youtube-transcript-metadata-mcp`)
- [Google News Article Scraper MCP](https://apify.com/reminiscent_medaka/google-news-article-scraper-mcp) (`google-news-article-scraper-mcp`)
- [Universal Web Extractor MCP](https://apify.com/reminiscent_medaka/universal-web-extractor-mcp) (`universal-web-extractor-mcp`)

# Actor input Schema

## `startDomainsOrUrls` (type: `array`):

List of root domains (e.g. crawlee.dev) or full URLs (e.g. https://plausible.io/docs) to probe via /llms.txt, robots.txt, and XML sitemaps.

## `preferLlmsTxt` (type: `boolean`):

Probe /llms.txt and /llms-full.txt first before falling back to or supplementing with robots.txt and sitemap.xml.

## `prioritySections` (type: `array`):

Ordered list of path segments/topics used to score, prioritize, and classify pages into sectionBucket.

## `includePathPatterns` (type: `array`):

Optional path substrings, globs (e.g. /docs/\*), or regex patterns (/^/v2//). Only matching URLs are kept when non-empty.

## `excludePathPatterns` (type: `array`):

Optional path substrings, globs (e.g. */tag/*), or regex patterns to exclude from crawling.

## `maxPagesPerDomain` (type: `integer`):

Hard cap on saved pages per domain. Prevents runaway crawls on large documentation sites.

## `minWordCount` (type: `integer`):

Minimum extracted Markdown words required to keep and charge a page. Thin pages below this threshold are skipped for free.

## `maxTokensTotal` (type: `integer`):

Global hard circuit breaker on cumulative estimated tokens saved across the entire run.

## `maxCostUsd` (type: `number`):

Pre-charge budget circuit breaker in USD. Execution stops cleanly before exceeding this limit.

## `emitRagChunks` (type: `boolean`):

Split each page's Markdown into heading-aligned RAG chunks capped by chunkMaxTokens.

## `chunkMaxTokens` (type: `integer`):

Maximum estimated tokens per heading-aligned RAG chunk when Emit RAG Chunks is enabled.

## `compileBundle` (type: `boolean`):

Write a consolidated LLMS_BUNDLE\_<domain>.md file to Key-Value Store when at least one qualifying page is extracted for a domain.

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

Optional Apify Proxy or custom proxy configuration for protected documentation hosts. Direct HTTP is used by default.

## Actor input object example

```json
{
  "startDomainsOrUrls": [
    "crawlee.dev"
  ],
  "preferLlmsTxt": true,
  "prioritySections": [
    "docs",
    "api",
    "pricing",
    "changelog",
    "about",
    "security",
    "blog"
  ],
  "includePathPatterns": [],
  "excludePathPatterns": [],
  "maxPagesPerDomain": 10,
  "minWordCount": 50,
  "maxTokensTotal": 200000,
  "maxCostUsd": 0.5,
  "emitRagChunks": false,
  "chunkMaxTokens": 600,
  "compileBundle": false,
  "proxyConfiguration": {
    "useApifyProxy": false
  }
}
```

# Actor output Schema

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

Dataset items containing clean Markdown, token estimates, SHA-256 hashes, and optional RAG chunks.

## `keyValueStore` (type: `string`):

Key-Value Store records including RUN_DIAGNOSTICS and optional LLMS_BUNDLE\_<domain>.md files.

# 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 = {
    "startDomainsOrUrls": [
        "crawlee.dev"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("2space/llms-sitemap-rag-mcp").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 = { "startDomainsOrUrls": ["crawlee.dev"] }

# Run the Actor and wait for it to finish
run = client.actor("2space/llms-sitemap-rag-mcp").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 '{
  "startDomainsOrUrls": [
    "crawlee.dev"
  ]
}' |
apify call 2space/llms-sitemap-rag-mcp --silent --output-dataset

```

## MCP server setup

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

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/oKPT3k6YUbLQYk6Cy/builds/gTfrAgsbHuPqjs26u/openapi.json
