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

Crawl any website or docs site and convert every page to clean Markdown (main content only) for LLMs, RAG pipelines and AI agents. Respects robots.txt. $0.79 per 1,000 pages.

- **URL**: https://apify.com/wholesome_spring/website-to-markdown-crawler.md
- **Developed by:** [Czech Data Tools](https://apify.com/wholesome_spring) (community)
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $0.79 / 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 to Markdown Crawler for LLM & RAG

Turn any website, docs site or blog into **clean Markdown** ready for ChatGPT, Claude, LangChain, LlamaIndex, vector databases and AI agents.

Give it one or more start URLs. It follows links on the same site, strips navigation, headers, footers, sidebars and cookie banners, and saves the main content of every page as Markdown with title, description, language and word count.

### Why this crawler

- **Cheap:** $0.79 per 1,000 pages. No start fee, no proxy add-ons.
- **Fast:** plain HTTP (no headless browser), 20 pages in about 10 seconds.
- **Clean output:** headings, lists, tables, code blocks and links kept as Markdown, with absolute URLs.
- **Polite:** respects robots.txt (including crawl-delay), meta noindex/nofollow, and spaces out requests to each site.
- **Flexible scope:** stay under a path like `/docs/`, add the sitemap, include or exclude URL patterns with regex.

### Input

| Field | What it does |
|---|---|
| Start URLs | Pages to start from |
| Max pages | Pages saved (and charged) |
| Max link depth | Clicks away from the start URL (0 = only the start URLs) |
| Stay under start path | Keep the crawl inside the start folder |
| Also use sitemap.xml | Add URLs from the sitemap |
| Include / exclude URL patterns | Regex filters |
| Main content only | Remove nav, header, footer, sidebars |
| Extra CSS selectors to remove | e.g. `.ads, #newsletter` |
| Include plain text / links | Optional extra fields |

### Output (one item per page)

```json
{
  "url": "https://docs.example.com/guide/intro",
  "canonicalUrl": "https://docs.example.com/guide/intro",
  "title": "Introduction",
  "description": "Get started with Example.",
  "language": "en",
  "h1": "Introduction",
  "depth": 1,
  "wordCount": 812,
  "markdown": "# Introduction\n\nExample lets you ...",
  "crawledAt": "2026-11-15T05:45:42.000Z"
}
```

Download as JSON, CSV, Excel or JSONL, or read it from the API straight into your RAG pipeline.

### Notes

- JavaScript-only pages (empty HTML without JS) are not rendered; most docs sites, blogs and marketing sites work out of the box.
- Pages disallowed by robots.txt are skipped and counted in the run's SUMMARY record.

# Actor input Schema

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

Pages to start from. The crawler follows links on the same site (and, by default, under the same path).

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

Maximum number of pages saved to the dataset (and charged).

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

How many clicks away from a start URL to follow. 0 = only the start URLs.

## `stayOnPath` (type: `boolean`):

Only crawl URLs under the start URL's folder (e.g. /docs/). Turn off to crawl the whole domain.

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

Add URLs from the site's sitemap (found via robots.txt or /sitemap.xml). Great for crawling a whole docs site quickly.

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

Only save pages whose URL matches one of these regular expressions, e.g. /blog/. Leave empty to save everything in scope.

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

Skip URLs matching any of these regular expressions, e.g. /tag/ or ?page=.

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

Remove navigation, headers, footers, sidebars and cookie banners, keeping the article/main content.

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

Optional comma-separated CSS selectors to delete before conversion, e.g. .ads, #newsletter.

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

Also output a plain-text version of the page next to the Markdown.

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

Also output all links found on each page.

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

Parallel requests (1-5). Requests to one site are always spaced out politely and robots.txt crawl-delay is respected.

## Actor input object example

```json
{
  "startUrls": [
    "https://docs.apify.com/academy/web-scraping-for-beginners"
  ],
  "maxPages": 20,
  "maxDepth": 2,
  "stayOnPath": true,
  "useSitemap": false,
  "includeUrlPatterns": [],
  "excludeUrlPatterns": [],
  "onlyMainContent": true,
  "removeSelectors": "",
  "includeText": false,
  "includeLinks": false,
  "maxConcurrency": 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": [
        "https://docs.apify.com/academy/web-scraping-for-beginners"
    ]
};

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

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

```

## MCP server setup

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