# Web to Markdown & AI Page Distiller — Fast RAG Crawler (`alias_md5/web-markdown-distiller`) Actor

Turn any webpage or full docs site into clean, noise-free Markdown for AI agents and RAG knowledge bases — without monthly SaaS lock-in. Includes site crawling, custom field extraction, and AI search readiness audits from $0.45–$1.00/1k pages ($0 on errors).

- **URL**: https://apify.com/alias_md5/web-markdown-distiller.md
- **Developed by:** [Alias Data Studio](https://apify.com/alias_md5) (community)
- **Categories:** AI, 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.60 / 1,000 web page markdown extracteds

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

## Web to Markdown & AI Page Distiller — Fast RAG Crawler

Convert any public web page or documentation site into **clean, low-token LLM & RAG-ready Markdown**, plain text, structured metadata, custom CSS fields, interactive element maps, and **AI readiness audits** (`llms.txt`, `llms-full.txt`, `robots.txt`, `sitemap.xml`, WebMCP tools) — running comfortably in **128–512 MB RAM** at a fraction of heavy 8 GB crawler costs.

Export every run directly as **JSON, Markdown, CSV, Excel, or XML**, or connect straight to **Claude, Cursor, n8n, LangChain, LlamaIndex, and MCP agents**.

***

### Why Choose Web to Markdown & AI Page Distiller?

| Capability | Web to Markdown & AI Page Distiller | Traditional 8 GB Crawlers |
| --- | --- | --- |
| **Memory footprint** | **128–512 MB RAM** (instant cold start) | 4,096–8,192 MB RAM |
| **Pricing per 1,000 pages** | **$1.00 down to $0.45** (6-tier volume pricing) | High compute + CU burn |
| **Boilerplate pruning** | Strips menus, footers, sidebars & banners automatically | Often ships noisy markup |
| **RAG Markdown fidelity** | Headings, fenced code blocks, GFM tables, lists & links | Varies across targets |
| **AI Agent Extras** | Interactive element map + **WebMCP tool discovery** | Not included |
| **AI SEO / GEO Audits** | Built-in `llms_audit` mode (`llms.txt`, AI bot rules, score) | Not included |
| **Errors & verification pages** | **Always $0** (logged cleanly in `RUN_SUMMARY`) | Often billed in compute time |

***

### Three Production Modes

| Mode | Purpose | Ideal Users |
| --- | --- | --- |
| `urls` | Batch-convert a list of public HTTP(S) URLs into clean Markdown, plain text, rich metadata, optional CSS fields, interactive element maps, and WebMCP tools. | AI engineers, RAG ingestion jobs, research pipelines |
| `crawl` | Same-origin lightweight crawler for docs sites, blogs, and knowledge bases with `maxDepth` (1–5), `maxPages` (1–2,000), include/exclude regex filters, `robots.txt` compliance, and automatic `/llms.txt` + `/sitemap.xml` discovery. | Knowledge base sync, docs search, agent grounding |
| `llms_audit` | Batch AI/RAG readiness audit across domains: checks `robots.txt` AI crawler directives (`GPTBot`, `OAI-SearchBot`, `ClaudeBot`, `PerplexityBot`, `Google-Extended`, `CCBot`), `/llms.txt`, `/llms-full.txt`, `/sitemap.xml`, homepage WebMCP tools, and HTML-to-Markdown token density with a 0–100 score and recommendations. | AI SEO / GEO teams, developer relations, documentation leads |

***

### Pricing (Pay-Per-Event)

You only pay for successfully distilled pages or completed domain audits saved to your dataset. Broken links (404), non-HTML files, oversized assets, disallowed paths, and verification interstitials cost **$0**.

| Apify Plan | `page-markdown-extracted` (Batch URLs / 1k) | `crawl-page-extracted` (Site Crawl / 1k) | `site-ai-audit` (AI Audit / 1k) |
| --- | ---: | ---: | ---: |
| **Free** | $1.00 | $1.20 | $2.00 |
| **Starter (Bronze)** | $0.85 | $1.00 | $1.70 |
| **Scale (Silver)** | $0.70 | $0.85 | $1.40 |
| **Business (Gold)** | $0.60 | $0.70 | $1.20 |
| **Enterprise (Platinum)** | $0.50 | $0.60 | $1.00 |
| **Enterprise (Diamond)** | $0.45 | $0.50 | $0.90 |

***

### Input Examples

#### 1. Batch Web Pages to Markdown (`urls`)

```json
{
  "mode": "urls",
  "urls": [
    "https://example.com",
    "https://docs.python.org/3/tutorial/"
  ],
  "outputFormat": "markdown",
  "removeBoilerplate": true,
  "includeWebMcpTools": true,
  "extractSelectors": {
    "headings": "h1, h2"
  }
}
```

#### 2. Same-Origin Documentation Site Crawl (`crawl`)

```json
{
  "mode": "crawl",
  "startUrls": [
    "https://docs.python.org/3/tutorial/"
  ],
  "maxDepth": 2,
  "maxPages": 40,
  "includeUrlPatterns": [
    "/3/tutorial/"
  ],
  "useSitemapAndLlmsDiscovery": true,
  "respectRobotsTxt": true
}
```

#### 3. Batch Domain AI / RAG Readiness Audit (`llms_audit`)

```json
{
  "mode": "llms_audit",
  "urls": [
    "docs.python.org",
    "example.com"
  ]
}
```

***

### Output Examples

#### Distilled Page Record (`urls` / `crawl`)

```json
{
  "recordType": "page",
  "url": "https://example.com/",
  "finalUrl": "https://example.com/",
  "markdown": "# Example Domain\n\nThis domain is for use in illustrative examples in documents.\n\n[More information...](https://www.iana.org/domains/example)",
  "text": null,
  "metadata": {
    "title": "Example Domain",
    "description": null,
    "canonicalUrl": null,
    "language": "en",
    "author": null,
    "publishedAt": null,
    "wordCount": 21,
    "characterCount": 146,
    "tokenEstimate": 37,
    "statusCode": 200,
    "contentType": "text/html",
    "characterEncoding": "UTF-8",
    "htmlBytes": 1256,
    "markdownBytes": 146,
    "signalRatio": 0.1162,
    "elapsedMs": 64
  },
  "webMcpTools": []
}
```

#### AI Readiness Audit Record (`llms_audit`)

```json
{
  "recordType": "ai_audit",
  "domain": "example.com",
  "origin": "https://example.com",
  "checkedUrl": "https://example.com/",
  "aiReadinessScore": 48,
  "readinessGrade": "D",
  "robotsTxt": {
    "exists": false,
    "statusCode": 404,
    "byteSize": 0,
    "sitemapUrls": [],
    "aiBotPolicies": [
      { "bot": "GPTBot", "allowed": true, "matchedRule": null },
      { "bot": "ClaudeBot", "allowed": true, "matchedRule": null }
    ]
  },
  "llmsTxt": {
    "exists": false,
    "statusCode": 404,
    "byteSize": 0,
    "headingCount": 0,
    "linkCount": 0,
    "tokenEstimate": 0,
    "preview": null
  },
  "sitemap": {
    "exists": false,
    "sitemapUrl": null,
    "statusCode": 404,
    "isSitemapIndex": false,
    "urlCount": 0
  },
  "homepage": {
    "finalUrl": "https://example.com/",
    "statusCode": 200,
    "title": "Example Domain",
    "htmlBytes": 1256,
    "markdownBytes": 146,
    "signalRatio": 0.1162,
    "wordCount": 21,
    "tokenEstimate": 37,
    "webMcpToolCount": 0
  },
  "webMcpTools": [],
  "recommendations": [
    "Publish a valid /robots.txt with explicit Sitemap directives.",
    "Publish an XML sitemap at /sitemap.xml for reliable page discovery.",
    "Add /llms.txt to provide AI agents with a curated Markdown navigation index."
  ],
  "elapsedMs": 142
}
```

#### Run Summary (`RUN_SUMMARY` in Key-Value Store)

Every run writes a concise `RUN_SUMMARY` JSON record containing counts, total words/tokens delivered, budget status, and any zero-cost skipped URLs with query strings redacted:

```json
{
  "mode": "urls",
  "completedAtIso": "2026-11-27T12:00:00.000Z",
  "succeededCount": 2,
  "failedCount": 0,
  "skippedDueToBudgetCount": 0,
  "chargedEventCount": 2,
  "totalWordCount": 1420,
  "totalTokenEstimate": 2180,
  "elapsedMs": 310,
  "failedTargets": []
}
```

***

### Quick Integration (Python, Node.js, n8n & MCP)

#### Python (`apify-client`)

```python
from apify_client import ApifyClient

client = ApifyClient("<YOUR_APIFY_TOKEN>")
run = client.actor("web-markdown-distiller").call(run_input={
    "mode": "urls",
    "urls": ["https://docs.python.org/3/tutorial/"],
    "outputFormat": "markdown",
    "removeBoilerplate": True,
})

for item in client.dataset(run["defaultDatasetId"]).iterate_items():
    print(item["metadata"]["title"], item["metadata"]["tokenEstimate"])
    print(item["markdown"][:400])
```

#### Node.js / TypeScript (`apify-client`)

```js
import { ApifyClient } from "apify-client";

const client = new ApifyClient({ token: process.env.APIFY_TOKEN });
const run = await client.actor("web-markdown-distiller").call({
  mode: "crawl",
  startUrls: ["https://docs.python.org/3/tutorial/"],
  maxDepth: 2,
  maxPages: 25,
});

const { items } = await client.dataset(run.defaultDatasetId).listItems();
console.log(`Distilled ${items.length} pages`);
```

#### n8n & Automation Workflows

1. Add the **Apify** node (or HTTP Request node calling `https://api.apify.com/v2/acts/<ACTOR_ID>/run-sync-get-dataset-items?token=<TOKEN>`).
2. Pass `{ "mode": "urls", "urls": ["{{ $json.url }}"], "outputFormat": "markdown" }`.
3. Pipe `{{ $json.markdown }}` directly into your OpenAI, Anthropic, Pinecone, Qdrant, or Supabase Vector Store node.

#### MCP (Model Context Protocol)

Connect via Apify MCP Server or run locally with stdio MCP tools:

- `distill_urls` — batch public URLs to clean LLM Markdown + metadata + CSS fields
- `crawl_docs_site` — crawl a same-origin documentation site into RAG Markdown
- `audit_site_ai_readiness` — run a structured AI/GEO readiness audit (`llms.txt`, `robots.txt`, `sitemap.xml`, WebMCP)

# Actor input Schema

## `mode` (type: `string`):

Choose batch URL distillation (`urls`), same-origin documentation site crawling (`crawl`), or AI/RAG readiness auditing (`llms_audit`).

## `urls` (type: `array`):

Public HTTP(S) URLs to convert into Markdown (`urls` mode), or domains / homepage URLs to audit (`llms_audit` mode). Duplicates are removed automatically.

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

Starting HTTP(S) URLs for `crawl` mode. If left empty in `crawl` mode, the `urls` list is used automatically.

## `outputFormat` (type: `string`):

Return clean GitHub-Flavored Markdown, plain text, or both in each dataset item.

## `removeBoilerplate` (type: `boolean`):

Automatically focus on primary article/documentation content and strip menus, footers, sidebars, and consent banners for higher LLM signal density.

## `includeImages` (type: `boolean`):

Preserve `![alt](url)` image references in the generated Markdown.

## `includeInteractiveElements` (type: `boolean`):

Attach a compact index of buttons, links, inputs, and controls with stable CSS and XPath locators for AI agent grounding.

## `includeWebMcpTools` (type: `boolean`):

Automatically discover structured WebMCP tool definitions declared on each page.

## `includeLinks` (type: `boolean`):

Attach deduplicated resolved same-origin and outbound links found on each page.

## `extractSelectors` (type: `object`):

Optional dictionary mapping output field names to CSS selectors (for example `{"headings": "h2", "price": ".price"}`).

## `maxMarkdownChars` (type: `integer`):

Upper character budget per distilled page (500–500,000).

## `maxDepth` (type: `integer`):

Maximum link hop depth from `startUrls` in `crawl` mode (1–5).

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

Maximum number of successfully distilled pages to deliver in `crawl` mode (1–2,000).

## `includeUrlPatterns` (type: `array`):

Optional regular expressions that discovered crawl URLs must match (for example `/docs/`).

## `excludeUrlPatterns` (type: `array`):

Optional regular expressions for URLs to skip during crawling (for example `/changelog/` or `\?page=`).

## `useSitemapAndLlmsDiscovery` (type: `boolean`):

Automatically inspect `/llms.txt` and `/sitemap.xml` on target origins to discover documentation pages faster.

## `respectRobotsTxt` (type: `boolean`):

Honor `Disallow` rules declared in the target origin's `/robots.txt` during site crawling.

## `maxConcurrency` (type: `integer`):

Number of concurrent page fetches (1–20).

## `requestTimeoutSeconds` (type: `integer`):

Maximum seconds to wait per page request before skipping cleanly at $0 (5–120).

## `maxResponseMegabytes` (type: `integer`):

Maximum download size per page in megabytes (1–16 MB). Oversized payloads are skipped cleanly at $0.

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

Optional custom network routing configuration. Disabled by default for fastest direct fetching.

## Actor input object example

```json
{
  "mode": "urls",
  "urls": [
    "https://example.com",
    "https://docs.python.org/3/tutorial/"
  ],
  "startUrls": [
    "https://docs.python.org/3/tutorial/"
  ],
  "outputFormat": "markdown",
  "removeBoilerplate": true,
  "includeImages": false,
  "includeInteractiveElements": false,
  "includeWebMcpTools": true,
  "includeLinks": false,
  "extractSelectors": {},
  "maxMarkdownChars": 120000,
  "maxDepth": 2,
  "maxPages": 50,
  "includeUrlPatterns": [],
  "excludeUrlPatterns": [],
  "useSitemapAndLlmsDiscovery": true,
  "respectRobotsTxt": true,
  "maxConcurrency": 5,
  "requestTimeoutSeconds": 20,
  "maxResponseMegabytes": 5,
  "proxyConfiguration": {
    "useApifyProxy": false
  }
}
```

# Actor output Schema

## `dataset` (type: `string`):

No description

## `runSummary` (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 = {
    "urls": [
        "https://example.com",
        "https://docs.python.org/3/tutorial/"
    ],
    "startUrls": [
        "https://docs.python.org/3/tutorial/"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("alias_md5/web-markdown-distiller").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 = {
    "urls": [
        "https://example.com",
        "https://docs.python.org/3/tutorial/",
    ],
    "startUrls": ["https://docs.python.org/3/tutorial/"],
}

# Run the Actor and wait for it to finish
run = client.actor("alias_md5/web-markdown-distiller").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 '{
  "urls": [
    "https://example.com",
    "https://docs.python.org/3/tutorial/"
  ],
  "startUrls": [
    "https://docs.python.org/3/tutorial/"
  ]
}' |
apify call alias_md5/web-markdown-distiller --silent --output-dataset

```

## MCP server setup

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

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/fU3GtHW2PLQKDBkCm/builds/gaLJrb2q7N3qFNeXM/openapi.json
