# Website Content Crawler for AI: Markdown & RAG, $1 per 1K Pages (`spokentext/website-markdown-crawler`) Actor

Crawl any website into clean Markdown for LLMs, RAG and AI agents: main content only, no menus, footers or cookie banners, with title, description, language and optional chunks. Follows links and the sitemap. $0.001 per page.

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

## Pricing

from $0.80 / 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.
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

### What is Website Content Crawler for AI?

**Website Content Crawler for AI** turns any website into **clean Markdown** ready for LLMs, RAG pipelines, AI agents and chatbots. Give it a site, a section or single pages; it follows the links and the sitemap, and for every page returns:

- the **main content as Markdown**: headings, lists, tables and links kept; **menus, headers, footers, sidebars, cookie banners and scripts removed**
- the page's **title, description and language**
- optional **chunks** of the size you choose, split on paragraph boundaries with overlap, ready for embeddings
- the word count, link depth and crawl time

It is built for developers and teams who feed websites to AI: knowledge bases and support bots built from documentation, RAG over company websites, AI agents that need web context, and LLM fine-tuning datasets.

### Why use it?

- **$1 per 1,000 pages.** Other per-page crawlers charge about $2.70 to $3 per 1,000 pages; compute-billed crawlers make the cost hard to predict.
- **Fast:** 200 documentation pages in under a minute.
- **Clean text, fewer tokens:** only the main content, so your embeddings and prompts are not full of menus and footers.
- **RAG chunks built in:** set a chunk size and overlap, and each page also comes split for your vector database.
- **Finds every page:** follows links and reads the sitemap, within the scope you choose: a section, the whole site, or only the URLs you list.
- **Polite by default:** respects robots.txt.
- **Pay only for saved pages.** Pages with almost no text and pages that fail are free.

Because it runs on Apify, you also get scheduling (re-crawl your docs every week), API access, integrations (Make, Zapier, n8n, LangChain, LlamaIndex, Pinecone, Google Sheets) and exports to JSON, CSV or Excel.

### How to use it

1. Enter one or more **websites or pages**: `https://docs.example.com`, `https://example.com/blog`...
2. Choose **what to crawl**: the start URL and the pages under it, the whole website, or only the start URLs.
3. Set the **maximum pages**, and a **chunk size** if you build a RAG index (2,000 characters is a good start).
4. Click **Start**, then open the **Output** tab or export the results.

### How much does it cost?

**$0.001 per saved page** at the Bronze tier, less at Silver and Gold.

| Usage | Cost (Bronze) |
|---|---|
| A 200-page documentation site | $0.20 |
| 10 websites of 100 pages | $1 |
| 5,000 pages re-crawled every week for a month | $20 |

Set the run's maximum charge to cap spending: the crawler stops before exceeding it.

### Input example

```json
{
    "startUrls": ["https://docs.apify.com"],
    "crawlScope": "domain",
    "maxPages": 200,
    "useSitemap": true,
    "chunkSize": 2000,
    "chunkOverlap": 200
}
```

| Field | Meaning |
|---|---|
| `startUrls` | Websites, sections or pages to start from |
| `crawlScope` | `path`: the start URL and the pages under it; `domain`: the whole website; `page`: only the start URLs |
| `maxPages` | Pages saved in all, up to 10,000 |
| `maxDepth` | How many clicks away from a start URL a page can be |
| `useSitemap` | Also crawl the pages listed in sitemap.xml, inside the scope |
| `chunkSize`, `chunkOverlap` | Split each page into chunks of about this many characters, with this overlap (0 = no chunks) |
| `excludeUrlPatterns` | Skip URLs containing any of these texts |
| `removeSelectors` | Extra CSS selectors to remove from every page |
| `keepLinks` | Keep links in the Markdown, or only their text |
| `minWords` | Pages with fewer words are skipped and not charged |
| `respectRobotsTxt` | Skip pages robots.txt disallows |

### Output example

A real result from docs.apify.com, captured on 2026-11-18 (Markdown and chunks shortened):

```json
{
    "url": "https://docs.apify.com/academy/build-and-publish/how-to/actorization",
    "status": "ok",
    "statusCode": 200,
    "title": "Wrap open-source as an Actor | Academy | Apify Documentation",
    "description": "...",
    "language": "en",
    "depth": 1,
    "wordCount": 1665,
    "markdown": "# Wrap open-source as an Actor\n\n...",
    "chunks": ["# Wrap open-source as an Actor\n\n...", "..."],
    "startUrl": "https://docs.apify.com/",
    "crawledAt": "2026-11-18T21:30:00.000Z"
}
```

| Field | Meaning |
|---|---|
| `markdown` | The page's main content as Markdown |
| `chunks` | The same content split for RAG, when a chunk size is set |
| `title`, `description`, `language` | The page's metadata |
| `wordCount`, `depth` | Words of main content, and clicks from the start URL (sitemap pages count as 1) |

### Use cases

- **Support and documentation chatbots:** crawl your docs and help center into a vector database.
- **RAG over websites:** give an LLM the content of a company, product or competitor website.
- **AI agents:** fetch clean context for an agent from any set of pages.
- **LLM datasets:** collect clean text from sites you are allowed to use.
- **Content audits and migrations:** export a whole site's text as Markdown.

### FAQ

#### Does it run JavaScript?

No. It reads the HTML the server sends, which is fast and cheap and works for most documentation, blogs, news and company sites. Pages that only show their text after JavaScript runs come back with almost no text; they are skipped and not charged.

#### How are menus and footers removed?

The crawler keeps the page's main content (its main or article element when there is one) and removes navigation, headers, footers, sidebars, cookie banners, forms and scripts, plus any CSS selectors you add.

#### What chunk size should I use?

2,000 characters (about 400 to 500 tokens) with a 200-character overlap suits most embedding models. Smaller chunks give more precise retrieval; larger ones keep more context.

#### Can I crawl only part of a site?

Yes. With "the start URL and the pages under it", starting from `https://example.com/docs` only crawls `/docs/...`. Use **Skip URLs containing** to leave out parts such as `/tag/` or `/login`.

#### Is it allowed to crawl a website?

You decide which websites to crawl; check their terms and use content you are allowed to use. The crawler respects robots.txt by default and does not log in anywhere.

### Limits

- Up to 10,000 pages per run.
- No JavaScript rendering; pages behind a login are not crawled.
- Websites that block automated visits return an error for their start URL, and nothing is charged.

### Other Actors you may find useful

| Actor | What it does |
|---|---|
| [Website Technology Detector](https://apify.com/spokentext/website-tech-detector) | The CMS, frameworks and tools a website runs on |
| [Broken Link Checker](https://apify.com/spokentext/broken-link-checker) | Broken links and 404 errors on a website |
| [Google News Scraper](https://apify.com/spokentext/google-news-scraper) | Fresh news articles with their real URLs |

### Run it from the API

```python
from apify_client import ApifyClient

client = ApifyClient("YOUR_TOKEN")
run = client.actor("spokentext/website-markdown-crawler").call(run_input={
    "startUrls": ["https://docs.example.com"],
    "crawlScope": "domain",
    "maxPages": 500,
    "chunkSize": 2000,
})
for page in client.dataset(run["defaultDatasetId"]).iterate_items():
    for chunk in page.get("chunks", []):
        print(page["url"], len(chunk))
```

### Feedback

Something failed or gave a wrong result? Open an issue in the **Issues** tab of this page, with the URL and what you expected: every report is read and fixed. If the crawler saved you time, a rating helps others find it.

# Actor input Schema

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

One URL per line: a site (https://docs.example.com), a section (https://example.com/blog) or single pages.

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

Pages saved in all, up to 10,000. Each saved page is charged, so this caps the cost of the run.

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

"Under it": https://example.com/docs takes /docs/... only. "Whole website": every page of the same host.

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

How many clicks away from a start URL a page can be.

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

Add the pages listed in the website's sitemap.xml, inside the chosen scope: it finds pages that menus do not link to.

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

0 keeps one Markdown text per page. Set e.g. 2000 to also get the page split into chunks of about that size, on paragraph boundaries, ready for embeddings.

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

Characters repeated from the previous chunk at the start of the next one, so that no idea is cut in two.

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

Pages whose URL contains any of these texts are not crawled: /tag/, /login, ?page=...

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

Extra parts to remove from every page, e.g. .newsletter-box or #comments. Menus, headers, footers, sidebars and cookie banners are removed already.

## `keepLinks` (type: `boolean`):

Turn off to keep the link text only, for shorter texts.

## `minWords` (type: `integer`):

Pages with fewer words (empty shells, redirect pages) are skipped and not charged.

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

Skip pages the website's robots.txt asks crawlers not to visit.

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

Lower it for small websites that slow down under load.

## Actor input object example

```json
{
  "startUrls": [
    "https://docs.apify.com/platform/actors"
  ],
  "maxPages": 10,
  "crawlScope": "path",
  "maxDepth": 5,
  "useSitemap": true,
  "chunkSize": 0,
  "chunkOverlap": 200,
  "keepLinks": true,
  "minWords": 20,
  "respectRobotsTxt": true,
  "maxConcurrency": 10
}
```

# Actor output Schema

## `pages` (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/platform/actors"
    ],
    "maxPages": 10
};

// Run the Actor and wait for it to finish
const run = await client.actor("spokentext/website-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/platform/actors"],
    "maxPages": 10,
}

# Run the Actor and wait for it to finish
run = client.actor("spokentext/website-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/platform/actors"
  ],
  "maxPages": 10
}' |
apify call spokentext/website-markdown-crawler --silent --output-dataset

```

## MCP server setup

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