# Website to Markdown Crawler: Clean Content for AI & RAG (`promur/website-to-markdown`) Actor

Crawl any website, blog or documentation and get every page as clean Markdown for AI agents, RAG and LLM fine-tuning: main content only (no menus, footers or cookie banners), title, description, headings, optional chunks. Respects robots.txt. Pay per page.

- **URL**: https://apify.com/promur/website-to-markdown.md
- **Developed by:** [PROMUR s.r.o.](https://apify.com/promur) (community)
- **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 converteds

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 Crawler: Clean Content for AI & RAG

Crawl any **website, blog or documentation** and get **every page as clean Markdown** - only the main content, without menus, headers, footers, sidebars or cookie banners - with **title, description, language, headings and word count**. Ready for **AI agents, RAG pipelines, vector databases, LLM fine-tuning** or a custom GPT. Or get it **already chunked** with section headings.

Plain HTTP and pay per page: no browser, no proxy, no API key. robots.txt is respected.

### Why this Actor

**Price, quality, reliability, responsibility - in balance:**

- 💵 **Low price** - $1 per 1,000 pages, however long the page, chunks included.
- 🔍 **Clean content** - the main text as real Markdown with headings, links and tables; menus, footers and cookie banners left out.
- 🔁 **Dependable runs** - a crawl that stays where you point it (path, depth, globs), with a run report per site.
- 🤝 **Responsible crawling** - robots.txt respected; disallowed pages are never requested (or charged).

**What you get:**

- 🧹 **Main content only** - `<main>` / `<article>` when the page has one; navigation, headers, footers, sidebars, forms, cookie banners, share buttons and "related posts" removed.
- 📝 **Real Markdown** - headings, paragraphs, bold / italic, links (absolute), nested lists, code blocks, tables, block quotes; optional images.
- 🧩 **RAG-ready chunks** - chunks of your size at block / sentence boundaries with overlap, each carrying its section heading and page URL.
- 🗺️ **Smart crawl** - start URL + its links breadth-first, plus the XML sitemap; stays under the start path by default (`/docs/` stays in `/docs/`); include / exclude patterns; click-depth limit; duplicate pages (redirects) saved once.
- 🤖 **Polite** - robots.txt first; disallowed pages are never requested or charged.
- 💸 **Simple price** - one price per page with text; errors and empty pages are free.

### Use cases

- **RAG and AI assistants** - load a product's docs, help center or blog into a vector database.
- **Custom GPTs and agents** - give an agent up-to-date knowledge of a website.
- **Content migration and audits** - export a site's content as Markdown files.
- **Competitor and market research** - read many sites' content at scale.

### How to use

1. Paste one or more **Start URLs** (e.g. `https://docs.example.com/` or `https://example.com/blog/`).
2. Set **Max pages per start URL**. Optional: depth, include / exclude patterns, sitemap, chunks.
3. Click **Start**. Download as JSON / CSV / Excel, or send the dataset straight to your vector database through Apify integrations.

```json
{
    "urls": ["https://docs.example.com/guides/"],
    "maxPagesPerSite": 500,
    "excludeUrlGlobs": ["**/changelog/**"],
    "outputMode": "chunks",
    "chunkSize": 1500,
    "chunkOverlap": 150
}
```

### Output

**Pages mode:** `url`, `finalUrl`, `title`, `description`, `lang`, `canonical`, `author`, `publishedAt`, `depth`, `headings`, `wordCount`, `markdown`, `text` (option), `crawledAt`.

**Chunks mode:** the page fields plus `chunk`, `chunkCount`, `heading` and the chunk's `markdown`.

````json
{
    "url": "https://docs.example.com/guides/install",
    "title": "Installation | Example Docs",
    "lang": "en",
    "depth": 1,
    "headings": ["Installation", "Requirements", "Install with npm"],
    "wordCount": 412,
    "markdown": "# Installation\n\n## Requirements\n\n- Node.js 20 or newer\n\n## Install with npm\n\n```\nnpm install example\n```"
}
````

**Crawl report (`SUMMARY`):** per start URL - status, pages saved, pages disallowed by robots.txt, errors by type (404, timeout, not HTML, empty ...), pages left in the queue.

### Pricing

**$1.00 per 1,000 pages** - in pages or chunks mode, however long the page.

- A 300-page documentation site: **$0.30**.

Set *Maximum cost per run* in the run options: the crawl stops cleanly at that amount.

### FAQ

**JavaScript-only sites?** The crawler reads the HTML the server sends. Pages that render their text only with JavaScript come out empty (not charged); most docs, blogs and marketing sites work.

**Why did it skip pages?** robots.txt disallows them, they are outside the start path (switch off *Stay under the start URL's path*), they are files (PDF, images - use our PDF Text Extractor for PDFs), they have query parameters, or the page / depth limit was reached. See `SUMMARY`.

### Support

A page that converts badly? Open an issue on the **Issues** tab with the URL - we usually fix it fast.

# Actor input Schema

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

One per line. The crawl follows links from each start URL inside the same site - by default only under the start URL's path (e.g. <code>https://example.com/docs/</code> stays in /docs/).

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

How many pages to save per start URL (closest to the start page first).

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

How many clicks away from the start URL to go. 0 = no limit.

## `stayWithinPath` (type: `boolean`):

Only pages whose address starts with the start URL's folder (e.g. /docs/). Off: the whole site.

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

Also take pages from the site's sitemap (inside the path / patterns you set), to reach pages that are not linked.

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

Optional patterns: <code>\*</code> = anything but <code>/</code>, <code>**</code> = anything. E.g. <code>https://example.com/blog/**</code>.

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

Optional patterns to skip, e.g. <code>**/tag/**</code>, <code>\*\*/page/\*</code>.

## `includeQueryUrls` (type: `boolean`):

Follow links like <code>?page=2</code> or <code>?lang=de</code>. Off by default to avoid endless filter URLs.

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

The price is per page in both modes.

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

Chunks mode: maximum characters per chunk; chunks end at block or sentence boundaries and carry their section heading.

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

Chunks mode: each chunk starts with up to this many characters of the previous one.

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

Pages mode: add the content as plain text next to the Markdown.

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

Add images as <code>![alt](url)</code>.

## Actor input object example

```json
{
  "urls": [
    "https://docs.apify.com/academy/web-scraping-for-beginners"
  ],
  "maxPagesPerSite": 50,
  "maxDepth": 0,
  "stayWithinPath": true,
  "useSitemap": true,
  "includeQueryUrls": false,
  "outputMode": "pages",
  "chunkSize": 2000,
  "chunkOverlap": 200,
  "includeText": false,
  "includeImages": false
}
```

# Actor output Schema

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

Pages mode: url, finalUrl, title, description, lang, canonical, author, publishedAt, depth, headings, wordCount, markdown, text (option), crawledAt. Chunks mode: the same page fields plus chunk, chunkCount, heading, markdown.

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

Per start URL: status, pages saved, pages disallowed by robots.txt, errors by type, pages left in the queue, and a message.

# 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://docs.apify.com/academy/web-scraping-for-beginners"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("promur/website-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 = { "urls": ["https://docs.apify.com/academy/web-scraping-for-beginners"] }

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

```

## MCP server setup

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