# Crawl Documentation to Markdown for RAG and LLMs

**Use case:** 

Point it at a docs site and get every page as clean Markdown, ready for a RAG index or an LLM prompt. Main content only, with headings, tables and code blocks kept. Each page also comes in token-sized chunks with its heading path, plus word and token counts. Uses sitemaps, stays inside the start path, and can skip pages that did not change since the last run.

## Input

```json
{
  "urls": [
    "https://en.wikipedia.org/wiki/Retrieval-augmented_generation"
  ],
  "startUrls": [
    {
      "url": "https://crawlee.dev/js/docs/quick-start"
    }
  ],
  "maxPages": 10,
  "maxCrawlDepth": 2,
  "useSitemaps": true,
  "stayInsideStartPath": true,
  "includeSubdomains": false,
  "renderJs": "auto",
  "jsWaitSecs": 8,
  "chunkSize": 512,
  "chunkOverlap": 64,
  "includeImages": true,
  "includeLinksInMarkdown": true,
  "includeLinkList": false,
  "handlePdfs": true,
  "respectRobotsTxt": true,
  "skipDuplicateContent": true,
  "onlyChanged": false,
  "stateName": "default",
  "maxConcurrency": 10,
  "maxConcurrencyPerSite": 4,
  "requestTimeoutSecs": 30,
  "maxRetries": 2,
  "autoProxyFallback": true,
  "allowResidentialFallback": false
}
```

## Output

```json
{
  "status": {
    "label": "Status"
  },
  "url": {
    "label": "URL",
    "format": "link"
  },
  "title": {
    "label": "Title"
  },
  "language": {
    "label": "Language"
  },
  "publishedAt": {
    "label": "Published",
    "format": "date"
  },
  "wordCount": {
    "label": "Words",
    "format": "number"
  },
  "tokenCount": {
    "label": "Tokens",
    "format": "number"
  },
  "fetchedWith": {
    "label": "Fetched with"
  },
  "markdown": {
    "label": "Markdown"
  },
  "error": {
    "label": "Error"
  }
}
```

## How it works

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

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

### 2. Start the "Crawl Documentation to Markdown for RAG and LLMs" task

The Website Content Crawler to Markdown for AI, LLM & RAG Actor will start running based on the input automatically. You can also change all the input fields, like page urls (no crawling), start urls (crawl the site), and more, to match your specific use case.

### 3. Receive the "Crawl Documentation to Markdown for RAG and LLMs" 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 status, URL, title, 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 "Crawl Documentation to Markdown for RAG and LLMs" task via API](https://apify.com/dottti/web-to-markdown.md).

## FAQ

### What output fields does this task provide?

The task provides output fields including status, URL, title, language, published date, word count, token count, fetch method, Markdown content, and any errors encountered.

### What kind of content does the Markdown include?

The Markdown output includes the main content with headings, tables, code blocks, links, and omits menus, footers, and popups.

### How does this task handle updates to pages?

The task can skip URLs that have not changed since the last run and can be set to monitor for new or changed pages.

### Can this task be scheduled to run automatically?

This task can be scheduled to run automatically in the Apify Console.

### What formats does the task support for extracting data?

The task supports extracting data from web pages and PDFs, converting them into clean Markdown format.

## About this Actor

This example demonstrates how to use [Website Content Crawler to Markdown for AI, LLM & RAG](https://apify.com/dottti/web-to-markdown.md) with a specific input configuration. Visit the [Actor detail page](https://apify.com/dottti/web-to-markdown.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/dottti/web-to-markdown.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`).
