# Website Crawler to Markdown for AI & RAG (`librevlad/website-crawler-markdown`) Actor

Crawl a website or docs section into clean Markdown for LLMs and RAG. Follows links in scope, reads sitemaps and PDFs, respects robots.txt. $1 per 1,000 pages.

- **URL**: https://apify.com/librevlad/website-crawler-markdown.md
- **Developed by:** [Владислав Новік](https://apify.com/librevlad) (community)
- **Categories:** AI, Developer tools, Automation
- **Features:** Limited permissions
- **Stats:** 1 total users, 0 monthly users, 0.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $1.00 / 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/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 Crawler to Markdown for AI & RAG

**Pricing:** $1.00 per 1,000 pages, one Markdown document per page. Failed pages, robots.txt skips and duplicates are free.

Crawl a website, a docs section or a blog into clean Markdown and plain text, one dataset row per page, ready for LLMs, RAG pipelines, vector databases and AI agents. Menus, ads and footers are removed; headings, lists, tables, code blocks and (if you want) links and images stay. Reads HTML pages and PDF files.

### What it does

- Starts from one or more URLs and follows links level by level (breadth-first).
- Stays on the start site and, by default, inside the start URL's path: `https://site.com/docs/` crawls only `/docs/...` pages. `www.site.com` and `site.com` count as the same site.
- Can also take page URLs from the site's sitemap: `<start path>/sitemap.xml`, the `Sitemap:` lines of robots.txt and `/sitemap.xml`, including sitemap index files.
- Include and exclude URL patterns, a page limit and a link depth limit.
- If a start URL redirects (to `https://`, `www.` or `/en/latest/`), the crawl continues from the address it lands on.
- The same page under two addresses (after a redirect, or `/docs/` and `/docs/index.html` with the same text) is returned and charged once.

### Who is it for

- **RAG and support bots over documentation**: crawl `https://docs.yourproduct.com/` and load the Markdown into your vector store.
- **LLM context**: give a model a whole docs section or knowledge base as Markdown instead of raw HTML and save tokens.
- **Content audits and migrations**: titles, word counts and link depth for every page; broken links come back as `error` rows.

### Input

| Field | Description | Default |
|---|---|---|
| `startUrls` | Where the crawl starts: a site, a docs section or a single page (required). | — |
| `maxPages` | Stop after this many pages in total, 1-10000. | `100` |
| `maxDepth` | How many clicks away from the start URL to follow links (0 = only the start pages). | `3` |
| `sameDomainOnly` | Follow only links on the start URL's site. | `true` |
| `stayInPath` | Crawl only pages under the start URL's path. Turn off to crawl the whole site. | `true` |
| `includeUrlGlobs` | Crawl only URLs matching one of these patterns, e.g. `https://site.com/blog/*`. | — |
| `excludeUrlGlobs` | Skip URLs matching any of these patterns, e.g. `*/tag/*`. | — |
| `useSitemap` | Also take pages from the site's sitemap (inside the same scope). | `false` |
| `outputFormat` | `markdown`, `text` or `both`. | `both` |
| `includeLinks` | Keep hyperlinks in the Markdown. | `true` |
| `includeImages` | Keep image references in the Markdown. | `false` |
| `maxConcurrency` | Pages read at the same time, 1-10. | `3` |
| `respectRobotsTxt` | Do not read pages that robots.txt disallows. | `true` |

```json
{
  "startUrls": ["https://docs.python.org/3/tutorial/"],
  "maxPages": 50,
  "maxDepth": 2,
  "outputFormat": "markdown"
}
```

### Output

One dataset row per page:

```json
{
  "url": "https://docs.python.org/3/tutorial/interpreter.html",
  "finalUrl": "https://docs.python.org/3/tutorial/interpreter.html",
  "status": "ok",
  "depth": 1,
  "title": "2. Using the Python Interpreter",
  "markdown": "# 2. Using the Python Interpreter\n\n## 2.1. Invoking the Interpreter\n\nThe Python interpreter is usually installed as `/usr/local/bin/python3.15`...",
  "text": null,
  "wordCount": 914,
  "contentType": "text/html",
  "fetchedAt": "2026-11-27T20:15:00Z",
  "error": null
}
```

`status` is `ok`, `error` (the page could not be read, for example a broken link) or `skipped` (a start URL that robots.txt disallows). `depth` is the number of clicks from the start URL. The run's status message sums it up: pages, errors, robots.txt skips and duplicates. PDFs: text from the first 50 pages.

### Pricing

**$1.00 per 1,000 pages** (event `page`). You pay only for rows with status `ok`. Errors, robots.txt skips and duplicate pages are free. A 300-page docs site costs $0.30.

Set a spending limit for the run if you like: when it is reached, the crawl stops and returns nothing beyond the limit.

### Good manners and limits

- robots.txt is respected by default. Pages it disallows are not read; for start URLs you get a `skipped` row, deeper links are only counted in the status message and do not use up `maxPages`.
- Crawl only sites you have the right to crawl: you are responsible for how you use the content and for following each site's terms of use. The Actor never logs in, sends no cookies and does not get around paywalls, CAPTCHAs or other protection.
- It identifies itself honestly: User-Agent `website-crawler-markdown/0.1 (Apify actor; +https://apify.com/librevlad/website-crawler-markdown)`; the robots.txt token is `website-crawler-markdown`.
- 3 pages at a time by default, at most 10, to keep the load on the site low.
- JavaScript is not executed: the Actor reads the HTML the server sends. That keeps it fast and cheap for documentation, blogs and help centers; pages that render content only in the browser may come back empty.
- Limits: 3 MB per HTML page, 15 MB per PDF, about 25 seconds per page. Private, local and internal network addresses are blocked.

### FAQ

**Only a few pages instead of the whole site?** By default the crawl stays inside the start URL's path. Start from the site root or turn off `stayInPath`, and raise `maxDepth` or `maxPages`. On sites with few links between pages, turn on `useSitemap`.

**Why fewer pages than `maxPages`?** `maxPages` counts every page taken into the crawl, including pages that failed. The site may also simply have fewer pages in scope.

**I have a list of URLs, not a site.** Put them into `startUrls` and set `maxDepth` to 0, or use [Website to Markdown for AI](https://apify.com/librevlad/website-to-markdown).

**Am I charged for errors?** No, only for rows with status `ok`.

**Scanned PDFs?** No OCR: only PDFs with a text layer give text.

**How do I chunk and index the output?** See [docs-to-rag](https://github.com/librevlad/docs-to-rag), an open-source example that splits the Markdown at headings without cutting code blocks and loads the chunks into Chroma. Its `crawl_apify.py` runs this Actor and saves the pages for the next steps.

### More actors from the same developer

Pay only for results, no logins:

- [Website to Markdown](https://apify.com/librevlad/website-to-markdown) — turn a list of pages and PDFs into clean Markdown or text.
- [Website Screenshot & PDF](https://apify.com/librevlad/page-screenshot-pdf) — full-page and mobile screenshots, URL to PDF.
- [YouTube Transcript Scraper](https://apify.com/librevlad/youtube-transcripts-fast) — transcripts as plain text, timestamped segments or SRT.
- [YouTube Search & Channel Videos](https://apify.com/librevlad/youtube-search-channel-videos) — search results and every video of a channel.
- [YouTube Shorts Scraper](https://apify.com/librevlad/youtube-shorts-scraper-fast) — Shorts from keyword search and from channels' Shorts tab.
- [App Store Scraper](https://apify.com/librevlad/app-store-scraper) — app details, keyword search positions and reviews from Apple's public API.
- [Google Trends Scraper](https://apify.com/librevlad/google-trends-scraper-fast-cheap) — interest over time, interest by region and related queries.
- [Threads Scraper](https://apify.com/librevlad/threads-scraper) — public Threads posts and profiles without login.

# Actor input Schema

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

Where the crawl starts: a site, a docs section or a single page. The crawl stays on these sites (and, by default, inside the start URL's path). One address per line.

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

Stop after this many pages in total (1-10000). You pay only for pages returned successfully.

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

How many clicks away from the start URL to follow links (0 = only the start pages).

## `sameDomainOnly` (type: `boolean`):

Follow only links on the start URL's host.

## `stayInPath` (type: `boolean`):

For https://site.com/docs/ crawl only /docs/... pages. Turn off to crawl the whole site.

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

Optional. Crawl only URLs matching at least one pattern, e.g. https://site.com/blog/\*

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

Optional. Skip URLs matching any pattern, e.g. */tag/*

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

Also take pages from the site's /sitemap.xml (inside the same scope).

## `outputFormat` (type: `string`):

Which fields to fill: Markdown, plain text, or both.

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

Keep hyperlinks in the Markdown output.

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

Keep image references in the Markdown output.

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

How many pages are read at the same time (1-10). Keep it low to be gentle with the site.

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

Skip pages that the site's robots.txt does not allow. Recommended.

## Actor input object example

```json
{
  "startUrls": [
    "https://docs.python.org/3/tutorial/"
  ],
  "maxPages": 100,
  "maxDepth": 3,
  "sameDomainOnly": true,
  "stayInPath": true,
  "useSitemap": false,
  "outputFormat": "both",
  "includeLinks": true,
  "includeImages": false,
  "maxConcurrency": 3,
  "respectRobotsTxt": true
}
```

# Actor output Schema

## `overview` (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.python.org/3/tutorial/"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("librevlad/website-crawler-markdown").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.python.org/3/tutorial/"] }

# Run the Actor and wait for it to finish
run = client.actor("librevlad/website-crawler-markdown").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.python.org/3/tutorial/"
  ]
}' |
apify call librevlad/website-crawler-markdown --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,librevlad/website-crawler-markdown"
        }
    }
}
```

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/qgTR1isYlzSzfJzud/builds/7AxY1eGvrX9ZoAGvm/openapi.json
