# Website to Markdown for LLM & RAG: Fast Content Crawler (`datacraft-tools/web-to-markdown`) Actor

Website to clean Markdown for ChatGPT, RAG & vector DBs. Up to 10x faster than browser crawlers (benchmarked), flat $1 per 1,000 pages, free chunking. Sitemaps, robots.txt.

- **URL**: https://apify.com/datacraft-tools/web-to-markdown.md
- **Developed by:** [Datacraft Tools](https://apify.com/datacraft-tools) (community)
- **Categories:** AI, Developer tools, SEO tools
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $1.00 / 1,000 page extracteds

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.

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

## Website to Markdown for LLM & RAG: Fast Content Crawler

Turn any public website into **clean, LLM-ready Markdown**: the main content only, without menus, cookie banners, footers or ads.

### What makes it different

| | **This actor** | Typical browser-based crawler |
|---|---|---|
| Engine | Lightweight HTTP, no headless Chrome | Full headless browser for every page |
| Speed (our benchmark) | **Up to 10x faster** (see below) | Loads JS, CSS, images and fonts for every page |
| Price | **Flat $1 per 1,000 pages** + $0.01 per run | Billed by compute units, hard to predict |
| Chunking for RAG | **Built in; you pay per page, not per chunk** | Usually a separate step |
| Example: 1,000-page docs site | **≈ $1.01** | Depends on memory and runtime |

**In short:** if a site serves its content as HTML (docs, blogs, help centers, news and marketing sites), you get the same clean Markdown much faster and for a predictable price.

### Benchmark

We crawled the same 30 pages with this actor and with a headless Chromium browser (Playwright), both with 5 parallel requests:

| Site | This actor | Headless browser | Speed-up |
|---|---|---|---|
| MDN Web Docs (30 pages) | 1.0 s | 9.5 s | **9.8x** |
| MDN Web Docs, cold start | 3.2 s | 8.1 s | 2.5x |
| Simple static blog (30 pages) | 1.9 s | 3.4 s | 1.8x |
| Heavy news site | finished | browser timed out | – |

The heavier the site (scripts, ads, trackers), the bigger the gap. The actor also needs less memory than a browser, which keeps the price low.

### Features

- **Up to 10x faster than headless-browser crawling.** It uses a pure HTTP crawler with no Chrome, and a flat **per-page price** means no compute-unit surprises.
- **Works with ChatGPT and custom GPTs, LangChain, LlamaIndex and vector databases** (Pinecone, Qdrant, Weaviate, Chroma).
- **Main content extraction.** Boilerplate (navigation, sidebars, footers, comments) is removed; headings, lists, code blocks and tables are kept as Markdown.
- **Built-in chunking.** Set `chunkSize` to get ready-to-embed chunks with overlap. You pay per page, not per chunk.
- **Smart crawling.** Stays on the start domains, follows links up to `maxCrawlDepth`, can discover pages from **sitemap.xml**, and supports include/exclude URL patterns.
- **Polite by default.** Respects robots.txt, deduplicates URLs, skips binary files and lets you set concurrency.
- **Rich metadata.** Title, description, author, publish date, site name, language, word count and crawl depth.

### Use cases

- Build a RAG chatbot over your docs, help center or blog
- Feed company or competitor websites to an LLM for research
- Create training or eval datasets from documentation
- Monitor website content changes (schedule the actor)
- Move a website's content into Notion or Obsidian as Markdown

### Input example

```json
{
  "startUrls": [{ "url": "https://docs.example.com/" }],
  "useSitemap": true,
  "maxPages": 500,
  "includeUrlGlobs": ["https://docs.example.com/*"],
  "chunkSize": 2000,
  "chunkOverlap": 200
}
```

### Output example

```json
{
  "url": "https://docs.example.com/getting-started",
  "title": "Getting started",
  "description": "Install and configure…",
  "language": "en",
  "markdown": "# Getting started\n\nInstall the package…",
  "wordCount": 812,
  "chunkIndex": 0,
  "chunkCount": 3,
  "depth": 1
}
```

### Limits

This crawler doesn't run JavaScript. Pages that render their content only in the browser (some single-page apps) may come back empty. Most docs sites, blogs, news sites, marketing sites and knowledge bases work well. Pages behind a login are not supported.

### Pricing

A small fee per run start plus a fee per **page** extracted, no matter how many chunks a page produces. There are no monthly fees.

# Actor input Schema

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

Pages or websites to extract. The crawler stays on these domains.

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

Maximum number of pages to extract in total.

## `maxCrawlDepth` (type: `integer`):

0 = only the start URLs; 1 = also pages they link to; and so on.

## `useSitemap` (type: `boolean`):

Also discover pages from the site's sitemap (great for docs and blogs).

## `includeUrlGlobs` (type: `array`):

Only crawl URLs matching these glob patterns, e.g. https://example.com/docs/\*

## `excludeUrlGlobs` (type: `array`):

Skip URLs matching these glob patterns, e.g. */tag/* or */login*

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

Markdown (best for LLMs), plain text, or Markdown plus the raw HTML.

## `chunkSize` (type: `integer`):

Split long pages into chunks for embeddings/RAG (e.g. 2000). 0 = one row per page.

## `chunkOverlap` (type: `integer`):

Characters repeated between consecutive chunks.

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

Keep hyperlinks inside the Markdown.

## `includeTables` (type: `boolean`):

Keep tables (as Markdown tables).

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

Skip pages disallowed by the site's robots.txt.

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

Parallel requests (be polite to small sites).

## Actor input object example

```json
{
  "startUrls": [
    {
      "url": "https://docs.apify.com/academy"
    }
  ],
  "maxPages": 50,
  "maxCrawlDepth": 2,
  "useSitemap": false,
  "includeUrlGlobs": [],
  "excludeUrlGlobs": [],
  "outputFormat": "markdown",
  "chunkSize": 0,
  "chunkOverlap": 200,
  "includeLinks": false,
  "includeTables": true,
  "respectRobotsTxt": true,
  "maxConcurrency": 10
}
```

# 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": [
        {
            "url": "https://docs.apify.com/academy"
        }
    ]
};

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

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

```

## MCP server setup

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

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/yHT5rnkh2Caf6ua6e/builds/qKlfypiO0fGDzKDk4/openapi.json
