# Website to Markdown Crawler for AI, LLM & RAG (`mastertools/website-markdown-crawler`) Actor

Crawl any website or list of pages into clean, LLM-ready Markdown in seconds: main content only, token counts, RAG chunks and llms.txt. Fast HTTP, a browser only for JavaScript pages.

- **URL**: https://apify.com/mastertools/website-markdown-crawler.md
- **Developed by:** [Master Tools](https://apify.com/mastertools) (community)
- **Categories:** AI, Developer tools, MCP servers
- **Features:** Limited permissions, Single-tenant, Server interface
- **Stats:** 1 total users, 0 monthly users, 0.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $1.50 / 1,000 page as markdowns

This Actor is paid per event and usage. You are charged both the fixed price for specific events and for Apify platform usage.
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

## Website to Markdown Crawler for AI, LLM & RAG

**Turn any website into clean, LLM-ready Markdown in seconds.** Give it a docs site, a blog, a help center or a list of pages — get back one tidy row per page with the main text only: no menus, footers, cookie banners or ads. Token counts, RAG chunks and an `llms.txt` of the site come with it.

A fast, lightweight website content crawler for AI agents, chatbots, knowledge bases and RAG pipelines. Plain HTTP for speed, a real browser only for pages built with JavaScript — the crawler decides by itself.

### What you get

- **Clean Markdown for LLMs** — headings, lists, tables, code blocks with their language and links stay; navigation, headers, footers, sidebars, breadcrumbs, cookie and chat pop-ups, "Copy page" buttons, heading anchors and reference marks go. Fewer tokens, better answers.
- **Fast crawling** — 10 pages in about 3 seconds, a hundred pages from a dozen different sites in about 15. No heavy browser unless a page really needs one.
- **JavaScript sites too** — React, Vue and Angular apps whose HTML is an empty shell are opened in a real browser automatically. Normal pages stay on the fast path.
- **RAG-ready chunks** — switch on chunking and every row is a chunk that follows the page's headings, keeps its heading path (`Guide > Install > Linux`) and fits your token size. Load it straight into Pinecone, Qdrant, Weaviate, Chroma, Milvus or pgvector.
- **Exact token counts** — every page and chunk is counted with the GPT-4o / GPT-5 tokenizer, so you know your context and embedding budget before you spend it.
- **llms.txt for every crawl** — an `llms.txt` index of the crawled pages and an `llms-full.txt` with all of them in one Markdown file, ready for ChatGPT, Claude, Cursor or a project knowledge base.
- **Smart crawl scope** — start at `https://docs.example.com/guide` and it stays inside `/guide`. Add your own include and exclude patterns, read the sitemap, set the depth.
- **No duplicates** — `?utm=` links, `/index.html`, canonical twins and pages with identical text are delivered once.
- **You pay for results** — pages that fail, sites behind a bot check, pages closed by robots.txt and pages without text come back free, with the reason.
- **Instant API for AI agents** — Standby mode returns the Markdown of a page in about a second; works with MCP clients, LangChain and LlamaIndex.

### Use cases

- **Chatbots and support assistants** — feed your help center, docs and FAQ into a RAG chatbot.
- **AI agents** — let an agent read any web page as Markdown in one call.
- **Knowledge bases** — sync documentation into Notion, Confluence, a vector database or a custom GPT.
- **LLM training and fine-tuning data** — clean text of whole sites, without boilerplate.
- **SEO and content teams** — export every article of a site with titles, descriptions, word counts and dates.
- **Competitor and market research** — read product pages, pricing pages and blogs of any site in bulk.

### How to use

1. Press **Start** — the example documentation site works as is.
2. Put your own website or pages into **Start URLs**: full links or domains, one per line, or a whole column from a spreadsheet.
3. Set **Max pages**, and download the Markdown as JSON, CSV or Excel, or send it to your app through the API and integrations.

### Input

| Field | What it does | Default |
|---|---|---|
| `startUrls` | Websites or pages to crawl. Links under the same folder of the same site are followed. | Apify Academy docs |
| `maxPages` | How many pages to deliver in total. | `10` |
| `maxCrawlDepth` | Clicks away from the start pages. `0` reads only the given pages — perfect for a list of known URLs. | `20` |
| `includeUrlPatterns` / `excludeUrlPatterns` | Crawl only, or never crawl, links that match: `https://example.com/blog/*`, `/docs/`, `*/tag/*` or a `/regex/`. | — |
| `useSitemaps` | Also take pages from the site's `sitemap.xml`. | `false` |
| `renderJavaScript` | `auto` — browser only when needed, `never` — HTTP only, `always` — browser for every page. | `auto` |
| `onlyMainContent` | Keep the main text and drop menus, headers, footers and sidebars. | `true` |
| `includeImages` | Keep images as `![alt](link)`. | `false` |
| `removeElementsCssSelector` | Extra CSS selectors to cut, e.g. `.promo, #newsletter`. | — |
| `includeText` / `includeHtml` | Also save plain text and clean semantic HTML. | `false` |
| `splitIntoChunks`, `chunkSize`, `chunkOverlap` | One row per RAG chunk, size and overlap in tokens. | off, `1000`, `100` |
| `respectRobotsTxt` | Follow the site's robots.txt and its crawl delay. Turn off for your own site. | `true` |

Example input:

```json
{
  "startUrls": ["https://docs.python.org/3/tutorial/"],
  "maxPages": 200,
  "excludeUrlPatterns": ["*/genindex*"],
  "splitIntoChunks": true,
  "chunkSize": 800
}
```

### Output

One row per page. Example (Markdown shortened):

```json
{
  "url": "https://docs.apify.com/academy/scraping-basics-javascript/devtools-inspecting",
  "title": "Inspecting web pages with browser DevTools | Academy | Apify Documentation",
  "description": "Lesson about using the browser tools for developers to inspect and manipulate the structure of a website.",
  "markdown": "# Inspecting web pages with browser DevTools\n\n**In this lesson we'll use the browser tools for developers to inspect and manipulate the structure of a website.**\n\nA browser is the most complete tool for navigating websites…",
  "language": "en",
  "wordCount": 1222,
  "tokens": 1802,
  "depth": 1,
  "statusCode": 200,
  "renderedWith": "http",
  "canonicalUrl": "https://docs.apify.com/academy/scraping-basics-javascript/devtools-inspecting",
  "author": null,
  "publishedAt": null,
  "crawledAt": "2026-11-16T21:55:38.298Z",
  "error": null
}
```

With **Split into RAG chunks** on, each row is one chunk:

```json
{
  "url": "https://react.dev/learn",
  "title": "Quick Start – React",
  "description": "The library for web and native user interfaces",
  "chunkIndex": 2,
  "chunkCount": 10,
  "headings": "Quick Start > Displaying data",
  "text": "## Displaying data\n\nJSX lets you put markup into JavaScript. Curly braces let you “escape back” into JavaScript…",
  "tokens": 428,
  "language": "en",
  "crawledAt": "2026-11-16T22:01:12.044Z",
  "error": null
}
```

The run's storage also holds **`llms.txt`** (an index of every crawled page with its description) and **`llms-full.txt`** (all pages in one Markdown file). Links to both are on the run's Output tab.

### For AI agents: instant Markdown API

The Actor runs in Standby mode as a small web server — no run to start, an answer in about a second:

```bash
curl "https://<your-standby-url>/?url=https://docs.python.org/3/tutorial/classes.html&format=markdown" \
  -H "Authorization: Bearer <YOUR_APIFY_TOKEN>"
```

- `format=markdown` returns the Markdown itself; without it you get JSON rows.
- Several `url=` in one request are fine; add `maxPages` and `maxCrawlDepth` for a small crawl.
- `POST /` takes the same JSON as the Actor input.

It also works as a tool in the [Apify MCP server](https://mcp.apify.com) for Claude, Cursor, VS Code and any MCP client.

### Integrations

- **LangChain and LlamaIndex** — load the dataset with the Apify loaders; `markdown` (or `text` in chunk mode) is the page content, the other fields are metadata.
- **Vector databases** — the Apify Pinecone, Qdrant, Weaviate, Chroma and Milvus integrations index the rows after each run.
- **No-code** — Make, Zapier, n8n, Google Sheets, Airtable, Slack and webhooks.
- **API** — run it from Python, JavaScript or any HTTP client and download the dataset in JSON, CSV, Excel or XML.

### Tips

- **Crawl a whole site:** start from the homepage. **One section only:** start from that section, e.g. `https://example.com/blog`.
- **Shops:** product pages often live outside the category folder — add `includeUrlPatterns` like `https://shop.com/products/*`.
- **Big JavaScript sites:** give the run 1 GB of memory — the browser opens pages several times faster.
- **Only known pages:** set `maxCrawlDepth` to `0` and paste the list.

### FAQ

**Which sites can it read?** Any public website: documentation (Docusaurus, Sphinx, MkDocs, GitBook, Mintlify, VitePress, ReadTheDocs), blogs (WordPress, Ghost, Medium, Substack), shops (Shopify, WooCommerce), news sites, wikis, help centers and single-page apps.

**What about sites with bot protection?** A site that shows an "are you human" check is skipped politely with a clear message, and that row is free.

**Is it a Website Content Crawler alternative?** Yes — the same job of crawling sites into Markdown for AI, built to be faster and lighter, with token counts, RAG chunks and llms.txt included.

**Does it log in?** No, it reads public pages.

### Need data at scale?

Millions of pages, a scheduled sync of your knowledge base into a vector database, a pipeline into your CRM, warehouse or chatbot — ask us about a turnkey setup.

# Actor input Schema

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

Websites or pages to turn into Markdown: full links, domains or a column pasted from a spreadsheet. The crawler follows links that stay on the same site and under the same folder: https://docs.example.com/guide crawls /guide and the pages below it.

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

How many pages to deliver in total. Duplicates, failed pages and pages without text do not count.

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

How many clicks away from the start pages to go. 0 = only the start pages themselves (fastest for a list of known URLs).

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

Crawl only links that match one of these. Use \* as a wildcard (https://example.com/blog/\*), plain text (/docs/) or a /regex/. When empty, the folder of the start URL is used.

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

Never crawl links that match one of these, for example */tag/* or ?page=. Wildcards, plain text and /regex/ work.

## `useSitemaps` (type: `boolean`):

Also take pages from the site's sitemap.xml: finds pages that no menu links to. Pages still have to match the folder and patterns above.

## `renderJavaScript` (type: `string`):

auto (recommended): plain fast HTTP, and a real browser only for pages built by JavaScript (React, Vue, Angular apps). never: HTTP only, the fastest. always: browser for every page.

## `onlyMainContent` (type: `boolean`):

Keep the article, docs page or product text and drop menus, headers, footers, sidebars, breadcrumbs, share buttons and comments. Turn off to convert the whole page.

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

Keep images as ![alt](link) in the Markdown. Off by default: LLMs read text, and images cost tokens.

## `removeElementsCssSelector` (type: `string`):

Extra CSS selectors to cut from every page, comma-separated, for example .promo, #newsletter, .related-articles.

## `includeText` (type: `boolean`):

Add a text column: the same content without Markdown syntax.

## `includeHtml` (type: `boolean`):

Add an html column: the main content as clean semantic HTML, without scripts and styles.

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

Skip pages the site's robots.txt closes to robots and keep its crawl delay. Turn off only for your own website.

## `splitIntoChunks` (type: `boolean`):

One row per chunk instead of one row per page — ready for Pinecone, Qdrant, Weaviate, Chroma or any vector database. Chunks follow headings and keep their heading path.

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

Maximum tokens per chunk (GPT-4o / GPT-5 tokenizer). 500–1,000 suits most embedding models.

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

How many tokens of the previous chunk's last paragraphs to repeat at the start of the next one.

## Actor input object example

```json
{
  "startUrls": [
    "https://docs.apify.com/academy/scraping-basics-javascript"
  ],
  "maxPages": 10,
  "maxCrawlDepth": 20,
  "includeUrlPatterns": [],
  "excludeUrlPatterns": [],
  "useSitemaps": false,
  "renderJavaScript": "auto",
  "onlyMainContent": true,
  "includeImages": false,
  "removeElementsCssSelector": "",
  "includeText": false,
  "includeHtml": false,
  "respectRobotsTxt": true,
  "splitIntoChunks": false,
  "chunkSize": 1000,
  "chunkOverlap": 100
}
```

# Actor output Schema

## `pages` (type: `string`):

Every page: URL, title, description, clean Markdown, language, words and tokens.

## `llmsTxt` (type: `string`):

Index of the crawled pages in the llms.txt format for AI assistants.

## `llmsFullTxt` (type: `string`):

All crawled pages as one Markdown file — paste it into ChatGPT, Claude or a project knowledge base.

# 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/scraping-basics-javascript"
    ],
    "maxPages": 10
};

// Run the Actor and wait for it to finish
const run = await client.actor("mastertools/website-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/scraping-basics-javascript"],
    "maxPages": 10,
}

# Run the Actor and wait for it to finish
run = client.actor("mastertools/website-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/scraping-basics-javascript"
  ],
  "maxPages": 10
}' |
apify call mastertools/website-markdown-crawler --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,mastertools/website-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/Qis5m6dmYZzmThXzf/builds/0zZnxLiHtKH2VwriX/openapi.json
