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

Crawls a website or one section of it and returns every page as clean Markdown (main content only) with title, description, language and dates, ready for LLMs, vector databases and RAG. Include and exclude URL patterns, robots.txt respected. $0.0005 per page.

- **URL**: https://apify.com/aolmo/website-to-markdown.md
- **Developed by:** [Antonio del Olmo Tena](https://apify.com/aolmo) (community)
- **Categories:** AI, Developer tools
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $0.50 / 1,000 page crawleds

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

Turn a whole website, or one section of it, into clean Markdown for your LLM, chatbot or RAG index. Give a start URL such as a documentation site, a blog or a help center, and the Actor crawls its pages and returns each one as Markdown with the main content only, plus title, description, language and dates. Limit the crawl to a section, include or exclude URL patterns, and schedule it to get only the pages that are new or changed.

No browser: the Actor fetches pages over plain HTTP and converts them with a fast HTML-to-Markdown engine that keeps headings, lists, tables, code blocks and absolute links. robots.txt is respected. You pay $0.0005 per page with content.

### What you get

One Dataset row per page:

- `url`, `title`, `description`, `markdown`, and `text` with **Include plain text**.
- `wordCount`, `language`, `author`, `publishedAt`, `modifiedAt`, `canonical`, `linksCount`.
- `truncated` when the page was cut at **Max characters per page**, `likelyJsRendered` when it needs JavaScript and little text was found.
- `contentHash` and `changeStatus` (`new` or `changed` compared with the previous run of the same start URL).

Pages without text (for example apps that need JavaScript) are returned but not charged.

### How to use it

1. Open the **Input** tab.
2. In **Start URLs** paste one per line: `https://docs.apify.com/platform`, `https://yourcompany.com/blog`.
3. Set **Max pages per start URL** (default 50, up to 500).
4. Keep **Stay within the start URL** on to crawl only that section, or use **Include URL patterns** and **Exclude URL patterns** with `*` as a wildcard (for example `*/docs/guides/*`, `*/changelog*`).
5. Click **Start** and export the rows as JSON or CSV, or send them to your vector database with an Apify integration.
6. To keep a knowledge base fresh, schedule the Actor; filter the rows by `changeStatus` to re-index only what changed.

### Input

```json
{
  "startUrls": ["https://crawlee.dev/js/docs/quick-start"],
  "maxPages": 100,
  "stayInPath": true,
  "includePatterns": ["*/docs/guides/*", "*/docs/quick-start*"],
  "excludePatterns": ["*/changelog*"],
  "mainContent": true,
  "maxChars": 30000,
  "includeText": false
}
```

| Field | Description |
|-------|-------------|
| `startUrls` | Websites or sections. Up to 50 per run. |
| `maxPages` | Pages per start URL, 1 to 500. Default 50. |
| `stayInPath` | Only pages under the start URL. Default on; include patterns take precedence. |
| `includePatterns`, `excludePatterns` | URL patterns with `*` wildcards. |
| `mainContent` | Remove navigation, footers and banners. Default on. |
| `maxChars` | Characters per page, 1,000 to 200,000. Default 30,000. |
| `includeText` | Also return plain text. Default off. |

### Output example

```json
{
  "startUrl": "https://crawlee.dev/js/docs/quick-start",
  "url": "https://crawlee.dev/js/docs/guides/configuration",
  "title": "Configuration | Crawlee for JavaScript",
  "description": "Configuring Crawlee parameters",
  "markdown": "# Configuration\n\nAll the configuration options can be set with environment variables...",
  "wordCount": 912,
  "language": "en",
  "author": null,
  "publishedAt": null,
  "modifiedAt": null,
  "canonical": "https://crawlee.dev/js/docs/guides/configuration",
  "truncated": false,
  "likelyJsRendered": false,
  "linksCount": 84,
  "contentHash": "4f7c...",
  "changeStatus": null,
  "timestamp": "2026-10-08T12:00:00.000Z"
}
```

### Pricing

Pay per event, no subscription:

- **Page crawled**: $0.0005 per page with content. A 200-page documentation site costs $0.10.
- **Page changed**: $0.001 per page that is new or changed in a scheduled run.

Compare with website content crawlers at $3 per 1,000 pages, or browser-based crawling at $5 per 1,000 pages in platform usage.

### Use it as an API

```bash
curl -X POST "https://api.apify.com/v2/acts/aolmo~website-to-markdown/run-sync-get-dataset-items?token=YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"startUrls": ["https://docs.apify.com/platform"], "maxPages": 50}'
```

You can also call it from AI agents through the Apify MCP server. For a single page use `aolmo/page-to-markdown`; to search the web first, `aolmo/rag-web-search`.

### FAQ

**Does it render JavaScript?** No. It reads the HTML the server sends, which covers documentation sites, blogs and most company websites. Single-page apps that render everything with JavaScript return little text (`likelyJsRendered: true`) and are not charged.

**Does it follow links to other domains?** No, only pages of the start URL's website.

**Does it respect robots.txt?** Yes. Disallowed pages are skipped.

**How long does a crawl take?** Roughly 1 to 3 seconds per 10 pages, depending on the website.

**Where is the data stored between runs?** In a Key-Value Store of your account named `micro-saas-state-website-to-markdown`, one key per start URL. Delete it to start fresh.

# Actor input Schema

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

Website or section to crawl, one per line, e.g. https://docs.apify.com/platform. Only pages of the same site are followed.

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

Also caps what you pay per start URL.

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

Only follow pages under the start URL (for https://site.com/docs only /docs pages). Ignored when you set include patterns.

## `includePatterns` (type: `array`):

Optional. Only crawl URLs matching one of these patterns; \* is a wildcard, e.g. */docs/guides/*

## `excludePatterns` (type: `array`):

Optional. Skip URLs matching any of these patterns, e.g. */changelog* or */tag/*

## `mainContent` (type: `boolean`):

Removes menus, footers, cookie banners and sidebars from each page.

## `maxChars` (type: `integer`):

Longer pages are cut at a paragraph boundary (truncated: true).

## `includeText` (type: `boolean`):

Adds the plain-text version of each page next to the Markdown.

## `product` (type: `string`):

Internal. Leave as is.

## Actor input object example

```json
{
  "startUrls": [
    "https://crawlee.dev/js/docs/guides/"
  ],
  "maxPages": 50,
  "stayInPath": true,
  "includePatterns": [],
  "excludePatterns": [],
  "mainContent": true,
  "maxChars": 30000,
  "includeText": false,
  "product": "website-to-markdown"
}
```

# Actor output Schema

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

Dataset items: url, changed, events, data, timestamp and error (when the target failed).

# 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://crawlee.dev/js/docs/guides/"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("aolmo/website-to-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://crawlee.dev/js/docs/guides/"] }

# Run the Actor and wait for it to finish
run = client.actor("aolmo/website-to-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://crawlee.dev/js/docs/guides/"
  ]
}' |
apify call aolmo/website-to-markdown --silent --output-dataset

```

## MCP server setup

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