# Documentation to Clean LLM Markdown Crawler (`litezero/documentation-markdown-crawler`) Actor

Crawl developer documentation sites (Docusaurus, GitBook, Mintlify, ReadMe) and extract clean, token-efficient GitHub-Flavored Markdown for Cursor, Copilot, and RAG.

- **URL**: https://apify.com/litezero/documentation-markdown-crawler.md
- **Developed by:** [LiteZero](https://apify.com/litezero) (community)
- **Categories:** AI, Developer tools, Automation
- **Stats:** 1 total users, 0 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $0.70 / 1,000 item scrapeds

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/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

## 📚 Documentation to Clean LLM Markdown Crawler

Crawl developer documentation sites (Docusaurus, GitBook, Mintlify, ReadMe, Nextra) and convert complex web pages into **token-efficient GitHub-Flavored Markdown**. Automatically strips navigation sidebars, headers, and footers while preserving code snippets, headers, and formatting for **Cursor, Windsurf, Claude Projects, and RAG vector databases**.

***

### 🥊 Why This Actor Beats the Competition

| Feature | This Actor (Pay-Per-Result) | Heavy Browser Crawlers (Playwright) | Standard HTML Scrapers |
|---|---|---|---|
| **Speed** | ⚡ **Fast HTTP Cheerio parsing (<1s/page)** | 3–5 seconds per page | Fast, but returns raw noisy HTML |
| **Token Efficiency** | 🎯 **Strips 85%+ of boilerplate chrome** | Ingests navbars, footers & cookie banners | Ingests scripts, SVGs & layout markup |
| **Code Block Integrity**| ✅ **Preserves language & code syntax** | Often merges code into plain text | Escapes HTML entities improperly |
| **Pricing** | 💰 **$1.00 / 1,000 doc pages** (PPR) | High compute memory costs | Unclear per-result billing |

***

### 🛠️ Step-by-Step: How to Use

#### Method 1: Apify Web Console

1. Enter the root documentation link in **Documentation Start URLs** (e.g. `https://docs.apify.com/academy/apify-scrapers`).
2. Set **Max Pages to Crawl** (e.g. `5`).
3. Click **Start** and download the clean `.md` files or JSON dataset.

#### Method 2: Python SDK

```python
from apify_client import ApifyClient

client = ApifyClient("YOUR_APIFY_TOKEN")
run = client.actor("litezero/documentation-markdown-crawler").call(run_input={
    "startUrls": ["https://docs.apify.com/academy/apify-scrapers"],
    "maxPages": 5,
    "stripNavigation": True
})

for item in client.dataset(run["defaultDatasetId"]).iterate_items():
    print(f"Title: {item['title']} | Tokens: ~{item['tokenEstimate']}")
```

***

### 📥 Input Parameters

| Parameter | Type | Default | Description |
|---|:---:|:---:|---|
| `startUrls` | Array | `["https://docs.apify.com/academy/apify-scrapers"]` | Documentation URLs to crawl and convert. |
| `maxPages` | Integer | `3` | Maximum documentation pages to crawl. |
| `stripNavigation` | Boolean | `true` | Automatically strip sidebars, navigation, and headers. |

***

### 📤 Output Sample JSON

```json
{
  "url": "https://docs.apify.com/academy/apify-scrapers",
  "title": "Apify scrapers | Apify Documentation",
  "markdown": "# Apify scrapers\n\n> Source: https://docs.apify.com/academy/apify-scrapers\n\n## Overview\n\nLearn how to configure Apify scrapers...",
  "wordCount": 850,
  "tokenEstimate": 1105,
  "headings": ["Overview", "Configuration", "Data Delivery"],
  "codeBlocksCount": 4,
  "scrapedAt": "2026-10-03T09:20:00.000Z"
}
```

***

### 💡 Top Commercial Use Cases

1. **AI Coding Assistant Ingestion:** Feed custom API documentation directly into Cursor `.cursorrules` or Windsurf context.
2. **Enterprise RAG Knowledge Bases:** Ingest partner and supplier technical docs into Pinecone, Qdrant, or Weaviate.
3. **Offline Technical Archival:** Convert sprawling web documentation portals into portable Markdown repositories.\n

# Actor input Schema

## `startUrls` (type: `array`):

Documentation URLs or doc roots to crawl and extract into clean Markdown.

## `maxPages` (type: `integer`):

Maximum documentation pages to crawl and convert.

## `stripNavigation` (type: `boolean`):

Automatically remove headers, sidebars, cookie banners, and footers for maximum token efficiency.

## Actor input object example

```json
{
  "startUrls": [
    "https://docs.apify.com/academy/apify-scrapers"
  ],
  "maxPages": 3,
  "stripNavigation": true
}
```

# Actor output Schema

## `results` (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 = {
    "startUrls": [
        "https://docs.apify.com/academy/apify-scrapers"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("litezero/documentation-markdown-crawler").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 = { "startUrls": ["https://docs.apify.com/academy/apify-scrapers"] }

# Run the Actor and wait for it to finish
run = client.actor("litezero/documentation-markdown-crawler").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 '{
  "startUrls": [
    "https://docs.apify.com/academy/apify-scrapers"
  ]
}' |
apify call litezero/documentation-markdown-crawler --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,litezero/documentation-markdown-crawler"
        }
    }
}
```

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/oEYXi6HQu3D2W12Cu/builds/p4hj8J60QPQdqjYpp/openapi.json
