# Sitemap.xml Website to Clean Markdown Crawler

**Use case:** 

Automatically parse sitemap.xml and nested sitemap indexes on any public website, filter target paths with includeUrlPatterns and excludeUrlPatterns globs, and convert pages into clean GitHub-Flavored Markdown with metadata, word counts, and token estimates at 256MB RAM. $0 start, $0.001/page.

## Input

```json
{
  "startUrls": [
    "https://docs.python.org/3/tutorial/introduction.html"
  ],
  "discoverLlmsTxt": false,
  "discoverSitemap": true,
  "crawlLinks": true,
  "samePathPrefixOnly": true,
  "includeUrlPatterns": [
    "/3/tutorial/*"
  ],
  "excludeUrlPatterns": [],
  "maxPages": 10,
  "maxDepth": 1,
  "mainContentOnly": true,
  "includeChunks": true,
  "chunkMaxChars": 1500,
  "chunkMaxTokens": 0,
  "chunkOverlapChars": 200,
  "maxMarkdownChars": 50000,
  "concurrency": 4,
  "requestTimeoutSecs": 12,
  "maxResponseSizeKb": 1024
}
```

## Output

```json
{
  "title": {
    "label": "Title",
    "format": "string"
  },
  "domain": {
    "label": "Domain",
    "format": "string"
  },
  "discoverySource": {
    "label": "Discovery Source",
    "format": "string"
  },
  "depth": {
    "label": "Depth",
    "format": "integer"
  },
  "contentFormat": {
    "label": "Format",
    "format": "string"
  },
  "wordCount": {
    "label": "Words",
    "format": "integer"
  },
  "estimatedTokens": {
    "label": "Est. Tokens",
    "format": "integer"
  },
  "chunkCount": {
    "label": "RAG Chunks",
    "format": "integer"
  },
  "headingsCount": {
    "label": "Headings",
    "format": "integer"
  },
  "url": {
    "label": "Page URL",
    "format": "string"
  }
}
```

## How it works

### 1. Sign up on Apify or log in

The Website to Markdown Crawler: Docs, Sitemaps & LLM RAG Actor is ready to run with the inputs already set for "Sitemap.xml Website to Clean Markdown Crawler". [Sign up or log in](https://console.apify.com/create-task-from-example/J2v7jSuOLWJ9cvUAy) and you'll land in Apify Console with a copy of this exact task.

### 2. Start the "Sitemap.xml Website to Clean Markdown Crawler" task

The Website to Markdown Crawler: Docs, Sitemaps & LLM RAG Actor will start running based on the input automatically. You can also change all the input fields, like start urls, discover llms.txt, and more, to match your specific use case.

### 3. Receive the "Sitemap.xml Website to Clean Markdown Crawler" output

Monitor the progress in real time. You will be notified as soon as your dataset is complete and ready for review. Each result includes data such as title, domain, discovery source, and more.

### 4. Integrate into your workflow

The final output is delivered in JSON, CSV, or Excel format, ready to be plugged into your workflow. You can also [run the "Sitemap.xml Website to Clean Markdown Crawler" task via API](https://apify.com/salmon_chaparral/website-markdown-rag-crawler.md).

## FAQ

### How do includeUrlPatterns and excludeUrlPatterns filter pages?

Pass substrings or simple * wildcard globs like /docs/* or /blog/* to restrict crawled URLs during sitemap and link discovery.

### Does this crawler strip navigation menus, footers, and scripts?

Yes. With mainContentOnly enabled, it targets <main> or <article> containers and strips nav, header, footer, aside, script, and style tags.

### Does sitemap-to-Markdown crawling require Playwright or proxies?

No. Crawling runs over pure HTTP at 256MB RAM with manual redirect SSRF guards, per-request timeouts, and streaming byte caps.

## About this Actor

This example demonstrates how to use [Website to Markdown Crawler: Docs, Sitemaps & LLM RAG](https://apify.com/salmon_chaparral/website-markdown-rag-crawler.md) with a specific input configuration. Visit the [Actor detail page](https://apify.com/salmon_chaparral/website-markdown-rag-crawler.md) to learn more, explore other use cases, and run it yourself.


## How to integrate an Actor?

This Task's input is already configured above. Use it as-is rather than inventing a new one.

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 full API examples (JavaScript, Python, CLI, MCP, OpenAPI), see this Task's Actor page: https://apify.com/salmon_chaparral/website-markdown-rag-crawler.md

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`).
