# Website to Markdown Crawler for LLM and RAG (`registrydata/website-markdown-crawler`) Actor

Crawl websites into clean Markdown per page for LLM and RAG pipelines: sitemaps, links, URL globs, main-content extraction, optional chunking and opt-in browser rendering. USD 1 per 1,000 pages, USD 4 more per rendered page.

- **URL**: https://apify.com/registrydata/website-markdown-crawler.md
- **Developed by:** [Registry Data](https://apify.com/registrydata) (community)
- **Categories:** AI, Developer 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 pages

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 Markdown Crawler for LLM and RAG

Turn any website into **clean Markdown, one item per page**, for LLM context, RAG indexes and AI agents. Give it start URLs, sitemaps or a documentation site; it follows same-site links and sitemap entries, strips navigation, banners, comments and widgets, and returns the main content as Markdown with headings, lists, tables, code blocks (with their language) and links, plus the page metadata an index needs: title, description, language, canonical URL, published and modified dates, a content hash. Optional heading-aware chunking returns ready-to-embed pieces.

**Price: $1.00 per 1,000 pages.** Pages rendered in a browser add $4.00 per 1,000. Set a maximum cost per run and the run stops there. Details under [Pricing](#pricing).

It reads pages over plain HTTP, so it is fast and cheap: **$1 per 1,000 pages**. Pages that only exist after JavaScript runs (single-page apps) can be rendered with a browser for an extra **$4 per 1,000 rendered pages**; rendering is off by default.

By default it crawls 10 pages of a sample documentation site, so a first run needs no setup.

### What you get

One item per page (or one per chunk, see Output).

| Field | Meaning |
|---|---|
| `url`, `canonical_url` | Address after redirects and the canonical address the page declares |
| `title`, `description`, `language`, `site_name` | Page metadata |
| `published_at`, `modified_at`, `last_modified` | Dates the page declares, and the HTTP `Last-Modified` (or sitemap `lastmod`) |
| `markdown` | Main content as Markdown |
| `text` | Plain text version (optional) |
| `headings` | Outline: level and text of every heading |
| `word_count`, `char_count`, `content_hash` | Size, and a SHA-1 of the Markdown: equal hashes across runs mean unchanged content |
| `chunks` | Heading-aware pieces for retrieval (optional) |
| `links` | Absolute links on the page (optional) |
| `depth`, `source`, `status_code`, `rendered`, `crawled_at` | How the page was found (`start`, `link` or `sitemap`), its distance from a start URL, HTTP status, whether the browser rendered it, and time |

### Who uses it

- **AI and RAG builders:** index a docs site, help center or knowledge base into a vector store; chunk output carries a heading path and a stable chunk ID.
- **Agents and MCP tools:** fetch a site as Markdown on demand through the Apify API or MCP.
- **Content and SEO teams:** audit titles, descriptions, headings, word counts and duplicate content across a site.
- **Data teams:** snapshot documentation or policy pages and detect changes with `content_hash` and `modified_at`.

### Input

```json
{
  "startUrls": [{ "url": "https://docs.example.com/guide/" }],
  "maxPages": 500,
  "maxDepth": 3,
  "scope": "path",
  "includeUrlGlobs": ["https://docs.example.com/guide/**"],
  "excludeUrlGlobs": ["**/changelog/**"],
  "outputMode": "chunk",
  "chunkMaxChars": 1500,
  "renderJavaScript": "fallback"
}
```

| Field | Meaning |
|---|---|
| `startUrls`, `sitemapUrls` | Where to start; a bare domain works. Sitemaps in robots.txt and `/sitemap.xml` are used automatically (`useSitemaps`); indexes and `.gz` files work |
| `followLinks`, `maxDepth`, `scope` | Follow links (default on) up to a depth, within the same host (`domain`), domain with subdomains (`subdomains`), or under the start URL path (`path`) |
| `includeUrlGlobs`, `excludeUrlGlobs` | `*` matches within one path segment, `**` across segments, e.g. `https://example.com/docs/**` |
| `maxPages` | Stop after this many pages (default 10). Every page saved is billed |
| `outputMode`, `chunkMarkdown`, `chunkMaxChars`, `chunkMinChars`, `chunkHeadingLevel`, `chunkOverlapChars` | One item per page, or per chunk. Chunks break at headings first, then between paragraphs, and never inside a code block or table |
| `includeText`, `includeLinksInMarkdown`, `includeImages`, `includeLinkList` | Optional output parts |
| `renderJavaScript` | `never` (default), `fallback` (only pages that are empty without it) or `always` |
| `renderWaitMs`, `maxRenderConcurrency` | Extra wait after load for scripts (default 1500 ms) and browser pages at once (default 3) |
| `maxConcurrency`, `requestDelayMs` | Pages in parallel (default 10) and the minimum gap per host (default 250 ms; a robots.txt `Crawl-delay` raises it) |
| `minWords` | Pages with fewer words of main content count as empty and are not billed |

### Output sample

Real item from a run on one start URL (`books.toscrape.com`, `maxDepth` 0), every field as the Actor returns it:

```json
{
  "url": "https://books.toscrape.com/catalogue/a-light-in-the-attic_1000/index.html",
  "canonical_url": null,
  "title": "A Light in the Attic | Books to Scrape - Sandbox",
  "description": "It's hard to imagine a world without A Light in the Attic. This now-classic collection of poetry and drawings from Shel Silverstein celebrates its 20th anniversary with this special edition. Silverstein's humorous and creative verse can amuse the dowdiest of readers. Lemon-faced adults and fidgety kids sit still and read these rhythmic words and laugh and smile and love th It's hard to imagine a world without A Light in the Attic. This now-classic collection of poetry and drawings from Shel Silverstein celebrates its 20th anniversary with this special edition. Silverstein's humorous and creative verse can amuse the dowdiest of readers. Lemon-faced adults and fidgety kids sit still and read these rhythmic words and laugh and smile and love that Silverstein. Need proof of his genius? RockabyeRockabye baby, in the treetopDon't you know a treetopIs no safe place to rock?And who put you up there,And your cradle, too?Baby, I think someone down here'sGot it in for you. Shel, you never sounded so good. ...more",
  "language": "en-us",
  "published_at": null,
  "modified_at": null,
  "last_modified": "Wed, 08 Feb 2023 21:02:32 GMT",
  "site_name": null,
  "status_code": 200,
  "depth": 0,
  "source": "start",
  "rendered": false,
  "word_count": 241,
  "content_hash": "75b7adee929c377001c0849e2874ba47df199a09",
  "crawled_at": "2026-11-22T09:40:02+00:00",
  "markdown": "# A Light in the Attic\n\n£51.77\n\nIn stock (22 available)\n\n---\n\n**Warning!** This is a demo website for web scraping purposes. Prices and ratings here were randomly assigned and have no real meaning.\n\n## Product Description\n\nIt's hard to imagine a world without A Light in the Attic. This now-classic collection of poetry and drawings from Shel Silverstein celebrates its 20th anniversary with this special edition. Silverstein's humorous and creative verse can amuse the dowdiest of readers. Lemon-faced adults and fidgety kids sit still and read these rhythmic words and laugh and smile and love th It's hard to imagine a world without A Light in the Attic. This now-classic collection of poetry and drawings from Shel Silverstein celebrates its 20th anniversary with this special edition. Silverstein's humorous and creative verse can amuse the dowdiest of readers. Lemon-faced adults and fidgety kids sit still and read these rhythmic words and laugh and smile and love that Silverstein. Need proof of his genius? RockabyeRockabye baby, in the treetopDon't you know a treetopIs no safe place to rock?And who put you up there,And your cradle, too?Baby, I think someone down here'sGot it in for you. Shel, you never sounded so good. ...more\n\n## Product Information\n\n| UPC | a897fe39b1053632 |\n| --- | --- |\n| Product Type | Books |\n| Price (excl. tax) | £51.77 |\n| Price (incl. tax) | £51.77 |\n| Tax | £0.00 |\n| Availability | In stock (22 available) |\n| Number of reviews | 0 |\n",
  "char_count": 1479,
  "headings": [
    {
      "level": 1,
      "text": "A Light in the Attic"
    },
    {
      "level": 2,
      "text": "Product Description"
    },
    {
      "level": 2,
      "text": "Product Information"
    }
  ]
}
```

Chunk output mode returns one item per chunk instead (a real item):

```json
{
  "url": "https://books.toscrape.com/catalogue/a-light-in-the-attic_1000/index.html",
  "canonical_url": null,
  "title": "A Light in the Attic | Books to Scrape - Sandbox",
  "description": "It's hard to imagine a world without A Light in the Attic. This now-classic collection of poetry and drawings from Shel Silverstein celebrates its 20th anniversary with this special edition. Silverstein's humorous and creative verse can amuse the dowdiest of readers. Lemon-faced adults and fidgety kids sit still and read these rhythmic words and laugh and smile and love th It's hard to imagine a world without A Light in the Attic. This now-classic collection of poetry and drawings from Shel Silverstein celebrates its 20th anniversary with this special edition. Silverstein's humorous and creative verse can amuse the dowdiest of readers. Lemon-faced adults and fidgety kids sit still and read these rhythmic words and laugh and smile and love that Silverstein. Need proof of his genius? RockabyeRockabye baby, in the treetopDon't you know a treetopIs no safe place to rock?And who put you up there,And your cradle, too?Baby, I think someone down here'sGot it in for you. Shel, you never sounded so good. ...more",
  "language": "en-us",
  "published_at": null,
  "modified_at": null,
  "last_modified": "Wed, 08 Feb 2023 21:02:32 GMT",
  "site_name": null,
  "status_code": 200,
  "depth": 0,
  "source": "start",
  "rendered": false,
  "word_count": 241,
  "content_hash": "75b7adee929c377001c0849e2874ba47df199a09",
  "crawled_at": "2026-11-22T09:39:37+00:00",
  "chunk_index": 1,
  "chunk_count": 4,
  "heading_path": [
    "A Light in the Attic",
    "Product Description"
  ],
  "markdown": "## Product Description\n\nIt's hard to imagine a world without A Light in the Attic. This now-classic collection of poetry and drawings from Shel Silverstein celebrates its 20th anniversary with this special edition. Silverstein's humorous and creative verse can amuse the dowdiest of readers. Lemon-faced adults and fidgety kids sit still and read these rhythmic words and laugh and smile and love th It's hard to imagine a world without A Light in the Attic. This now-classic collection of poetry and drawings from Shel Silverstein celebrates its 20th anniversary with this special edition.",
  "char_count": 590,
  "chunk_id": "75b7adee929c3770:1"
}
```

### Pricing

Pay per page: **$1.00 per 1,000 pages saved** ($0.001 per page). A page that needed the browser costs **$0.004 more** (the `rendered-page` event), so a rendered page is $0.005. A default run (10 pages) costs one cent. Chunk output is billed per page, not per chunk. Pages that fail, are blocked by robots.txt, return an error, are not HTML, are duplicates or have no content are **never billed**. `maxPages` caps the cost of any run.

### How good is the extraction?

We measured word recall and precision of the Markdown against the main content region of 10 pages of different kinds (documentation, blog, news, e-commerce, repository README, reference docs, and a client-rendered app), next to the Apify Website Content Crawler and two open-source extractors. Over HTTP only this Actor scored F1 0.88 (recall 0.86, precision 1.00, boilerplate leakage 0.1%) against 0.82 for Website Content Crawler's HTTP crawler; with rendering on, 0.98 against 0.85 for its browser-adaptive mode. It kept 45 of 45 code blocks (the other tools 19 to 32) and 4 of 5 tables (Website Content Crawler's HTTP mode kept 5 of 5). On five further documentation, government and essay pages that the extractor was not tuned on, it scored F1 0.98 against 0.98 for the best open-source extractor and 0.77 for Website Content Crawler. The method, the pages and the caveats are in the project report.

### Limits and honest notes

- **robots.txt is always honored** (RFC 9309: longest matching rule wins, `*` and `$` patterns), including `Crawl-delay` with fractional values (a delay over 30 seconds makes the site not crawlable), and the crawler identifies itself as `MarkdownCrawler/1.0 (+Apify Actor; honors robots.txt)`. Pages disallowed by robots.txt are skipped, not billed. It does not log in, solve CAPTCHAs or evade blocks: a site that answers 401, 403 or 429 gives no page.
- **Public addresses only.** Addresses that resolve to private, loopback or link-local networks are refused, at every redirect, and so are hosts written in octal, hexadecimal, short or integer forms (`0177.0.0.1`, `127.1`) and names that cannot be resolved. With rendering on, every page navigation (including scripts and meta refresh) is checked against robots.txt and your crawl scope, and a page that tries to leave them is not saved or billed.
- **Over HTTP, pages built by JavaScript are empty.** They are reported as `empty_content` (not billed) unless rendering is on. Rendering is slower and costs more.
- **Main-content extraction is heuristic.** It finds the main content using page landmarks and text density; unusual layouts can include a stray sidebar or lose a section. The Markdown always keeps the headings and structure it finds.
- **Page size cap:** responses over 5 MB are skipped. File types such as PDF, images and archives are not crawled.
- **Dates** are as the page declares them, not normalized.
- Crawling a site is your responsibility: check its terms and robots policy, and respect copyright of the content you collect.

### FAQ

**Can it crawl my whole site?** Yes: set `maxPages` high, keep `useSitemaps` on and set `scope` and globs. Pages are fetched at most four per second per site by default.

**How do I keep an index fresh?** Schedule runs, store `content_hash` per URL, and re-embed only pages whose hash changed. Pages unchanged since the last run still cost the page fee, so crawl only the sections that change.

**Can I use it through the API or an AI agent?** Yes, like any Apify Actor: start it with the Apify API, client libraries or MCP, then read the dataset.

# Actor input Schema

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

Pages to start from. A bare domain such as example.com is accepted.

## `sitemapUrls` (type: `array`):

Optional sitemap.xml addresses (indexes and .gz files work). Sitemaps listed in robots.txt and /sitemap.xml are used automatically when "Use sitemaps" is on.

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

Also crawl pages listed in the site sitemaps (they follow the pages linked from the start URLs).

## `followLinks` (type: `boolean`):

Follow links found on each page, within the scope below. Turn off to read only the start URLs and sitemap pages.

## `scope` (type: `string`):

Which links may be followed.

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

Only crawl URLs matching one of these patterns. \* matches within one path segment, \*\* across segments, for example https://example.com/docs/\*\*.

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

Skip URLs matching one of these patterns, for example **/changelog/**.

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

Stop after this many pages. Every page saved is billed, so this caps your cost. Failed, blocked and empty pages are never billed.

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

How many links away from a start URL to go. 0 reads only the start URLs (and sitemap pages).

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

Pages fetched at once across all hosts. A single host is still requested politely (see the delay).

## `requestDelayMs` (type: `integer`):

Minimum time between requests to one host. A robots.txt Crawl-delay raises it. robots.txt is always honored.

## `outputMode` (type: `string`):

Chunk mode splits every page and returns one item per chunk. Billing is per page either way.

## `chunkMarkdown` (type: `boolean`):

In page mode, also include a chunks list in every item.

## `chunkMaxChars` (type: `integer`):

Largest chunk. Chunks break at headings first, then between paragraphs, never inside a code block or table.

## `chunkMinChars` (type: `integer`):

Sections shorter than this are joined to the previous chunk when they fit.

## `chunkHeadingLevel` (type: `integer`):

A new chunk starts at every heading of this level or higher (3 means #, ## and ###).

## `chunkOverlapChars` (type: `integer`):

Text repeated from the end of the previous piece when a section is split.

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

Add a plain-text version of each page.

## `includeLinksInMarkdown` (type: `boolean`):

Write links as [text](url). Turn off for text only.

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

Write images as ![alt](url).

## `includeLinkList` (type: `boolean`):

Add the absolute links found on each page.

## `minWords` (type: `integer`):

Pages with fewer words of main content are treated as empty and not billed.

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

Pages that build their content with JavaScript need the browser. Every page it renders is billed with an extra "rendered page" event.

## `renderWaitMs` (type: `integer`):

Extra time for scripts to finish before the page is read.

## `maxRenderConcurrency` (type: `integer`):

Pages rendered at once.

## Actor input object example

```json
{
  "startUrls": [
    {
      "url": "https://docs.python.org/3/tutorial/introduction.html"
    }
  ],
  "sitemapUrls": [],
  "useSitemaps": true,
  "followLinks": true,
  "scope": "domain",
  "includeUrlGlobs": [],
  "excludeUrlGlobs": [],
  "maxPages": 10,
  "maxDepth": 2,
  "maxConcurrency": 10,
  "requestDelayMs": 250,
  "outputMode": "page",
  "chunkMarkdown": false,
  "chunkMaxChars": 1500,
  "chunkMinChars": 150,
  "chunkHeadingLevel": 3,
  "chunkOverlapChars": 0,
  "includeText": false,
  "includeLinksInMarkdown": true,
  "includeImages": false,
  "includeLinkList": false,
  "minWords": 5,
  "renderJavaScript": "never",
  "renderWaitMs": 1500,
  "maxRenderConcurrency": 3
}
```

# 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.python.org/3/tutorial/introduction.html"
        }
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("registrydata/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": [{ "url": "https://docs.python.org/3/tutorial/introduction.html" }] }

# Run the Actor and wait for it to finish
run = client.actor("registrydata/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": [
    {
      "url": "https://docs.python.org/3/tutorial/introduction.html"
    }
  ]
}' |
apify call registrydata/website-markdown-crawler --silent --output-dataset

```

## MCP server setup

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