# Website Content Crawler - Clean Markdown for LLM & RAG (`lanternlab318/website-content-crawler`) Actor

- **URL**: https://apify.com/lanternlab318/website-content-crawler.md
- **Developed by:** [Lantern Lab](https://apify.com/lanternlab318) (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.99 / 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 Content Crawler - Clean Markdown for LLM & RAG

Crawl any public website and get every page's **main content as clean Markdown and plain text**, with its **title, meta description, language, canonical URL and the time it was crawled**. Navigation, headers, footers, cookie banners, scripts and forms are removed, so the text is ready for an LLM prompt, a vector database or a RAG pipeline.

Pages are read over **plain HTTP first** - fast and cheap. A **real browser is used only when a page needs JavaScript** to show its content, and you pay the browser price only when the browser actually got more text.

**Price:** $0.99 per 1,000 pages read over HTTP, $2.99 per 1,000 pages that needed a browser, plus $0.005 per run. One price per page, whatever the page size or how long the site takes to answer. Failed pages, blocked pages, duplicate pages and the run summary are free.

### Why this crawler

- **A predictable bill.** You pay per page written, not for compute time. `maxPages` is a hard limit: the crawl stops at that number and never writes or charges one page more.
- **Errors are never charged.** A 404, a 500, a timeout, a bot-check page, a PDF link or a page with no text produces a free `failed_page` row that says why - it is not silently dropped and not billed.
- **No duplicates.** A page reached through a redirect, a canonical URL, a tracking parameter (`utm_*`, `gclid`...) or with identical content is written once.
- **Honest run status.** The run summary says whether the crawl is `complete`, stopped at `maxPages` (`limit_reached`), `partial` (some pages failed, or a request/charge cap was hit) or `blocked`.

### Quick example

Input:

```json
{
  "startUrls": [{ "url": "https://crawlee.dev/js/docs/introduction" }],
  "maxPages": 50,
  "useSitemaps": false,
  "renderingMode": "auto"
}
```

One page row (`recordType: "page"`, shortened):

```json
{
  "recordType": "page",
  "url": "https://crawlee.dev/js/docs/quick-start",
  "loadedUrl": "https://crawlee.dev/js/docs/quick-start",
  "canonicalUrl": "https://crawlee.dev/js/docs/quick-start",
  "title": "Quick Start | Crawlee for JavaScript",
  "description": "With this short tutorial you can start scraping with Crawlee in a minute or two.",
  "language": "en",
  "markdown": "# Quick Start\n\nWith this short tutorial you can start scraping with Crawlee in a minute or two. To learn in-depth how Crawlee works, read the [Introduction](https://crawlee.dev/js/docs/introduction)...\n\n## Choose your crawler\n...",
  "text": "Quick Start\n\nWith this short tutorial you can start scraping with Crawlee in a minute or two...",
  "textLength": 5526,
  "renderMode": "http",
  "httpStatus": 200,
  "depth": 1,
  "referrerUrl": "https://crawlee.dev/js/docs/introduction",
  "discoveredVia": "link",
  "crawledAt": "2026-10-30T12:40:18.803Z"
}
```

### Input

| Field | Default | What it does |
| --- | --- | --- |
| `startUrls` | - | Where the crawl starts. Links are followed only to pages **under each start URL's path** (`https://example.com/docs` crawls `/docs/...`, not the rest of the site), unless you set `includeUrlGlobs`. |
| `maxPages` | 100 | Hard limit on pages written and charged. |
| `useSitemaps` | false | Also queue the in-scope pages listed in the site's sitemaps (from `robots.txt`, or `/sitemap.xml`; sitemap indexes are followed). |
| `maxCrawlDepth` | 20 | How many links away from a start URL the crawl may go. `0` reads only the start URLs. |
| `includeUrlGlobs` | - | Only follow links matching these patterns (`*` = anything but `/`, `**` = anything). Replaces the "under the start URL" rule. |
| `excludeUrlGlobs` | - | Never follow links matching these patterns. Always wins over include patterns. |
| `renderingMode` | `auto` | `auto`: HTTP first, browser only when the HTTP copy has fewer than `minTextLength` characters of text. `http`: never a browser. `browser`: every page in a browser. |
| `minTextLength` | 200 | In `auto` mode, the text length under which a page is retried in a browser. |
| `respectRobotsTxt` | true | Skip URLs that the site's `robots.txt` disallows. |
| `maxConcurrency` | 10 | Pages read at the same time (at most 3 browser pages at once). |
| `maxRequests` | derived | Hard ceiling on every request the run sends (pages, browser renders, retries, robots.txt, sitemaps). Left empty, it is worked out from `maxPages`. |
| `proxyConfiguration` | Apify datacenter proxy | Switch to residential proxies for sites that block datacenter IPs. |

### Output

The dataset holds three kinds of rows, told apart by `recordType`:

- **`page`** - one per page read. Charged. Fields: `url` (the URL as queued, normalized), `loadedUrl` (after redirects), `canonicalUrl`, `title`, `description`, `language` (from the page's `lang` attribute), `markdown`, `text`, `textLength`, `renderMode` (`http` or `browser` - which price was charged), `httpStatus`, `depth`, `referrerUrl` (the page the link was found on), `discoveredVia` (`start`, `link` or `sitemap`) and `crawledAt`.
- **`failed_page`** - one per page that was fetched but gave nothing usable. Free. `failureReason` is one of `http_error`, `blocked` (HTTP 401/403/407/429 or a bot-check page; `blocked: true`), `network_error`, `not_html`, `empty_content`, `redirected_out_of_scope` (the URL redirected, over HTTP or in the browser, to a page outside the crawl's site or globs) or `robots_disallowed` (start URLs only), with `httpStatus` and a short `detail`.
- **`RUN_SUMMARY`** - the last row, also saved as the `RUN_SUMMARY` record in the run's key-value store: `collectionStatus`, `partial`, pages written by rendering, failed pages by reason, duplicates skipped, URLs found but not visited, sitemap URLs found, requests sent and why the crawl stopped.

Values a page does not provide (no meta description, no `lang` attribute) are `null`, never guessed.

For an LLM or RAG pipeline, keep the rows where `recordType` is `page` and use `markdown` (or `text`) with `url` and `title` as metadata.

### What it does not do

- **No CAPTCHA solving and no login.** Only content a visitor sees without signing in is read. Pages behind a bot check are reported as `blocked`, not bypassed.
- **No file parsing.** Links to PDFs, Office documents, images and other files are not downloaded; a start URL that is one is reported as `not_html`.
- **No chunking or embeddings.** You get one clean document per page; split and embed it in your own pipeline.
- **No images.** Images are removed from the Markdown; links are kept as absolute URLs.

### Tips

- Crawl a documentation section, not a whole domain: start at `https://example.com/docs` and the crawl stays there.
- Turn on `useSitemaps` for sites whose pages are not all linked from each other.
- Use `renderingMode: "http"` when you know the site is server-rendered and want the lowest price.
- Set the run's maximum charge in Apify Console as an extra safety net; the crawl stops when it is reached and keeps everything written so far.

# Actor input Schema

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

Where the crawl starts. By default it follows links only to pages under each start URL's path: https://example.com/docs crawls /docs and everything below it, not the rest of the site. Use "Include URLs" to widen or change that.

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

Hard limit on page rows written and charged. The crawl stops at this number; pages that fail, are blocked or are duplicates do not count towards it and are never charged.

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

Also queue the in-scope pages listed in the site's sitemaps (from robots.txt, or /sitemap.xml), so pages no link points to are found too. Sitemap indexes are followed.

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

How many links away from a start URL (or a sitemap page) the crawl may go. 0 reads only the start URLs.

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

Optional. Only links matching one of these patterns are followed, instead of the default "under the start URL" rule. `*` matches anything except `/`, `**` matches anything. Example: https://example.com/blog/\*\*.

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

Optional. Links matching any of these patterns are never followed. Example: **/changelog/** or https://example.com/\*/tag/\*\*.

## `renderingMode` (type: `string`):

auto (recommended): read every page over plain HTTP, and open a real browser only when the HTTP copy has too little text (JavaScript-built pages). The browser price is charged only when the browser copy actually has more text. http: never use a browser (cheapest, fastest). browser: read every page in a browser.

## `minTextLength` (type: `integer`):

In auto mode, a page whose HTTP copy has fewer characters of main text than this is retried in a browser.

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

Skip URLs the site's robots.txt disallows for all crawlers.

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

How many pages are read at the same time. Lower it for small or slow sites. At most 3 browser pages run at once whatever this is set to.

## `maxRequests` (type: `integer`):

Optional hard ceiling on all requests the run sends: pages, browser renders, retries, robots.txt and sitemap files. Leave empty and the Actor works one out from maxPages (about 2.5 requests per page), so a run is never unbounded. At the ceiling the crawl stops and the run summary says so.

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

Apify Proxy datacenter IPs by default. Switch to residential IPs for sites that block datacenter traffic.

## Actor input object example

```json
{
  "startUrls": [
    {
      "url": "https://crawlee.dev/js/docs/introduction"
    }
  ],
  "maxPages": 100,
  "useSitemaps": false,
  "maxCrawlDepth": 20,
  "renderingMode": "auto",
  "minTextLength": 200,
  "respectRobotsTxt": true,
  "maxConcurrency": 10,
  "proxyConfiguration": {
    "useApifyProxy": true
  }
}
```

# Actor output Schema

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

No description

## `runSummary` (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": [
        {
            "url": "https://crawlee.dev/js/docs/introduction"
        }
    ],
    "proxyConfiguration": {
        "useApifyProxy": true
    }
};

// Run the Actor and wait for it to finish
const run = await client.actor("lanternlab318/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://crawlee.dev/js/docs/introduction" }],
    "proxyConfiguration": { "useApifyProxy": True },
}

# Run the Actor and wait for it to finish
run = client.actor("lanternlab318/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://crawlee.dev/js/docs/introduction"
    }
  ],
  "proxyConfiguration": {
    "useApifyProxy": true
  }
}' |
apify call lanternlab318/website-content-crawler --silent --output-dataset

```

## MCP server setup

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