# Website Content Crawler: Markdown for AI & RAG (`api_creators/website-content-crawler`) Actor

Crawl websites and save each page's main content as clean Markdown and text, with metadata, sitemaps, llms.txt and RAG chunks. For LLMs, AI agents, vector databases and knowledge bases. Fast HTTP crawler, no browser.

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

## Pricing

from $0.60 / 1,000 page or files

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

## Website Content Crawler: Markdown for AI & RAG

Website Content Crawler crawls any website and saves the **main content of every page as clean Markdown and plain text**, with title, description, language, canonical URL, Open Graph and JSON-LD metadata. It drops menus, footers, cookie banners and pop-ups, so the output is ready for **LLMs, RAG pipelines, vector databases, custom GPTs, AI agents and knowledge bases**.

It's a fast HTTP crawler with no headless browser, so it crawls hundreds of pages per minute and costs a fraction of browser-based crawlers.

### What can Website Content Crawler do?

- 🕸️ **Crawl whole sites or sections.** Start from any URL and follow links below it, with depth, page and pattern limits.
- 🗺️ **Find every page.** Optionally read **sitemaps** (including sitemap indexes and `.xml.gz`) and **`/llms.txt`** files to find pages that aren't linked.
- 🧹 **Main content only.** Mozilla Readability extracts the article; navigation, footers, scripts, banners and cookie consent pop-ups are removed. You can also keep or remove your own CSS selectors.
- 📝 **Markdown that keeps structure.** Headings, lists, tables, links, images and fenced code blocks are preserved.
- ✂️ **RAG chunks built in.** Split each page into chunks of a chosen size and overlap, ready for embeddings.
- ♻️ **Incremental updates.** Crawl only pages changed since a date, using sitemap dates, `Last-Modified` and `304` responses.
- 📎 **Linked files.** Download PDFs, Word, Excel, PowerPoint and CSV files linked from pages.
- 🔁 **No duplicates.** Pages are de-duplicated by canonical URL and redirects; tracking parameters are ignored.
- 🛡️ **Built-in proxies.** Datacenter IPs first, residential IPs only for sites that block them. No setup needed.

### What data does it extract?

| Field | Description |
|---|---|
| `url` | The page URL |
| `crawl.loadedUrl`, `crawl.depth`, `crawl.referrerUrl`, `crawl.httpStatusCode`, `crawl.loadedTime` | How and when the page was crawled |
| `metadata.title`, `metadata.description`, `metadata.author`, `metadata.keywords` | Page metadata |
| `metadata.languageCode`, `metadata.canonicalUrl` | Language and canonical URL |
| `metadata.openGraph`, `metadata.jsonLd` | Open Graph tags and structured data (JSON-LD) |
| `metadata.headers` | HTTP response headers |
| `markdown` | Main content as Markdown |
| `text` | Main content as plain text |
| `chunks` | Markdown split into chunks (optional) |
| `html` / `htmlUrl` | Cleaned content HTML, in the dataset or as a file (optional) |
| `fileUrl` | Link to a downloaded document (for file results) |
| `crawl.warning` | Set when a page needs JavaScript to show its content (see FAQ) |

### How do I crawl a website for AI or RAG?

1. Enter one or more **Start URLs**, e.g. `https://docs.example.com/`.
2. Optionally turn on **Load URLs from sitemaps** and set **Max pages**.
3. Click **Start**. Each page appears in the dataset as it's crawled.
4. Export the results as JSON, CSV or Excel, or connect them to LangChain, LlamaIndex, Pinecone, Qdrant or a custom GPT through Apify integrations.

The crawler stays inside the start URL's path: `https://example.com/blog` covers `/blog/post-1` but not `/pricing`. Add **Include URL patterns** to go wider, or **Exclude URL patterns** to skip sections.

#### Input example

```json
{
    "startUrls": [{ "url": "https://developer.mozilla.org/en-US/docs/Web/HTML" }],
    "maxCrawlPages": 500,
    "maxCrawlDepth": 3,
    "useSitemaps": false,
    "excludeUrlGlobs": [{ "glob": "https://developer.mozilla.org/**/contributors.txt" }],
    "splitIntoChunks": true,
    "chunkSize": 1500
}
```

#### Output example

Real result (text shortened):

```json
{
    "url": "https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Global_attributes",
    "crawl": {
        "loadedUrl": "https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Global_attributes",
        "loadedTime": "2026-11-20T14:25:20.850Z",
        "referrerUrl": "https://developer.mozilla.org/en-US/docs/Web/HTML",
        "depth": 1,
        "httpStatusCode": 200
    },
    "metadata": {
        "canonicalUrl": "https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Global_attributes",
        "title": "Global attributes - HTML | MDN",
        "description": "Global attributes are attributes common to all HTML elements; they can be used on all elements, though they may have no effect on some elements.",
        "author": null,
        "keywords": null,
        "languageCode": "en-US",
        "openGraph": [],
        "jsonLd": [],
        "headers": { "content-type": "text/html", "last-modified": "Fri, 20 Nov 2026 13:12:38 GMT" }
    },
    "screenshotUrl": null,
    "text": "Global attributes are attributes common to all HTML elements; they can be used on all elements, though they may have no effect on some elements.\nGlobal attributes may be specified on all HTML elements…",
    "markdown": "# Global attributes - HTML | MDN\n\n**Global attributes** are attributes common to all HTML elements; they can be used on all elements, though they may have no effect on some elements.\n\nGlobal attributes may be specified on all [HTML elements](https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements), _even those not specified in the standard_…"
}
```

A run summary (pages per minute, traffic, skipped and failed URLs) is saved in the key-value store as `SUMMARY`.

### How much does it cost to crawl a website?

You pay per saved page or file. Pages skipped as duplicates, failed pages and blocked pages are free.

| Plan | Price per 1,000 pages |
|---|---|
| Free | $1.00 |
| Bronze | $0.80 |
| Silver | $0.70 |
| Gold, Platinum, Diamond | $0.60 |

Crawling 10,000 documentation pages costs **$6–10**. Set **Max pages** or a maximum cost per run to stay within budget.

### How do I use it from code?

**Python**

```python
from apify_client import ApifyClient

client = ApifyClient("<YOUR_API_TOKEN>")
run = client.actor("api_creators/website-content-crawler").call(run_input={
    "startUrls": [{"url": "https://docs.example.com/"}],
    "useSitemaps": True,
    "maxCrawlPages": 1000,
})
for page in client.dataset(run["defaultDatasetId"]).iterate_items():
    print(page["url"], len(page["markdown"]))
```

**JavaScript**

```javascript
import { ApifyClient } from 'apify-client';

const client = new ApifyClient({ token: '<YOUR_API_TOKEN>' });
const run = await client.actor('api_creators/website-content-crawler').call({
    startUrls: [{ url: 'https://docs.example.com/' }],
    splitIntoChunks: true,
});
const { items } = await client.dataset(run.defaultDatasetId).listItems();
console.log(items[0].chunks);
```

### What can I use it for?

- **RAG and chatbots:** load documentation, help centers or blogs into a vector database so a chatbot answers from your content.
- **Custom GPTs and AI assistants:** export a whole site as a knowledge file.
- **AI agents:** give an agent clean page text instead of raw HTML, which uses far fewer tokens.
- **LLM fine-tuning and evaluation datasets.**
- **Content audits and migrations:** get every page's title, description, canonical URL and text in one table.
- **Change monitoring:** re-crawl only pages changed since the last run.

### Is it compatible with Apify's Website Content Crawler?

Yes, for the HTTP options. The input fields and output fields have the same names (`startUrls`, `includeUrlGlobs`, `maxCrawlDepth`, `htmlTransformer`, `removeElementsCssSelector`, `url`, `crawl`, `metadata`, `text`, `markdown`, …), so existing inputs and pipelines work unchanged. Browser-only options (waiting, scrolling, clicking, screenshots) and AI summaries aren't available, because this crawler doesn't run a browser.

### FAQ

**Does it render JavaScript?**
No. It reads the HTML the server sends, which covers documentation, blogs, news, help centers and most company sites. Single-page apps that build all their content in the browser come back nearly empty; those pages get a `crawl.warning`, so you can spot them.

**Will it get blocked?**
Most sites are fine. Sites behind strict bot protection (CAPTCHAs or JavaScript challenges) are skipped rather than forced: the crawler never solves CAPTCHAs. Such pages are listed under `failedUrls` in the run summary and cost nothing.

**Does it crawl pages behind a login?**
No. It crawls public pages only.

**How do I avoid crawling the whole internet?**
The crawler never leaves the start URL's path unless you add **Include URL patterns**. **Max pages**, **Max crawling depth** and **Max results** cap a run.

**Can I crawl only the pages I list?**
Yes: set **Max crawling depth** to `0` and put all URLs in **Start URLs**, or link a text file with one URL per line.

**Is web crawling legal?**
Crawling publicly available pages is generally legal, but you're responsible for how you use the content, including copyright and personal data under GDPR and similar laws. Turn on **Respect robots.txt** to follow site owners' crawling rules.

Need a feature or found a problem? Open an issue on the **Issues** tab.

# Actor input Schema

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

Websites to crawl. The crawler saves each start URL and the pages below it (same address path), so `https://example.com/blog` also covers `https://example.com/blog/my-post`. Use "Include URL patterns" to reach pages outside that path. You can also upload a text file or link a URL list.

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

Read the site's sitemaps (from robots.txt or /sitemap.xml) to find pages that aren't linked from the start URL. Only pages within the crawl scope are added. Recommended for documentation and blog sites.

## `useLlmsTxt` (type: `boolean`):

Read the `/llms.txt` file of each site (an index of pages written for AI tools) and the Markdown files it links to.

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

Extra URL patterns to crawl beyond the start URLs' paths, e.g. `https://example.com/docs/**`. Applies to links found on pages.

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

URL patterns never to crawl, e.g. `https://example.com/**/*?page=*` or `**/tag/**`. Exclusions win over inclusions.

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

How many links away from a start URL to go. Start URLs have depth 0, pages they link to depth 1, and so on. 0 crawls only the start URLs (plus sitemap and llms.txt pages, if enabled).

## `maxCrawlPages` (type: `integer`):

The most pages to crawl in this run, including pages skipped as duplicates. With several start URLs, the limit is shared equally between them, so one big site can't use it all up. Use it to cap the cost of a run.

## `maxResults` (type: `integer`):

The most pages and files to save. The run stops when it is reached.

## `onlyCrawlPagesModifiedSince` (type: `string`):

A date (YYYY-MM-DD or YYYY-MM-DDTHH:mm:ssZ). Pages whose sitemap date, Last-Modified header or 304 response says they haven't changed since then are skipped. Start URLs are always crawled. Handy for keeping a knowledge base up to date.

## `respectRobotsTxtFile` (type: `boolean`):

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

## `keepUrlFragments` (type: `boolean`):

Keep the `#…` part of URLs when deciding whether two links are the same page. Turn on only for sites that route pages by fragment.

## `ignoreCanonicalUrl` (type: `boolean`):

By default, a page whose canonical URL was already saved is skipped as a duplicate. Turn this on if a site reports wrong canonical URLs and pages go missing.

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

Leave on "No proxy" to use the built-in proxies: fast datacenter IPs first, switching a site to residential IPs only if it blocks datacenter. Choose Apify Proxy or your own proxy URLs to use those instead.

## `customHttpHeaders` (type: `object`):

Extra HTTP headers to send with every request, e.g. `{"Accept-Language": "de-DE"}`.

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

How many pages to load at once across all sites. At most 6 run at once on any single site.

## `requestTimeoutSecs` (type: `integer`):

How long to wait for one page to download.

## `maxRequestRetries` (type: `integer`):

How many times to retry a page after a network or server error. Each attempt already tries both proxy types.

## `ignoreHttpsErrors` (type: `boolean`):

Load pages even when their SSL certificate is invalid or expired.

## `htmlTransformer` (type: `string`):

How to find the main content. **Readable text** keeps the article and drops menus, sidebars and footers, which is best for docs, blogs and news. **If possible** falls back to the cleaned page for product pages, listings and home pages. **None** keeps everything that remains after removing the elements below.

## `readableTextCharThreshold` (type: `integer`):

The least text a block must have for Readability to treat it as content.

## `removeElementsCssSelector` (type: `string`):

Elements removed before the content is extracted. The default drops navigation, footers, scripts, banners and pop-ups. Set it to a selector that matches nothing (e.g. `dummy_keep_everything`) to keep everything.

## `keepElementsCssSelector` (type: `string`):

If set, only elements matching this selector are kept, e.g. `article, .docs-content`. Applied after the removal above.

## `removeCookieWarnings` (type: `boolean`):

Drop common cookie-consent banners (OneTrust, Cookiebot, Didomi, Usercentrics, and others) from the content.

## `aggressivePrune` (type: `boolean`):

Drop lines that already appeared on earlier pages of the crawl, such as repeated menus, banners and calls to action. May occasionally remove a repeated sentence that matters.

## `saveMarkdown` (type: `boolean`):

Save the content as Markdown in the `markdown` field, with headings, lists, tables, links and code blocks kept.

## `splitIntoChunks` (type: `boolean`):

Also save the Markdown split into chunks (`chunks` field) on paragraph boundaries, ready for embeddings and vector databases.

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

Approximate size of each chunk.

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

How many characters from the end of one chunk to repeat at the start of the next.

## `saveHtml` (type: `boolean`):

Also save the cleaned content HTML in the `html` field.

## `saveHtmlAsFile` (type: `boolean`):

Save each page's cleaned content HTML as a file and put its link in the `htmlUrl` field. Better than the dataset for large pages.

## `saveFiles` (type: `boolean`):

Download documents linked from the crawled pages (PDF, Word, Excel, PowerPoint, CSV, and others matching the content types below) to the key-value store, each saved as a result with a `fileUrl`. Files are downloaded even when they sit outside the crawl scope.

## `saveContentTypes` (type: `string`):

Comma-separated content types for "Save linked files"; wildcards allowed, e.g. `application/pdf, image/*`.

## Actor input object example

```json
{
  "startUrls": [
    {
      "url": "https://docs.apify.com/academy/scraping-basics-javascript"
    }
  ],
  "useSitemaps": false,
  "useLlmsTxt": false,
  "includeUrlGlobs": [],
  "excludeUrlGlobs": [],
  "maxCrawlDepth": 20,
  "maxCrawlPages": 9999999,
  "maxResults": 9999999,
  "onlyCrawlPagesModifiedSince": "",
  "respectRobotsTxtFile": true,
  "keepUrlFragments": false,
  "ignoreCanonicalUrl": false,
  "proxyConfiguration": {
    "useApifyProxy": false
  },
  "customHttpHeaders": {},
  "maxConcurrency": 20,
  "requestTimeoutSecs": 60,
  "maxRequestRetries": 3,
  "ignoreHttpsErrors": false,
  "htmlTransformer": "readableText",
  "readableTextCharThreshold": 100,
  "removeElementsCssSelector": "nav, footer, script, style, noscript, svg, img[src^='data:'],\n[role=\"alert\"],\n[role=\"banner\"],\n[role=\"dialog\"],\n[role=\"alertdialog\"],\n[role=\"region\"][aria-label*=\"skip\" i],\n[aria-modal=\"true\"]",
  "removeCookieWarnings": true,
  "aggressivePrune": false,
  "saveMarkdown": true,
  "splitIntoChunks": false,
  "chunkSize": 1500,
  "chunkOverlap": 0,
  "saveHtml": false,
  "saveHtmlAsFile": false,
  "saveFiles": false,
  "saveContentTypes": "application/pdf, application/msword, application/vnd.openxmlformats-officedocument.*, text/csv"
}
```

# Actor output Schema

## `pages` (type: `string`):

No description

## `summary` (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://docs.apify.com/academy/scraping-basics-javascript"
        }
    ],
    "includeUrlGlobs": [],
    "excludeUrlGlobs": [],
    "respectRobotsTxtFile": true,
    "proxyConfiguration": {
        "useApifyProxy": false
    },
    "customHttpHeaders": {},
    "removeElementsCssSelector": `nav, footer, script, style, noscript, svg, img[src^='data:'],
[role="alert"],
[role="banner"],
[role="dialog"],
[role="alertdialog"],
[role="region"][aria-label*="skip" i],
[aria-modal="true"]`,
    "saveContentTypes": "application/pdf, application/msword, application/vnd.openxmlformats-officedocument.*, text/csv"
};

// Run the Actor and wait for it to finish
const run = await client.actor("api_creators/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/scraping-basics-javascript" }],
    "includeUrlGlobs": [],
    "excludeUrlGlobs": [],
    "respectRobotsTxtFile": True,
    "proxyConfiguration": { "useApifyProxy": False },
    "customHttpHeaders": {},
    "removeElementsCssSelector": """nav, footer, script, style, noscript, svg, img[src^='data:'],
[role=\"alert\"],
[role=\"banner\"],
[role=\"dialog\"],
[role=\"alertdialog\"],
[role=\"region\"][aria-label*=\"skip\" i],
[aria-modal=\"true\"]""",
    "saveContentTypes": "application/pdf, application/msword, application/vnd.openxmlformats-officedocument.*, text/csv",
}

# Run the Actor and wait for it to finish
run = client.actor("api_creators/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/scraping-basics-javascript"
    }
  ],
  "includeUrlGlobs": [],
  "excludeUrlGlobs": [],
  "respectRobotsTxtFile": true,
  "proxyConfiguration": {
    "useApifyProxy": false
  },
  "customHttpHeaders": {},
  "removeElementsCssSelector": "nav, footer, script, style, noscript, svg, img[src^='\''data:'\''],\\n[role=\\"alert\\"],\\n[role=\\"banner\\"],\\n[role=\\"dialog\\"],\\n[role=\\"alertdialog\\"],\\n[role=\\"region\\"][aria-label*=\\"skip\\" i],\\n[aria-modal=\\"true\\"]",
  "saveContentTypes": "application/pdf, application/msword, application/vnd.openxmlformats-officedocument.*, text/csv"
}' |
apify call api_creators/website-content-crawler --silent --output-dataset

```

## MCP server setup

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