# Website to Markdown for LLM & RAG (Fast, Lightweight) (`agebreak/website-to-markdown`) Actor

Convert web pages or whole websites into clean Markdown for ChatGPT, LLM fine-tuning and RAG. Main-content extraction, chunking with token estimates, respects robots.txt, no browser needed.

- **URL**: https://apify.com/agebreak/website-to-markdown.md
- **Developed by:** [age break](https://apify.com/agebreak) (community)
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $1.00 / 1,000 page converteds

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

## Website to Markdown for LLM & RAG

Convert any web page, or a whole website, into **clean Markdown** for ChatGPT, Claude, custom GPTs, fine-tuning and **RAG vector databases**. Navigation, headers, footers, cookie banners and ads are removed. Headings, lists, tables, code blocks and links are kept. Optional **chunking with token estimates** gives you ready-to-embed pieces.

### Why use this actor

- **Main-content extraction**: no menus or footers in your embeddings.
- **Built-in chunking** on paragraph boundaries with overlap, plus a token estimate per page and per chunk.
- Lightweight HTTP crawler: much cheaper and faster than browser-based crawlers for static and server-rendered sites.
- Crawl mode with include/exclude regex (e.g. only `/docs/`), depth and page limits.
- Respects robots.txt and flags pages that look JavaScript-rendered instead of returning empty junk.

### Use cases

- Build a RAG chatbot over product docs or a help center.
- Create LLM fine-tuning or evaluation datasets from websites.
- Give an AI agent clean page content (works well with Apify MCP).
- Archive articles as Markdown in Notion or Obsidian.

### How to use

1. Click **Try for free** and fill in the input (or paste the JSON below into the JSON tab).
2. Click **Start**. Small runs finish in seconds.
3. Download the results as **JSON, CSV, Excel or HTML**, or get them through the **Apify API**, webhooks, Make, Zapier, n8n or the Apify MCP server for AI agents.
4. Optional: **schedule** the actor to run daily or weekly for monitoring.

#### Input example

```json
{
  "startUrls": [
    {
      "url": "https://crawlee.dev/js/docs/quick-start"
    }
  ],
  "crawlLinks": true,
  "maxPages": 50,
  "includeUrlPatterns": [
    "/js/docs/"
  ],
  "chunkSizeTokens": 800
}
```

#### Output example

```json
{
  "url": "https://crawlee.dev/js/docs/quick-start",
  "title": "Quick Start | Crawlee",
  "wordCount": 800,
  "tokenEstimate": 1990,
  "markdown": "# Quick Start\n\nWith this short tutorial you can start scraping ...\n\n## Choose your crawler\n...",
  "chunks": [
    {
      "index": 0,
      "text": "...",
      "tokenEstimate": 790
    }
  ]
}
```

### Limits

No browser: pages that render their content only with JavaScript come back with an error saying so (try Apify's Website Content Crawler for those). The token estimate is about 4 characters per token.

### Pricing

Pay per event: **$1.00 per 1,000 pages converted**. Skipped or failed pages are free.

Apify's free plan includes monthly platform credit, which is enough to try this actor at no cost.

### Is it legal?

This actor only reads **publicly available** data, without logging in. The crawler respects robots.txt and paces requests per host. It does not collect personal data by default. You are responsible for using the results in line with the source's terms and with laws such as the GDPR.

### Built with AI assistance

This actor was built with AI assistance (Claude by Anthropic). A human operator reviews and publishes it. It was tested with real inputs before release. If something breaks or you need a feature, please open an issue on the **Issues** tab.

### Related actors and keywords

website to markdown, html to markdown, url to markdown api, llm ready data, rag web scraper, firecrawl alternative, jina reader alternative, web page to text for chatgpt

# Actor input Schema

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

Pages to convert. Turn on 'Follow links' to crawl the site from these URLs.

## `crawlLinks` (type: `boolean`):

Follow links (crawl the site).

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

Max pages.

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

Max link depth.

## `includeUrlPatterns` (type: `array`):

e.g. /docs/

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

Skip URLs matching (regex).

## `extractMainContent` (type: `boolean`):

Remove navigation, headers, footers, sidebars, cookie banners and ads.

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

Keep links.

## `keepImages` (type: `boolean`):

Keep images.

## `chunkSizeTokens` (type: `integer`):

Split each page into chunks of about this many tokens on paragraph boundaries.

## `chunkOverlapTokens` (type: `integer`):

Chunk overlap (tokens).

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

Skip pages with fewer words than.

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

Respect robots.txt.

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

Parallel requests.

## Actor input object example

```json
{
  "startUrls": [
    {
      "url": "https://docs.apify.com/academy/web-scraping-for-beginners"
    }
  ],
  "crawlLinks": false,
  "maxPages": 20,
  "maxDepth": 2,
  "extractMainContent": true,
  "keepLinks": true,
  "keepImages": false,
  "chunkSizeTokens": 0,
  "chunkOverlapTokens": 50,
  "minWords": 20,
  "respectRobotsTxt": true,
  "maxConcurrency": 5
}
```

# Actor output Schema

## `results` (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/web-scraping-for-beginners"
        }
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("agebreak/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": [{ "url": "https://docs.apify.com/academy/web-scraping-for-beginners" }] }

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

```

## MCP server setup

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