# Website Content Crawler - Markdown for LLM, RAG & AI Agents (`rjmacarthy/website-content-crawler`) Actor

Crawl any website over fast plain HTTP and get one row per page with clean Markdown (navigation, footers and cookie banners removed) for RAG, vector databases and LLM context. Flat $0.50 per 1,000 pages. Monitor mode re-emits only new and changed pages.

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

## Pricing

from $0.50 / 1,000 page saveds

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 Content Crawler - Clean Markdown for LLM, RAG & AI Agents

Crawl a whole website, a sitemap or a list of URLs and get **one row per page with clean Markdown**: navigation, headers, footers, sidebars, cookie banners and scripts removed; headings, lists, tables, code blocks (with language), links and blockquotes kept. Built for RAG pipelines, vector databases, LLM context and AI agents.

Three things set it apart from other content crawlers:

- **A flat, known price: $0.50 per 1,000 pages.** No compute bill that depends on how slow the site is. You know the cost before you press Start (`maxPages` x $0.0005).
- **Fast plain HTTP, no browser.** Several pages per second, low memory, no timeouts on big sites.
- **Monitor mode: only new and changed pages.** Schedule a nightly crawl and feed your vector database only what actually changed. Unchanged pages are not output and not charged.

The honest limit: it does not run JavaScript. Pages that only show their text after client-side rendering come back empty or thin and are flagged `needsJavaScript: true` (see [Tips and limits](#tips-and-limits)).

### What data can you get

| Field | What it is |
|---|---|
| `url`, `canonicalUrl` | Page URL after redirects, and the canonical URL the page declares |
| `title`, `description`, `language` | From `<title>`, the meta description and `<html lang>` |
| `markdown` | The main content as clean Markdown |
| `text`, `html` | Optional plain text and cleaned HTML of the same content |
| `wordCount`, `tokensEstimate` | Size of the content; tokens are estimated as characters / 4 |
| `headings` | H1-H3 outline: `[{ level, text }]`, handy for chunking |
| `author`, `publishedAt`, `modifiedAt` | From meta tags or JSON-LD, when the page has them |
| `depth`, `referrerUrl` | Clicks from the start URL and the page that linked here |
| `statusCode` | HTTP status |
| `contentHash`, `changeType` | Hash of the page text; `new` / `changed` in monitor mode |
| `needsJavaScript` | `true` when the page looks client-rendered |
| `id`, `crawledAt` | Stable page ID (hash of the URL) and fetch time |

### Use cases

- **RAG and chatbots over your docs:** crawl a documentation site and load the Markdown into Pinecone, Qdrant, Weaviate, pgvector or a LangChain / LlamaIndex loader.
- **Keep a vector database fresh:** schedule a nightly run in monitor mode and re-embed only the rows that come back.
- **LLM context and fine-tuning data:** turn a help centre, a blog or a knowledge base into clean text with token estimates.
- **AI agents:** give an agent a URL list and get Markdown back, cheaper than a browser-based fetch.
- **Content migration and audits:** export every page of a site as Markdown with its title, description and heading outline.

### How to use

1. Put the site (or section) in **Start URLs**. `https://example.com/docs` crawls `/docs` and everything below it.
2. Set **Max pages**. Each saved page costs $0.0005.
3. Run it, then open the **Markdown content** view of the dataset or fetch it by API.

Crawl a documentation section:

```json
{
    "startUrls": [{ "url": "https://docs.apify.com/academy" }],
    "maxPages": 200
}
```

Only the blog, found through the sitemap, without links in the Markdown:

```json
{
    "startUrls": [{ "url": "https://crawlee.dev/sitemap.xml" }],
    "crawlMode": "sitemap",
    "includeGlobs": ["/blog/**"],
    "excludeGlobs": ["/blog/archive", "/blog/authors/**", "/blog/authors", "/blog/tags/**", "/blog/page/**"],
    "maxPages": 100,
    "includeLinks": false
}
```

A fixed list of pages, with plain text as well:

```json
{
    "startUrls": [
        { "url": "https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/Cache-Control" },
        { "url": "https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/ETag" }
    ],
    "crawlMode": "urls",
    "outputFormats": ["markdown", "text"]
}
```

Nightly sync: only new and changed pages (put this on a schedule):

```json
{
    "startUrls": [{ "url": "https://docs.python.org/3/tutorial/" }],
    "maxPages": 500,
    "monitorMode": "changed",
    "stateKey": "python-tutorial"
}
```

#### Input reference

| Input | Default | Notes |
|---|---|---|
| `startUrls` | - | One or more URLs |
| `crawlMode` | `site` | `site` follows same-host links under the start URL's path. `sitemap` reads the site's sitemaps (or a sitemap.xml you give) and crawls only those pages. `urls` fetches exactly the given URLs |
| `maxPages` | 50 | Total for the run, max 20,000. 0 = the 20,000 cap |
| `maxDepth` | 10 | Site mode: clicks from the start URL |
| `useSitemap` | true | Site mode: also add sitemap pages that are under the start URL |
| `includeGlobs`, `excludeGlobs` | none | `*` within a path segment, `**` anything. `/blog/**` matches the path; `https://example.com/**/api/**` the whole URL |
| `outputFormats` | `["markdown"]` | Any of `markdown`, `text`, `html` |
| `includeLinks` / `includeImages` | true / false | Keep `[text](url)` and `![alt](url)` in the Markdown |
| `removeSelectors`, `keepSelectors` | none | Extra CSS selectors to drop, or restrict the content to |
| `monitorMode`, `stateKey` | `all`, `default` | `changed` = only new and changed pages; one memory per monitor name |
| `maxConcurrency` | 5 | Parallel requests per host |
| `respectRobotsTxt` | true | Skip URLs disallowed for user agent `WebsiteContentCrawler` |
| `proxyConfiguration` | off | Apify datacenter proxy or your own proxy URLs |

### Output example

A real row from `https://docs.apify.com/academy` (Markdown shortened here):

```json
{
    "id": "b4aa330fc8278f66",
    "url": "https://docs.apify.com/academy/tutorials",
    "canonicalUrl": "https://docs.apify.com/academy/tutorials",
    "title": "What's this section? | Academy | Apify Documentation",
    "description": "Learn about various different specific topics related to web-scraping and web-automation with the Apify Academy tutorial lessons!",
    "language": "en",
    "markdown": "# What's this section?\n\n**Learn about various different specific topics related to web-scraping and web-automation with the Apify Academy tutorial lessons!**\n\n---\n\nIn web scraping, there are a whole lot of niche cases that you will run into. ...",
    "text": null,
    "html": null,
    "wordCount": 81,
    "tokensEstimate": 133,
    "headings": [{ "level": 1, "text": "What's this section?" }],
    "author": null,
    "publishedAt": null,
    "modifiedAt": null,
    "depth": 1,
    "referrerUrl": "https://docs.apify.com/academy",
    "statusCode": 200,
    "contentHash": "f82e8e5193bd072a",
    "changeType": null,
    "needsJavaScript": false,
    "crawledAt": "2026-11-18T15:51:32.484Z",
    "scrapedAt": "2026-11-18T15:51:32.484Z"
}
```

What the Markdown looks like for a docs page with code:

````markdown
## Quick Start

With this short tutorial you can start scraping with Crawlee in a minute or two.

### Installation with Crawlee CLI

The fastest way to try Crawlee out is to use the **Crawlee CLI** and choose the **Getting started example**.

```bash
npx crawlee create my-crawler
```
````

The key-value store record `RUN_SUMMARY` has the counts for the run: pages crawled, saved and unchanged, non-HTML files skipped, URLs that failed and why, requests per host and warnings.

### Pricing

Pay per event, the same on every Apify plan:

| Event | Price |
|---|---|
| `page` - one page row saved to the dataset | $0.0005 |
| `apify-actor-start` - once per run | $0.00005 |

- **1,000 pages = $0.50.** 10,000 pages = $5.00. A 200-page docs site = $0.10.
- Not charged: pages that fail, redirects out of scope, non-HTML files (PDF, images), URLs blocked by robots.txt, pages with no extractable text, and in monitor mode every unchanged page.
- A nightly monitor run over a 1,000-page site where 12 pages changed costs 12 x $0.0005 = $0.006.
- Platform compute is included in the price. Set **Maximum cost per run** in the run options and the crawl stops cleanly when it is reached.

### Tips and limits

- **No JavaScript rendering.** Single-page apps that ship an empty HTML shell return little or nothing. Those rows have `needsJavaScript: true`, the run summary counts them, and rows with no text at all are not charged. Server-rendered sites (most documentation generators, WordPress, Ghost, Next.js with SSR, static sites) work.
- **Scope.** Site mode stays under the start URL's path. Starting from a single page such as `/docs/quick-start` crawls only that page (the log says so): start from `/docs`, or set `includeGlobs` to `["/docs/**"]`.
- **Main content detection.** `<main>` is used when present, then the `<article>` holding the H1, then a text-density heuristic. If a site keeps unwanted blocks, add them to `removeSelectors`; if the wrong area is picked, set `keepSelectors`.
- **Tables.** Data tables become GitHub-style Markdown tables. Row spans are flattened, and a table without a header row uses its first row as the header.
- **Monitor mode.** The change check hashes the page title and text, so new build IDs, tracking parameters or changed link targets do not count as a change, while any edit to the visible text does. Deleted pages are not reported. Keep `maxPages` above the size of the site, otherwise different pages may be reached on different nights.
- **Sitemaps.** Gzipped sitemaps (`.xml.gz`) are not read; the crawler then relies on links.
- **Non-HTML files** (PDF, images, archives) are skipped and counted, not converted.
- **Very long pages** are cut at 2,000,000 characters per content field.
- **Blocking.** The crawler identifies itself as `WebsiteContentCrawler` and does not evade bot protection. If a site answers HTTP 403/429 or a challenge page, the URL is listed in the run summary; enabling Apify Proxy (datacenter) can help.

### FAQ

**Is it legal to crawl a website?**
The Actor reads only publicly reachable pages, without logging in, and respects robots.txt by default. You are responsible for how you use the content: check the site's terms and copyright, and data-protection law (GDPR, CCPA) if pages contain personal data. The Actor does not harvest contact data.

**How is this different from Apify's Website Content Crawler?**
That Actor bills platform compute and uses a browser by default, so the cost per page varies with the site. This one is HTTP-only with one flat price per page, and adds the only-changed-pages mode. If you need JavaScript rendering, use a browser-based crawler.

**Can I use residential proxies?**
No. Under pay-per-event pricing the proxy traffic would cost more than the page price. If you select the RESIDENTIAL group, the Actor logs a warning and uses Apify datacenter proxy instead. Your own proxy URLs work.

**How do I chunk the output for embeddings?**
Split `markdown` on headings (`## `), or use the `headings` outline. `tokensEstimate` tells you which pages need splitting.

**Why did I get fewer pages than Max pages?**
The site has fewer pages in scope, some URLs failed, or the maximum cost per run was reached. `RUN_SUMMARY` lists the reasons.

**Does monitor mode work across different sites?**
Yes. Use a different `stateKey` (monitor name) per site or schedule so each keeps its own memory.

### Integrations

- **API:** start runs and read the dataset with the [Apify API](https://docs.apify.com/api/v2) or the JavaScript / Python clients. `GET /datasets/{id}/items?view=content` returns `url`, `title` and `markdown`.
- **Make, Zapier, n8n:** use the Apify apps to run the Actor on a schedule and send rows to your database or vector store.
- **LangChain / LlamaIndex:** load the dataset with their Apify dataset loaders, mapping `markdown` to the document text and `url` to the source.
- **MCP:** call the Actor from Claude, Cursor or any MCP client through the Apify MCP server.
- **Webhooks:** trigger your embedding job when a run succeeds.

### Changelog

- **0.1** (2026-11-18): first version. Site, sitemap and URL-list crawling; Markdown, text and cleaned HTML output; monitor mode for new and changed pages.

### Ready-to-run examples

- [Crawl a documentation site into Markdown for RAG](https://apify.com/rjmacarthy/website-content-crawler/examples/crawl-python-docs-to-markdown-for-rag)
- [Monitor a website for changed pages (vector DB sync)](https://apify.com/rjmacarthy/website-content-crawler/examples/monitor-website-changed-pages-markdown)

### More scrapers by the same developer

- [RAG Web Search - Search the Web, Get Markdown for AI Agents](https://apify.com/rjmacarthy/rag-web-search)
- [AI Visibility Tracker: ChatGPT, Perplexity, Gemini, Claude](https://apify.com/rjmacarthy/ai-search-visibility-tracker)
- [Apple App Store Scraper: Apps, Search & Reviews](https://apify.com/rjmacarthy/app-store-scraper)
- [Bulk File Downloader - PDFs, Images & Files from URL Lists](https://apify.com/rjmacarthy/bulk-file-downloader)
- [Domain WHOIS Lookup - Bulk RDAP, Expiry, DNS & Availability](https://apify.com/rjmacarthy/domain-whois-lookup)
- [Google Play Scraper: Apps, Search & Reviews](https://apify.com/rjmacarthy/google-play-scraper)

Browse all my Actors on [my Apify Store profile](https://apify.com/rjmacarthy).

### Support

Found a page that converts badly, or a site that does not crawl? Open an issue on the Actor's Issues tab with the URL and the run ID, and it will be looked at.

# Actor input Schema

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

Where to start. In Site mode the crawler stays on the same host and under the path of each start URL: https://example.com/docs crawls /docs and everything below it. In Sitemap mode give the site (or a sitemap.xml URL). In URLs mode list every page you want.

## `crawlMode` (type: `string`):

site = follow same-host links under the start URL's path (and seed from the sitemap). sitemap = read robots.txt sitemaps or /sitemap.xml and crawl only those pages. urls = fetch exactly the URLs you give.

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

Maximum pages to crawl in the whole run, across all start URLs. Each page saved is one charged event ($0.0005), so this caps the cost: 1,000 pages = $0.50. 0 = no limit, which means the hard cap of 20,000 pages per run.

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

Site mode: how many clicks from the start URL to follow. 0 = the start URL only.

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

Site mode: besides following links, add the pages listed in the site's sitemaps (robots.txt or /sitemap.xml) that are under the start URL. Finds pages that no menu links to.

## `includeGlobs` (type: `array`):

Site and Sitemap mode: only crawl URLs matching one of these patterns. In Site mode they replace the "under the start URL's path" rule (the host must still match). \* matches within one path segment, \*\* matches anything. A pattern starting with / is matched against the path, e.g. /blog/\*\* ; otherwise against the whole URL, e.g. https://example.com/**/api/**.

## `excludeGlobs` (type: `array`):

Never crawl URLs matching one of these patterns, e.g. /docs/v1/\*\* or **/tag/**. Same syntax as Include URLs.

## `outputFormats` (type: `array`):

Which versions of the content to save on each row. Markdown is the default; text and html fill the text and html fields (otherwise null). The price per page is the same.

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

On: links stay as [text](https://absolute.url). Off: only the link text, which saves tokens.

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

On: images become ![alt](https://absolute.url). Off (default): images are dropped.

## `removeSelectors` (type: `array`):

Extra CSS selectors to delete before conversion, e.g. .promo-box or #comments. Navigation, header, footer, sidebars, cookie banners, forms and scripts are already removed.

## `keepSelectors` (type: `array`):

Restrict the content to these CSS selectors, e.g. article.post or #content. Leave empty to detect the main content automatically (<main>, <article>, then a text-density heuristic).

## `monitorMode` (type: `string`):

For scheduled runs. "changed" remembers a content hash of every page between runs and saves (and charges) only pages that are new or whose text changed, with changeType new or changed. The first run saves everything as the baseline. Unchanged pages are free.

## `stateKey` (type: `string`):

Separate memory for each monitor. Use a different name per site or schedule (e.g. "acme-docs").

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

Parallel requests per host. Lower it for small or fragile sites.

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

Skip URLs that the site's robots.txt disallows for this crawler (user agent WebsiteContentCrawler). Turn off only for sites you own or have permission to crawl.

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

Usually not needed. If the site blocks the run (HTTP 403/429), enable Apify Proxy with automatic (datacenter) proxies. Residential proxies are not supported: if you select the RESIDENTIAL group, the Actor uses Apify datacenter proxy instead.

## Actor input object example

```json
{
  "startUrls": [
    {
      "url": "https://docs.apify.com/academy"
    }
  ],
  "crawlMode": "site",
  "maxPages": 10,
  "maxDepth": 10,
  "useSitemap": true,
  "includeGlobs": [],
  "excludeGlobs": [],
  "outputFormats": [
    "markdown"
  ],
  "includeLinks": true,
  "includeImages": false,
  "removeSelectors": [],
  "keepSelectors": [],
  "monitorMode": "all",
  "stateKey": "default",
  "maxConcurrency": 5,
  "respectRobotsTxt": true,
  "proxyConfiguration": {
    "useApifyProxy": false
  }
}
```

# Actor output Schema

## `overview` (type: `string`):

One row per page: title, size, depth and change status.

## `content` (type: `string`):

URL, title and Markdown of every page.

## `metadata` (type: `string`):

Description, canonical URL, author, dates and headings.

## `allItems` (type: `string`):

Every row with every field.

## `runSummary` (type: `string`):

Counts, skipped and failed URLs, warnings, requests and duration.

# 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.apify.com/academy"
        }
    ],
    "maxPages": 10,
    "proxyConfiguration": {
        "useApifyProxy": false
    }
};

// Run the Actor and wait for it to finish
const run = await client.actor("rjmacarthy/website-content-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.apify.com/academy" }],
    "maxPages": 10,
    "proxyConfiguration": { "useApifyProxy": False },
}

# Run the Actor and wait for it to finish
run = client.actor("rjmacarthy/website-content-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.apify.com/academy"
    }
  ],
  "maxPages": 10,
  "proxyConfiguration": {
    "useApifyProxy": false
  }
}' |
apify call rjmacarthy/website-content-crawler --silent --output-dataset

```

## MCP server setup

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