# Website to Markdown Crawler: Fast, Cheap, RAG-Ready (`ctriolab/website-markdown-crawler`) Actor

Crawl any website or its sitemap and get every page as clean Markdown (menus, headers, footers, ads and scripts removed) with title, description, canonical URL and language. Optional RAG chunks, only-changed mode, robots.txt respected. $0.50 per 1,000 pages, failed pages free.

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

## Pricing

from $0.35 / 1,000 page saveds

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 to Markdown Crawler: Fast, Cheap, RAG-Ready

Turn any public website, docs site or blog into clean Markdown for LLMs, RAG pipelines, chatbots and search indexes.

- **$0.50 per 1,000 pages** (Free plan; $0.35 on Gold and up). Failed pages are free. Platform usage is billed by Apify at cost and is tiny because there is no browser.
- **Clean content only**: menus, site headers, footers, sidebars, cookie banners, ads, forms and scripts are removed. Code blocks keep their language, links and images become absolute URLs.
- **Links or sitemap**: follow links from your start URLs, read `sitemap.xml` (indexes and `.gz` included), or both.
- **RAG chunks built in**: set a chunk size and overlap and every page gets a `chunks` array, cut at paragraph or sentence boundaries.
- **Only new or changed pages**: schedule it daily and pay only for pages whose content changed.
- **Polite and safe**: robots.txt and Crawl-delay respected by default, private and local addresses blocked, no login, no proxy tricks, no CAPTCHA solving.

### How much does it cost?

| | This Actor | Typical browser-based crawler |
|---|---|---|
| 1,000 pages | **$0.50** + about $0.015 platform usage (500 pages took 99 s) | a headless browser per page, so much more compute |
| Failed pages (404, timeouts) | free | usually billed |
| Unchanged pages in monitoring mode | free | billed again |

Pricing tiers per saved page: Free $0.0005, Bronze $0.00045, Silver $0.0004, Gold, Platinum and Diamond $0.00035, plus $0.00005 per run start. Set **Max pages** or a run charge limit to cap the cost.

### Quick start

1. Add one or more **Start URLs**, for example `https://docs.apify.com/academy`.
2. Keep **Only pages under the start URL path** on to stay inside that section, or turn it off for the whole site.
3. Set **Max pages** and click **Start**. Download the results as JSON, CSV, Excel or Markdown fields through the API.

Empty input works too: it crawls 10 pages of docs.apify.com/academy as a demo.

### Example output

```json
{
  "url": "https://docs.apify.com/academy/api-scraping",
  "loadedUrl": "https://docs.apify.com/academy/api-scraping",
  "status": 200,
  "depth": 1,
  "referrerUrl": "https://docs.apify.com/academy",
  "title": "API scraping | Academy | Apify Documentation",
  "description": "Learn all about how the professionals scrape various types of APIs with various configurations, parameters, and requirements.",
  "canonicalUrl": "https://docs.apify.com/academy/api-scraping",
  "language": "en",
  "textLength": 6148,
  "wordCount": 881,
  "needsJavaScript": false,
  "markdown": "# API scraping\n\n**Learn all about how the professionals scrape various types of APIs ...**\n\n## What's an API?\n\nAn API is a custom service ...",
  "chunks": [{ "index": 0, "start": 0, "text": "# API scraping ..." }],
  "contentHash": "d3a2793035807685572f7c7604f2ebe5639be854a6915607a46097d7f86c614e",
  "changeStatus": null,
  "crawledAt": "2026-11-03T04:34:10.775Z"
}
```

`chunks` appears when a chunk size is set, `links` when Include links is on, `changeStatus` (`new` or `changed`) in monitoring mode.

### Input options

| Option | What it does |
|---|---|
| Start URLs | Where the crawl starts. Redirects and `<meta refresh>` pages are followed. |
| How to find pages | Follow links, Sitemap only, or Sitemap and links. |
| Max pages, Max link depth | Limits. Failed pages do not count. |
| Only pages under the start URL path | `/docs` keeps `/docs/...`, skips `/blog`. |
| Include and Exclude URLs (glob) | `https://example.com/docs/**`, `/blog/*`, `**/changelog{,/**}`, `**?page=*`. |
| Remove elements | Extra CSS selectors to drop. |
| RAG chunk size and overlap | 0 = off. |
| Include links | All links with text and internal or external flag. |
| Only new or changed pages, Monitor name | Saves and charges only pages that are new or changed since the last run. |
| Respect robots.txt | On by default. |
| Parallel requests, Request timeout | Speed and patience. |

### What is skipped

- **PDF links** are not downloaded. They are listed in the run's `SUMMARY` record (`pdfLinks`) so you can pass them to a PDF tool.
- Images, archives, videos and other files are ignored.
- **JavaScript-only pages**: this crawler reads the HTML the server sends and does not run a browser. If a page is empty without JavaScript (single-page apps), it is still saved with `needsJavaScript: true` so you can see it at once. Most docs, blogs, news and marketing sites are server-rendered and work well.
- Pages that fail (404, 500, timeouts, DNS errors) are not saved and not charged. They are listed in `SUMMARY.failedPages`.

### Use with AI tools

- Feed `markdown` or `chunks` into a vector database (Pinecone, Qdrant, Weaviate, pgvector) through the Apify integrations or the API.
- Call it from LangChain, LlamaIndex, n8n, Make or Zapier, or from AI agents through the Apify MCP server.
- Use `contentHash` and Only new or changed pages to re-embed only what changed.

### Your responsibility

This is a general tool that fetches the public pages you choose. You are responsible for having the right to crawl and use the content of those sites, for following their terms of service and copyright, and for personal data rules such as GDPR. The crawler identifies itself as `ctriolab-website-markdown-crawler`, respects robots.txt by default, does not log in, does not use proxies to avoid blocks and does not solve CAPTCHAs.

### Support

Questions or a site that does not convert well? Open an issue on the Actor page or write to help@ctriolab.com.

If this Actor saved you time, a short review on its Apify Store page helps other people find it. Thank you.

# Actor input Schema

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

Pages where the crawl starts. The crawler follows links on the same site (www. ignored). With an empty list the Actor crawls a small public sample (docs.apify.com/academy).

## `crawlMode` (type: `string`):

Follow links from the start URLs, read the site's sitemap.xml (from robots.txt or /sitemap.xml, sitemap indexes and .gz files included), or both. If the sitemap has no usable URL, the crawler follows links instead.

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

Stop after this many pages are read (100 when empty). Failed pages do not count and are not charged.

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

How many clicks away from a start URL the crawler goes. 0 = only the start URLs (and sitemap URLs).

## `onlyUnderStartUrl` (type: `boolean`):

On: starting at https://example.com/docs crawls /docs and /docs/... only. Off: the whole site.

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

If set, only URLs matching one of these patterns are crawled (start URLs always are). \*\* matches anything, \* anything except /, {a,b} either. A pattern without https:// is matched against the path, for example /blog/\*\*.

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

URLs matching any of these patterns are not crawled, for example **/changelog/** or \*\*?page=\*.

## `removeSelectors` (type: `string`):

Extra elements to drop from the content before conversion, for example .cookie-note, #comments. Menus, headers, footers, sidebars, forms, scripts and common ad and cookie boxes are removed anyway.

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

0 = off. Otherwise each page also gets a chunks array, split at paragraph, sentence or word boundaries, ready for embeddings.

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

Characters repeated between neighbouring chunks (at most half the chunk size).

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

Add every link on the page (URL, text, internal or external) to the result.

## `onlyNewOrChanged` (type: `boolean`):

Remember each page's content hash and save only pages that are new or changed since the last run with the same monitor name. Unchanged pages are not saved and not charged. Good for scheduled runs that keep a knowledge base fresh.

## `monitorName` (type: `string`):

Separate memory for each crawl you schedule. Used only with Only new or changed pages.

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

On by default: URLs disallowed by the site's robots.txt are skipped, Crawl-delay is honoured (up to 10 s) and rel=nofollow links are not followed. Turn off only for sites you own or may crawl.

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

Pages fetched at the same time.

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

Give up on a page after this many seconds (it is retried twice, then reported as failed and not charged).

## Actor input object example

```json
{
  "startUrls": [
    {
      "url": "https://docs.apify.com/academy"
    }
  ],
  "crawlMode": "links",
  "maxPages": 10,
  "maxDepth": 20,
  "onlyUnderStartUrl": true,
  "includeUrlGlobs": [],
  "excludeUrlGlobs": [],
  "chunkSize": 0,
  "chunkOverlap": 200,
  "includeLinks": false,
  "onlyNewOrChanged": false,
  "monitorName": "default",
  "respectRobotsTxt": true,
  "maxConcurrency": 5,
  "requestTimeoutSecs": 30
}
```

# Actor output Schema

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

One item per saved page: URL, title, description, canonical URL, language, Markdown and optional chunks and links.

## `summary` (type: `string`):

Counts, failed pages (not charged), URLs blocked by robots.txt, skipped PDF links and why the crawl stopped.

# 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"
        }
    ],
    "maxPages": 10,
    "includeUrlGlobs": [],
    "excludeUrlGlobs": []
};

// Run the Actor and wait for it to finish
const run = await client.actor("ctriolab/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": [{ "url": "https://docs.apify.com/academy" }],
    "maxPages": 10,
    "includeUrlGlobs": [],
    "excludeUrlGlobs": [],
}

# Run the Actor and wait for it to finish
run = client.actor("ctriolab/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": [
    {
      "url": "https://docs.apify.com/academy"
    }
  ],
  "maxPages": 10,
  "includeUrlGlobs": [],
  "excludeUrlGlobs": []
}' |
apify call ctriolab/website-markdown-crawler --silent --output-dataset

```

## MCP server setup

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