# Website Content Crawler: Site Change Monitor, RAG Chunks (`datahamster/website-content-crawler`) Actor

Website content crawler with a site change monitor: every scheduled run reports the new, changed and removed pages of a whole site as clean Markdown. Crawls links and sitemaps, returns Markdown or text per page with token counts and token-limited RAG chunks with stable ids. Failed pages are free.

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

## Pricing

from $0.16 / 1,000 result items

This Actor is paid per event and usage. You are charged both the fixed price for specific events and for Apify platform usage.
Since this Actor supports Apify Store discounts, the price gets lower the higher subscription plan you have.

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: Site Change Monitor, RAG Chunks

Watch a whole website and get told which pages are new, which changed and which were removed. Every run crawls the site through its links and sitemaps, compares each page's main text with the last run and returns only the differences, as clean Markdown ready for an LLM or a RAG index. Run it once without monitor mode and you get every page as Markdown or text, optionally cut into token-limited chunks with stable ids.

**Try it:** the prefilled example (10 pages of the Python standard library docs, chunked at 512 tokens) returns 10 rows in about 10 seconds and costs about $0.003 at the default 1024 MB ($0.002 for results plus $0.0007 of platform usage). Results cost $0.20 per 1,000 pages plus platform usage.

Coverage: public pages without login. JavaScript is rendered only for pages that need it. PDFs need a text layer (no OCR).

### Why this one

- **Whole-site change monitor.** Schedule a crawl in monitor mode and every run returns only pages that are `new`, `changed` (main text changed) or `removed` (a page from an earlier run now answers 404/410 or redirects elsewhere). Re-flowed markup and whitespace do not count as a change. Known pages the crawl no longer reaches are fetched directly, least recently seen first, so a page that lost its last link is still checked. Apify's Website Content Crawler has an incremental option that skips pages the site reports as unmodified since a date; it does not label pages new or changed and has no list of removed pages.
- **RAG chunks with stable ids.** Set `chunkMaxTokens` and each page also comes with `chunks`: text cut at section and paragraph boundaries, at most N tokens each (GPT-4o tokenizer), with the heading path and a `chunkId` that stays the same while the chunk's text stays the same. Upsert changed ids and delete vanished ones instead of re-embedding the site. Apify's crawler has no chunking option.
- **Token count and boilerplate score per page.** `tokenCount` tells you what a page costs in context, `boilerplateRatio` how much of the visible text was removed as menus, footers and banners. Apify's crawler returns neither.
- **Sitemaps on by default**, including sitemap indexes and `.gz` files. Pages that only the sitemap knows about are marked `foundVia: "sitemap"`.
- **One page, one row.** Canonical URLs and redirects are returned once; in a normal crawl pages with identical text (`/page/1/` and `/`) are too.
- **Failed pages are free rows** with an `error` field (`HTTP 404`, `blocked ...`). A site that blocks every request ends with `emptyReason: "blocked"` in the run summary.

### Pricing

- **Result:** $0.0002 per page returned (SILVER $0.00018, GOLD and above $0.00016). Failed pages and duplicates are free.
- **Monitor:** $0.005 per monitor run plus $0.001 per new, changed or removed page returned.
- **Platform usage** is paid by you on top: about $0.07 to $0.10 per 1,000 static pages at the default 1024 MB, measured on the platform. Browser-rendered pages and proxies cost more.

Apify's Website Content Crawler has no per-page fee: you pay only its platform usage. Its README estimates about $0.20 per 1,000 pages with the raw HTTP crawler and $0.50 to $5 per 1,000 pages with a headless browser (its default crawler types are browser based). This actor charges $0.20 per 1,000 pages on top of usage, so a static crawl comes to about $0.27 to $0.30 per 1,000 pages. For a one-off plain HTTP crawl Apify's crawler is cheaper by that fee, and its browser modes cost more than this actor. The monitor is what this actor is built for, with the chunks and per-page metrics on top.

### What you get

Real rows from test runs on the platform (06.11.2026):

| page | found via | tokens | chunks (512) | boilerplate removed | fetched with |
|---|---|---|---|---|---|
| docs.python.org/3/library/intro.html | link | 1,500 | 4 | 16% | plain HTTP, no proxy |
| docs.python.org/3/library/re.html | link | 18,161 | 43 | 6% | plain HTTP, no proxy |
| crawlee.dev/python/docs/0.6/deployment/apify-platform | sitemap | 2,716 | 24 | 14% | plain HTTP, no proxy |
| quotes.toscrape.com/js/page/2/ (built by JavaScript) | link | 630 | | 16% | browser, picked automatically |
| g2.com/categories/crm with `proxyTier: "none"` | start | | | | free row `blocked (HTTP 403) on tier none`, run ends `blocked` |

One row from the example dataset (Markdown and chunk text cut here for space):

```json
{
  "url": "https://docs.python.org/3/library/intro.html",
  "statusCode": 200,
  "pageStatus": "ok",
  "title": "Introduction — Python 3.15.2 documentation",
  "language": "en",
  "documentType": "html",
  "markdown": "# Introduction\n\nThe Python standard library consists of a collection of modules. ...",
  "chunks": [
    {"chunkId": "1bd2baf89201b051", "index": 0, "text": "# Introduction\n\nThe Python standard library consists of ...", "tokenCount": 339, "headings": ["Introduction"]},
    {"chunkId": "9e6483b93a95f0a1", "index": 1, "text": "## Notes on availability\n\n- An “Availability: Unix” note means ...", "tokenCount": 147, "headings": ["Introduction", "Notes on availability"]}
  ],
  "chunkCount": 4,
  "textLength": 6714,
  "wordCount": 1089,
  "tokenCount": 1500,
  "pageTextLength": 7940,
  "boilerplateRatio": 0.156,
  "textHash": "364b2071df079f6dd5dd74c402153e08",
  "extractor": "trafilatura",
  "tierUsed": "none",
  "fetchMode": "http",
  "depth": 1,
  "foundVia": "link",
  "linkedFrom": "https://docs.python.org/3/library/",
  "error": null
}
```

Full row: `url`, `finalUrl`, `statusCode`, `pageStatus` (ok, removed), `redirectedTo`, `title`, `description`, `language`, `canonicalUrl`, `documentType` (html, pdf, docx, text), `markdown`, `text`, `chunks`, `chunkCount`, `textLength`, `wordCount`, `tokenCount`, `tokenizer`, `truncated`, `pageTextLength`, `boilerplateRatio`, `pageCount`, `links`, `images`, `contentType`, `contentHash`, `textHash`, `extractor`, `tierUsed`, `fetchMode`, `depth`, `foundVia` (start, link, sitemap, recheck), `linkedFrom`, `fetchedAt`, `error`. Monitor rows add `changeType`, `changedFields` and `previous`.

### Monitor mode

Save a task with

```json
{"mode": "monitor", "monitorStateId": "docs-site", "startUrls": [{"url": "https://docs.example.com/"}], "maxPages": 500}
```

and schedule it. The first run records every page and charges nothing per page. Each later run returns:

- `changeType: "new"` for a page in scope that no earlier run saw;
- `changeType: "changed"` when the page's main text changed, with the old `textHash` in `previous`;
- `changeType: "removed"` with `pageStatus: "removed"` when a known page answers 404 or 410, or redirects to another URL (`redirectedTo`). It is reported once; if the page comes back it is reported as changed.

Test on the platform with a four-page site: the baseline recorded 4 pages; after one page's price was edited, the home page got a new link, one page changed only its whitespace and one page was deleted, the next run returned exactly 4 rows (2 changed, 1 new, 1 removed) and skipped the whitespace-only page; a third run returned nothing (`no_new_items`).

How big a site fits: set `maxPages` above the number of pages in scope. A run crawls up to `maxPages` pages, then re-checks up to `maxPages` known pages it did not reach, least recently seen first; `recheckBacklog` in the run summary says how many are left for later runs. On the platform a static page takes about 0.5 s, so `maxPages: 500` is roughly 5 minutes of crawling plus up to 5 minutes of re-checks. The default run timeout is 1 hour; a run that gets close to its timeout stops starting pages, keeps what it read and saves the monitor state (`crawlCut: "deadline"` in the summary).

Each run costs one `monitor-check` ($0.005), each returned page one `change` ($0.001). Pages that fail with a wall or a 5xx are skipped and compared again next time. Changing the start URLs, scope, `maxPages`, `maxDepth`, globs or `useSitemaps` starts a new baseline. If a monitor run is killed, the next runs of the same state wait for its timeout and end as `overlapping_run`; give the task a new `monitorStateId` to start over. `webhookUrl` or a Telegram bot get a summary of each run with changes.

### Input

| Field | Meaning | Default |
|---|---|---|
| `startUrls` | Where the crawl starts; several sites per run are fine | Python library docs |
| `crawlScope` | `subpath`: only pages under the start URL's folder; `domain`: the whole host | `subpath` |
| `maxPages`, `maxDepth` | Page budget per run (failed pages included) and link depth | `50`, `5` |
| `useSitemaps` | Read robots.txt sitemaps, sitemap indexes, `.gz` | `true` |
| `includeUrlGlobs`, `excludeUrlGlobs` | Glob filters for links and sitemap pages, `**` and `{a,b}` work | empty |
| `formats` | `markdown`, `text` or both | `markdown` |
| `chunkMaxTokens` | Cut pages into chunks of at most N tokens | off (`512` in the example) |
| `maxTokensPerPage` | Cut each page to N tokens | no limit |
| `renderJs`, `waitFor` | `auto` (browser only for JavaScript app shells), `never`, `always` | `auto` |
| `documents` | Read linked PDF and DOCX files in scope | `true` |
| `includeLinks`, `includeImages` | Keep links and images and list them per row | `false` |
| `proxyTier`, `proxyCountry` | `auto` steps from no proxy up to Web Unblocker on blocks | `auto` |
| `concurrency`, `domainDelaySecs`, `timeout` | Parallel pages, pause per site, timeout per page | `5`, `0.25`, `45` |
| `maxItems` | Stop after this many successful pages; `maxPages` is the real budget | no limit (`10` in the example) |
| `mode`, `monitorStateId`, `webhookUrl`, `telegramBotToken`, `telegramChatId` | Monitor mode and alerts | `scrape` |

Login, account, cart and checkout paths are never followed.

### Memory

The default is 1024 MB because a page that needs JavaScript opens a headless browser (peak about 770 MB). Static sites peak at 200 to 340 MB, so with `renderJs: "never"` they run fine on 512 MB.

### Limits

- No login, cookies or forms: only what an anonymous visitor sees.
- One run crawls at most `maxPages` pages. In monitor mode `maxPages` must cover the whole site in scope: a page the baseline never reached is reported as `new` the first time a later run finds it.
- Re-checks of known pages the crawl missed are spread over several runs when there are more of them than `maxPages`.
- PDFs without a text layer come back as a free row with an error (no OCR). Other binaries are skipped.
- Token counts use the o200k_base tokenizer (GPT-4o, GPT-4.1); other models count a little differently.
- A page is "changed" only when its main text changes: an edit inside a menu or footer that the extractor drops is not reported.

### Changelog

- 0.1 (2026-11-06): first release: whole-site monitor with new, changed and removed pages, crawl with links and sitemaps, Markdown/text, RAG chunks with stable ids, token count and boilerplate score.

### Related actors

- [Web Fetch API](https://apify.com/datahamster/web-fetch-api) fetches a list of URLs (pages, PDFs, DOCX) as Markdown, also as a Standby HTTP API.
- [Website to Markdown](https://apify.com/datahamster/website-to-markdown) is the simpler crawler: Markdown per page with links and images.
- [Protected Page Change Monitor](https://apify.com/datahamster/protected-page-fetch-monitor) extracts one CSS selector or regex from protected pages and alerts on changes.

If this actor saved you time, a short review on its Store page helps others find it.

# Actor input Schema

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

Where the crawl starts, e.g. "https://docs.python.org/3/library/". With the default scope only pages under the start URL's folder are crawled (here /3/library/). Several sites per run are fine.

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

subpath: only links under the start URL's folder (start https://x.com/docs/ crawls /docs/...). domain: every page on the same host (www. ignored).

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

Most pages fetched in one run, failed pages included, e.g. 10. In monitor mode it also caps how many known pages the crawl did not reach are re-checked.

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

How many clicks away from a start URL to follow links, e.g. 5. 0 = only the start URLs (plus sitemap pages). Pages from sitemaps count as depth 1.

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

Also read the site's sitemaps (Sitemap: lines in robots.txt, else /sitemap.xml; sitemap indexes and .gz files work) to find pages no link points to. Sitemap pages obey the same scope and globs.

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

Only follow links matching one of these globs, e.g. "https://docs.example.com/guide/\*\*". {a,b} works. Start URLs are always fetched.

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

Never follow links matching these globs, e.g. "https://example.com/**/changelog/**".

## `formats` (type: `array`):

markdown (headings, lists, tables, code kept), text (no markup) or both.

## `chunkMaxTokens` (type: `integer`):

Also cut each page into chunks of at most this many tokens (GPT-4o tokenizer), e.g. 512. Sections (#, ##, ###) start a new chunk; each chunk gets a stable chunkId (same text = same id across runs), its heading path and its token count. Empty = no chunks.

## `maxTokensPerPage` (type: `integer`):

Cut each page's Markdown/text to this many tokens, e.g. 8000. Empty = no limit.

## `renderJs` (type: `string`):

auto opens a headless browser only for pages whose HTML is an empty JavaScript shell.

## `waitFor` (type: `string`):

With the browser: wait until this selector appears, e.g. "main article".

## `documents` (type: `boolean`):

Turn linked PDF and Word DOCX files in scope into text (no OCR).

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

Keep link URLs in the Markdown and list every link of the page in `links`.

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

Keep images in the Markdown and list them in `images`.

## `proxyTier` (type: `string`):

auto starts without a proxy and steps up to datacenter, residential and Web Unblocker only on a site that blocks; the working tier is remembered per site.

## `proxyCountry` (type: `string`):

Two-letter country for proxy exits, e.g. "US". Empty = any.

## `concurrency` (type: `integer`):

Pages fetched at the same time.

## `domainDelaySecs` (type: `number`):

Minimum gap between two requests to the same site.

## `timeout` (type: `integer`):

Give up on a page after this long.

## `maxItems` (type: `integer`):

Stop after this many successful pages (failed pages are free and do not count), e.g. 10. maxPages is the crawl budget; leave this at the default to return every page the crawl reads.

## `mode` (type: `string`):

scrape = full results; monitor = only new/changed items since the previous run of this task

## `monitorStateId` (type: `string`):

Optional state id when not running as a saved task (monitor mode)

## `webhookUrl` (type: `string`):

POST a change summary here in monitor mode

## `telegramBotToken` (type: `string`):

Optional: bot token for monitor-mode change summaries

## `telegramChatId` (type: `string`):

Optional: chat id that receives monitor-mode summaries

## Actor input object example

```json
{
  "startUrls": [
    {
      "url": "https://docs.python.org/3/library/"
    }
  ],
  "crawlScope": "subpath",
  "maxPages": 10,
  "maxDepth": 5,
  "useSitemaps": true,
  "includeUrlGlobs": [],
  "excludeUrlGlobs": [],
  "formats": [
    "markdown"
  ],
  "chunkMaxTokens": 512,
  "renderJs": "auto",
  "documents": true,
  "includeLinks": false,
  "includeImages": false,
  "proxyTier": "auto",
  "concurrency": 5,
  "domainDelaySecs": 0.25,
  "timeout": 45,
  "maxItems": 10,
  "mode": "scrape"
}
```

# Actor output Schema

## `results` (type: `string`):

All pushed rows (dataset, JSON)

## `resultsTable` (type: `string`):

Dataset in the Console viewer

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

RUN_SUMMARY record

# 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/library/"
        }
    ],
    "maxPages": 10,
    "chunkMaxTokens": 512,
    "maxItems": 10
};

// Run the Actor and wait for it to finish
const run = await client.actor("datahamster/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.python.org/3/library/" }],
    "maxPages": 10,
    "chunkMaxTokens": 512,
    "maxItems": 10,
}

# Run the Actor and wait for it to finish
run = client.actor("datahamster/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.python.org/3/library/"
    }
  ],
  "maxPages": 10,
  "chunkMaxTokens": 512,
  "maxItems": 10
}' |
apify call datahamster/website-content-crawler --silent --output-dataset

```

## MCP server setup

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