# Crawl documentation into RAG chunks

**Use case:** 

Turn a documentation site into clean Markdown and heading-aware chunks ready for your vector database. Example: Apify Academy docs, 50 pages, incremental re-crawls.

## Input

```json
{
  "startUrls": [
    {
      "url": "https://docs.apify.com/academy"
    }
  ],
  "maxItems": 50,
  "maxDepth": 2,
  "maxChunkChars": 1200,
  "incremental": false,
  "includeUnchanged": false,
  "sameDomainOnly": true,
  "stateKey": "default"
}
```

## Output

```json
{
  "url": {
    "label": "Url",
    "format": "link"
  },
  "title": {
    "label": "Title",
    "format": "text"
  },
  "status": {
    "label": "Status",
    "format": "text"
  },
  "chunkCount": {
    "label": "ChunkCount",
    "format": "number"
  },
  "crawledAt": {
    "label": "CrawledAt",
    "format": "date"
  }
}
```

## How it works

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

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

### 2. Start the "Crawl documentation into RAG chunks" task

The Website to Markdown Crawler for RAG Actor will start running based on the input automatically. You can also change all the input fields, like start urls, max pages, and more, to match your specific use case.

### 3. Receive the "Crawl documentation into RAG chunks" 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 url, title, status, 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 into RAG chunks" task via API](https://apify.com/cardine-labs/md-crawler-rag.md).

## FAQ

### How much will this cost?

Each processed page costs $0.0005, so this 50-page example costs about $0.03. The page limit is a hard cap, so the crawl can't go over it.

### How do I keep my vector database up to date?

Schedule the task. With incremental mode on, later runs return only new and changed pages, so you only re-embed what changed.

### Can I use it on my own docs?

Yes. Replace the start URL with your documentation site and adjust Max pages.

### Does it work on JavaScript-heavy sites?

Not yet. It reads static HTML, which covers most documentation generators (Docusaurus, Sphinx, MkDocs, GitBook exports).

## About this Actor

This example demonstrates how to use [Website to Markdown Crawler for RAG](https://apify.com/cardine-labs/md-crawler-rag.md) with a specific input configuration. Visit the [Actor detail page](https://apify.com/cardine-labs/md-crawler-rag.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/cardine-labs/md-crawler-rag.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`).
