# Website to Markdown Crawler - Pages to Markdown for LLM & RAG (`rel8ble/website-to-markdown-crawler`) Actor

Website to Markdown crawler: page or site URLs in, clean LLM-ready Markdown out, one row per page with title, description, headings, word / token counts, dates and a change hash. Follows links or sitemaps, respects robots.txt. HTTP only. $0.30 / 1,000 pages.

- **URL**: https://apify.com/rel8ble/website-to-markdown-crawler.md
- **Developed by:** [Giovanni Rich](https://apify.com/rel8ble) (community)
- **Categories:** AI, Developer tools, SEO tools
- **Features:** Limited permissions
- **Stats:** 1 total users, 0 monthly users, 0.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

$0.30 / 1,000 results

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/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 - Pages to Markdown for LLM & RAG

**Website to Markdown converter**, **URL to Markdown API** and **website content crawler** in one actor: paste page URLs (one or 50,000) or a site, and get every page as **clean, LLM-ready Markdown** with **title, description, headings, word count, token estimate, language, author, publish / modified dates, canonical URL, Open Graph data** and a **content hash** for change monitoring. Follow links inside a docs section, read the **sitemap.xml**, or fetch only the URLs you list.

Built for **RAG pipelines, vector databases, AI agents, chatbot knowledge bases, LLM fine-tuning, SEO audits and content monitoring**. It is plain HTTP (no headless browser), so it is fast and cheap: **$0.30 per 1,000 pages, no start fee**, and **714 documentation pages in 38 seconds** in a local sitemap test, and the 10-page default input in **4.8 s run time on the Apify cloud** (1 Dec 2026). Failed pages, robots.txt-blocked URLs, PDFs and other non-HTML files are reported for free.

### Sample output

Real rows from the default input (the Apify Academy JavaScript course, crawl depth 1, 10 pages), run on 1 Dec 2026 (`sample-output.json`):

| finalUrl | title | wordCount | estimatedTokens | headings | depth |
|---|---|---|---|---|---|
| docs.apify.com/academy/scraping-basics-javascript | Web scraping basics for JavaScript devs | 960 | 1,881 | 23 | 0 |
| .../scraping-basics-javascript/downloading-html | Downloading HTML with Node.js | 1,274 | 2,508 | 8 | 1 |
| .../scraping-basics-javascript/parsing-html | Parsing HTML with Node.js | 1,176 | 2,235 | 6 | 1 |
| .../scraping-basics-javascript/extracting-data | Extracting data from HTML with Node.js | 1,728 | 3,414 | 9 | 1 |
| .../scraping-basics-javascript/getting-links | Getting links from HTML with Node.js | 1,551 | 3,314 | 8 | 1 |

The Markdown of a page keeps headings, lists, tables (GitHub-flavoured), fenced code blocks **with their language and line breaks**, and absolute links and images:

````markdown
## Parsing HTML with Node.js

**In this lesson we'll look for products in the downloaded HTML. We'll use Cheerio to turn the HTML into objects ...**

### Processing HTML

After downloading, the entire HTML is available in our program as a string ...

```js
import * as cheerio from 'cheerio';

const url = "https://warehouse-theme-metal.myshopify.com/collections/sales";
const response = await fetch(url);
```
````

One row (shortened):

```json
{
  "url": "https://docs.apify.com/academy/scraping-basics-javascript/parsing-html",
  "finalUrl": "https://docs.apify.com/academy/scraping-basics-javascript/parsing-html",
  "statusCode": 200,
  "depth": 1,
  "referrerUrl": "https://docs.apify.com/academy/scraping-basics-javascript",
  "title": "Parsing HTML with Node.js | Academy | Apify Documentation",
  "description": "Lesson about building a Node.js application for watching prices. Using the Cheerio library to parse HTML code of a product listing page.",
  "h1": "Parsing HTML with Node.js",
  "markdown": "# Parsing HTML with Node.js\n\n**In this lesson we'll look for products ...",
  "wordCount": 1176,
  "characterCount": 8937,
  "estimatedTokens": 2235,
  "headings": [{ "level": 1, "text": "Parsing HTML with Node.js" }, { "level": 2, "text": "Processing HTML" }],
  "language": "en",
  "canonicalUrl": "https://docs.apify.com/academy/scraping-basics-javascript/parsing-html",
  "modifiedAt": "2026-11-30T14:02:55.000Z",
  "ogImage": "https://apify.com/og-image/docs-article?title=Parsing+HTML+with+Node.js",
  "mainContentSource": "article",
  "internalLinkCount": 59,
  "externalLinkCount": 27,
  "imageCount": 2,
  "contentType": "text/html",
  "sizeBytes": 96792,
  "contentHash": "3e1e97fde456c054",
  "changeStatus": null,
  "domain": "apify.com",
  "crawledAt": "2026-12-01T10:24:46.159Z"
}
```

### What you get

- **Clean Markdown** of the main content: navigation, headers, footers, sidebars, cookie / consent banners, share and newsletter boxes, ads and table-of-contents blocks are removed; the article / `main` block is detected automatically (or set your own CSS selector). Layout tables are flattened, data tables become Markdown tables, card links become linked headings, heading anchor icons and placeholder images are dropped.
- **Metadata**: title, meta description, H1, heading outline, language, canonical URL, author, published / modified date (meta, JSON-LD, `<time>` or the Last-Modified header), site name, og:image, og:type, keywords.
- **LLM budgeting**: `wordCount`, `characterCount`, `estimatedTokens`, optional `maxMarkdownChars` cut with a `markdownTruncated` flag, and `minWordCount` to skip thin pages (not charged).
- **Optional extras**: plain `text`, cleaned `html`, `internalLinks` / `externalLinks` with anchor text, `images` with alt text, and every schema.org **JSON-LD** object (Article, Product, FAQ, Organization ...).
- **Change monitoring**: `contentHash` on every row, plus a `changeTrackingStore` option that remembers hashes between scheduled runs and saves (and charges) only **new or changed** pages.
- **Plain-text files** (`.txt`, `.md`) are passed through as-is. PDFs and other files are listed in `RUN_SUMMARY.nonHtmlFiles` and not charged (use our [PDF Text Extractor](https://apify.com/rel8ble/pdf-text-extractor) for PDFs).

### Use cases

- **RAG and vector databases**: turn a documentation site, help centre, blog or knowledge base into Markdown chunks for Pinecone, Qdrant, Weaviate, pgvector, LangChain or LlamaIndex.
- **AI agents and MCP**: give an agent a cheap "read this URL" tool that returns compact Markdown instead of raw HTML (fewer tokens).
- **Chatbot knowledge bases**: feed a support bot your own site, refreshed on a schedule.
- **Scheduled monitoring**: run daily or weekly with `changeTrackingStore` to get only the pages whose content changed: competitor pricing / feature pages, terms and policy pages, documentation updates, regulatory notices.
- **SEO and content audits**: titles, descriptions, H1s, canonicals, word counts, heading outlines and link counts for every page of a site, from its sitemap.
- **Datasets for fine-tuning and research**: bulk-convert article lists into clean text.

### Pricing

**$0.30 per 1,000 saved pages** (pay per result, $0.0003 per page), **no start fee**. Failed pages, robots.txt skips, PDFs / non-HTML files, pages below `minWordCount` and unchanged pages (with change tracking) are never charged. Platform usage is included in that price for normal runs; a proxy you turn on is billed by Apify as usual.

| Actor (Apify Store, 30 Nov 2026) | Price per 1,000 pages | Start fee | Users |
|---|---|---|---|
| **This actor** | **$0.30** | none | new |
| apify/web-fetch | $1.50 (Free / Bronze plan), $1.00 Gold+ | $0.00005 per GB | 74,400 |
| apify/rag-web-browser (fetch) | $2.28 | $0.000225 | 215,989 |
| 6sigmag/fast-website-content-crawler | $3.00 | $0.0015 | 4,805 |
| pumpkinapi/website-content-crawler | $3.00 | listed | 340 |

That is **80% under apify/web-fetch** on the Free plan. To be fair about the difference: Web Fetch and Website Content Crawler can render JavaScript in a real browser and work around bot protection; this actor reads the HTML the server sends. It suits documentation, blogs, news, wikis, company and e-commerce pages that are server-rendered (most of the web); single-page apps that build all content in the browser will come back thin. Rival speeds were not measured.

### How to use

1. Paste URLs or domains into **Start URLs** (one per line). An empty input runs a demo on the Apify Academy course (10 pages).
2. Choose **Crawl depth**: `0` = only the listed URLs, `1` = plus the pages they link to, and so on. **Which links to follow** keeps the crawl in the start URL's folder by default.
3. Optional: **Also read sitemap.xml** to convert a whole site fast, URL include / skip patterns, page budgets (`maxResults`, `maxPagesPerSite`), main-content selector, extra fields.
4. Run, then download the dataset (JSON, JSONL, CSV, Excel, Markdown-in-JSON) or read it through the API. `RUN_SUMMARY` in the key-value store lists failures, skips and per-site counts.

#### Example inputs

Bulk list of single pages (no crawling), plain prose for an LLM:

```json
{
  "startUrls": ["https://en.wikipedia.org/wiki/Markdown", "https://www.rfc-editor.org/rfc/rfc9309.txt", "docs.python.org/3/tutorial/index.html"],
  "maxCrawlDepth": 0,
  "includeImagesInMarkdown": false,
  "includeLinksInMarkdown": false
}
```

A whole docs site from its sitemap (local test: 714 pages, 0 failed, 38 s):

```json
{
  "startUrls": ["https://crawlee.dev/js/docs"],
  "useSitemaps": true,
  "maxCrawlDepth": 0,
  "maxResults": 0,
  "maxConcurrency": 20
}
```

Weekly change monitor of a pricing and blog section, only new / changed pages saved:

```json
{
  "startUrls": ["https://example.com/pricing", "https://example.com/blog/"],
  "maxCrawlDepth": 1,
  "maxPagesPerSite": 200,
  "excludeUrlPatterns": ["/tag/", "?page="],
  "changeTrackingStore": "example-com-monitor"
}
```

### Input

| Field | Default | What it does |
|---|---|---|
| `startUrls` | demo | URLs or domains, one per line; bulk lists welcome |
| `maxCrawlDepth` | 1 | 0 = listed URLs only; N = follow links N levels deep (max 20) |
| `maxResults` | 50 | Max pages saved in total (0 = no limit) |
| `maxPagesPerSite` | 0 | Max pages per start URL (0 = no limit) |
| `crawlScope` | same-path | same-path, same-hostname, same-domain or any |
| `useSitemaps` | false | Add in-scope URLs from robots.txt sitemaps or /sitemap.xml |
| `includeUrlPatterns` / `excludeUrlPatterns` | - | Substrings or `*` wildcards matched on the full URL |
| `onlyMainContent` | true | Strip boilerplate and keep the main block |
| `mainContentSelector` / `removeSelectors` | - | Your own CSS selectors |
| `includeLinksInMarkdown` / `includeImagesInMarkdown` | true | Keep links / images in the Markdown |
| `saveText`, `saveCleanHtml`, `saveLinks`, `saveJsonLd` | false | Extra fields |
| `minWordCount` | 0 | Skip (and don't charge) thinner pages |
| `maxMarkdownChars` | 0 | Cut long pages |
| `changeTrackingStore` / `saveUnchangedPages` | - / false | Save only new or changed pages across runs |
| `respectRobotsTxt` | true | Skip URLs robots.txt disallows for all crawlers |
| `maxConcurrency` / `maxRequestRetries` | 10 / 2 | Speed and retries (fresh session on 401 / 403 / 429) |
| `proxyConfiguration` | off | Apify Proxy for sites that block cloud IPs |

Bad values never crash a run: a non-number, an unknown scope or an invalid CSS selector is reported in `RUN_SUMMARY.inputWarnings` and replaced by the default; invalid start URLs are skipped and listed.

### Integrations

Use the dataset from **Make, Zapier, n8n, Google Sheets, Airbyte, Slack** or any webhook, call it from the **Apify API** / JS and Python clients, or let an **AI agent pick it through the Apify MCP server**: input is a list of URLs, output is one Markdown row per page, cost is $0.0003 per page. **LangChain** and **LlamaIndex** have Apify dataset loaders, so the `markdown` field can go straight into a vector store.

### FAQ

**Does it render JavaScript?** No. It reads the HTML the server returns, which covers server-rendered sites (most docs, blogs, news, wikis, shops). For apps that draw everything in the browser, use a browser-based crawler.

**Does it get past Cloudflare or captchas?** No, and it does not try. Blocked pages (401 / 403 / 429 after retries) are listed in `RUN_SUMMARY.failures` and not charged. Turning on Apify Proxy helps with sites that only rate-limit cloud IPs.

**Does it respect robots.txt?** Yes by default: URLs disallowed for all crawlers are skipped and counted. You can switch it off for your own sites.

**How are tokens counted?** `estimatedTokens` is characters / 4, the usual rule of thumb for English text with GPT- and Claude-style tokenizers. Use it for budgeting, not billing.

**How does change tracking work?** With `changeTrackingStore` set, each page's Markdown hash is saved in a named key-value store in your account. The next run compares hashes: unchanged pages are skipped (free), new and changed ones are saved with `changeStatus`. Use one store name per monitor.

**Can I give it thousands of URLs?** Yes. Paste them into `startUrls` with `maxCrawlDepth: 0`; duplicates are removed and invalid lines skipped. Use `maxConcurrency` 20-50 for big lists of different sites.

**What about PDFs?** They are listed in `RUN_SUMMARY.nonHtmlFiles` and not charged. Our [PDF Text Extractor](https://apify.com/rel8ble/pdf-text-extractor) converts them.

**Is the content mine to use?** The actor fetches public pages you choose. You are responsible for respecting each site's terms and copyright when you store or reuse the text.

### Related actors by rel8ble

- [PDF Text Extractor](https://apify.com/rel8ble/pdf-text-extractor) - PDF links to text, metadata, e-mails, keyword hits.
- [Website Contact Extractor](https://apify.com/rel8ble/website-contact-extractor) - websites to e-mails, phones and social profiles.
- [Website Tech Stack Detector](https://apify.com/rel8ble/website-tech-stack-detector) - which CMS, shop, analytics and frameworks a site uses.

Need a custom scraper or a ready dataset? Hire me on Fiverr: https://www.fiverr.com/rel8ble

# Actor input Schema

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

Pages or sites to convert, one per line: full URLs (https://example.com/docs/) or bare domains (example.com). Bulk lists of thousands of URLs are fine. Each URL is also the starting point of a crawl when crawl depth is above 0.

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

0 = fetch only the start URLs (and sitemap URLs). 1 = also every in-scope page linked from them, 2 = links of those pages, and so on (max 20).

## `maxResults` (type: `integer`):

Stop after this many pages are saved (all start URLs together). 0 = no limit. You are charged only for saved pages.

## `maxPagesPerSite` (type: `integer`):

Page budget for each start URL, so one big site cannot use the whole run. 0 = no per-site limit.

## `crawlScope` (type: `string`):

same-path = only pages under the start URL's folder (https://site.com/docs/... for a /docs/ start). same-hostname = the whole host. same-domain = the host and its subdomains (blog.site.com, docs.site.com). any = every link (use with URL patterns).

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

Read the sitemaps listed in robots.txt (or /sitemap.xml) and add every in-scope page URL. The fastest way to convert a whole docs site or blog without crawling links.

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

Optional. Follow / save only URLs that contain one of these texts or match a \* wildcard pattern, e.g. "/blog/" or "https://site.com/docs/*/guide*". Start URLs are always fetched.

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

Optional. Never follow URLs that contain one of these texts or match a \* pattern, e.g. "/tag/", "?page=", "*/changelog*".

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

Drop navigation, headers, footers, sidebars, cookie banners, share / newsletter boxes and keep the article or main block. Turn off to convert the whole <body>.

## `mainContentSelector` (type: `string`):

Optional. CSS selector of the block to convert when you know the site, e.g. "article", "#content", ".post-body". Falls back to automatic detection when it matches nothing.

## `removeSelectors` (type: `string`):

Optional. Comma-separated CSS selectors removed before conversion, e.g. ".ad-slot, #related, .author-box".

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

Keep [text](url) links (absolute URLs). Turn off for plain prose with fewer tokens.

## `includeImagesInMarkdown` (type: `boolean`):

Keep ![alt](url) image references (absolute URLs). Turn off to save tokens.

## `saveText` (type: `boolean`):

Add a "text" field: the main content as plain text with paragraph breaks.

## `saveCleanHtml` (type: `boolean`):

Add an "html" field: the main-content HTML after cleaning (absolute links, no scripts / styles).

## `saveLinks` (type: `boolean`):

Add internalLinks, externalLinks (url + anchor text) and images (url + alt) arrays. Counts are always saved.

## `saveJsonLd` (type: `boolean`):

Add a "jsonLd" array with every schema.org JSON-LD object on the page (Article, Product, Organization, FAQ ...).

## `minWordCount` (type: `integer`):

Pages whose main content has fewer words are not saved and not charged (their links are still followed). 0 = keep all.

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

Truncate very long pages for LLM context limits; markdownTruncated tells you when it happened. 0 = no limit.

## `changeTrackingStore` (type: `string`):

Optional, for scheduled monitoring. Name of a key-value store (letters, digits, -) that remembers each page's content hash between runs. With it, pages whose content did not change since the last run are skipped and not charged; changeStatus says new / changed.

## `saveUnchangedPages` (type: `boolean`):

With change tracking on: also save (and charge) pages that did not change, marked changeStatus = unchanged.

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

Skip URLs that the site's robots.txt disallows for all crawlers (counted in RUN_SUMMARY, never charged).

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

How many pages are fetched at the same time (1-100). Lower it for small sites.

## `maxRequestRetries` (type: `integer`):

Retries for network errors, 5xx and 401 / 403 / 429 answers (with a fresh session each time).

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

Not needed for most sites. Turn on Apify Proxy (datacenter or residential) for sites that rate-limit or block cloud IPs.

## Actor input object example

```json
{
  "startUrls": [
    "https://docs.apify.com/academy/scraping-basics-javascript"
  ],
  "maxCrawlDepth": 1,
  "maxResults": 50,
  "maxPagesPerSite": 0,
  "crawlScope": "same-path",
  "useSitemaps": false,
  "onlyMainContent": true,
  "includeLinksInMarkdown": true,
  "includeImagesInMarkdown": true,
  "saveText": false,
  "saveCleanHtml": false,
  "saveLinks": false,
  "saveJsonLd": false,
  "minWordCount": 0,
  "maxMarkdownChars": 0,
  "saveUnchangedPages": false,
  "respectRobotsTxt": true,
  "maxConcurrency": 10,
  "maxRequestRetries": 2,
  "proxyConfiguration": {
    "useApifyProxy": false
  }
}
```

# Actor output Schema

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

One row per saved page: Markdown, title, description, headings, word and token counts, dates, content hash.

## `summary` (type: `string`):

Pages saved / failed, robots.txt and non-HTML skips, unchanged pages, per-start-URL counts, input warnings.

# 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"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("rel8ble/website-to-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"] }

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

```

## MCP server setup

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