# Website to Markdown for AI & RAG – Fast Crawler + llms.txt (`realletoangt/web-to-markdown`) Actor

Turn any website or list of URLs into clean, LLM-ready Markdown. Removes menus, ads and cookie banners, keeps headings, tables and code. Crawls via sitemap and links, and builds llms.txt / llms-full.txt. Ideal for RAG, chatbots, vector DBs and AI agents.

- **URL**: https://apify.com/realletoangt/web-to-markdown.md
- **Developed by:** [Toàn](https://apify.com/realletoangt) (community)
- **Categories:** AI, Developer tools
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

$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/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 AI & RAG – Fast Crawler + llms.txt Generator

Turn any website, documentation portal, blog or list of URLs into **clean, LLM-ready Markdown**. Menus, footers, ads and cookie banners are removed; headings, lists, tables and code blocks are kept. Perfect input for **RAG pipelines, custom GPTs, chatbots, vector databases (Pinecone, Qdrant, Weaviate, pgvector) and AI agents**.

### Why this Actor

- **Clean Markdown, not HTML soup.** Main-content extraction (Readability) + GitHub-flavoured Markdown tables and fenced code.
- **Fast & light.** Plain HTTP fetching, no headless browser – hundreds of pages per minute.
- **Simple, predictable price.** You pay a small fixed price per converted page. Failed pages and pages skipped by your filters are free.
- **Sitemap + link crawling.** Finds pages via `sitemap.xml` and on-page links, stays on the same domain and section.
- **llms.txt built in.** Get an `llms.txt` index and a single `llms-full.txt` file of the whole site – drop it straight into ChatGPT, Claude or your agent.
- **Rich metadata:** title, description, language, author, published date, canonical URL, word count.

### Use cases

- Build a **support chatbot** from your help center or docs.
- Feed **competitor websites** or industry blogs into your knowledge base.
- Generate **llms.txt** for your own site (AI-search / GEO optimization).
- Create **fine-tuning or evaluation datasets** from public documentation.
- Give an **AI agent** (LangChain, LlamaIndex, n8n, Make, Zapier, MCP) a "read this website" tool.

### Quick start

1. Paste one or more **Start URLs** (e.g. `https://docs.example.com`).
2. Set **Max pages**. Turn **Crawl** off if you only want the exact URLs you listed.
3. Run, then download the dataset (JSON, CSV, Excel) or open **llms-full.txt** from the Output tab.

### Input example

```json
{
  "startUrls": ["https://docs.apify.com/academy"],
  "crawl": true,
  "maxPages": 200,
  "maxDepth": 3,
  "excludePatterns": ["*/changelog/*"],
  "contentMode": "main",
  "buildLlmsTxt": true
}
```

### Output example

```json
{
  "url": "https://docs.apify.com/academy/actor-marketing-playbook/actor-basics/name-your-actor",
  "title": "Name your Actor | Academy | Apify Documentation",
  "description": "Apify's standards for Actor naming…",
  "language": "en",
  "wordCount": 1236,
  "markdown": "## Name your Actor\n\nApify's standards for Actor naming…",
  "crawledAt": "2026-10-14T10:20:00.000Z"
}
```

Extra outputs in the key-value store: `llms.txt`, `llms-full.txt`, and `FAILED_URLS` (pages that could not be fetched).

### Integrations

Use the Apify API, or connect to **LangChain** (`ApifyDatasetLoader`), **LlamaIndex**, **Pinecone / Qdrant** integrations, **n8n**, **Make** or **Zapier**. Each item's `markdown` field is ready to chunk and embed.

### Good to know

- Works best on server-rendered sites (docs, blogs, marketing sites, news, wikis). Pages that render content only with JavaScript may return little text.
- `robots.txt` is respected by default.
- If a site blocks requests, enable a proxy in the input.
- Only crawl content you have the right to use; respect each website's terms.

### FAQ

**How is this different from a full browser crawler?** It's much faster and cheaper for the 90% of sites that don't need a browser, and the price is fixed per page with no surprise compute bills.

**Can I convert only specific pages?** Yes – turn **Crawl** off and list the URLs.

**Found a page that converts badly?** Open an issue with the URL and we'll improve extraction.

# Actor input Schema

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

Website, docs section or individual page URLs. When crawling, only pages on the same domain are followed; if a URL has a path (e.g. /docs), sitemap pages are limited to that section.

## `crawl` (type: `boolean`):

On: follow links and the sitemap from each start URL. Off: convert only the exact URLs you list.

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

Maximum number of pages to convert in total.

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

How many clicks away from the start URL to follow links.

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

Discover pages from the site's sitemap (faster and more complete for docs and blogs).

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

Glob patterns, e.g. https://example.com/blog/\*. Leave empty for all pages.

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

Glob patterns to skip, e.g. *?page=*, */tag/*.

## `contentMode` (type: `string`):

How aggressively to strip boilerplate.

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

Comma-separated CSS selectors removed before conversion, e.g. .newsletter, #comments.

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

Keep [text](url) links in Markdown and add a links array to each page.

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

Keep ![alt](src) image references in Markdown.

## `buildLlmsTxt` (type: `boolean`):

Save an llms.txt index and a single llms-full.txt file with all pages to the key-value store.

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

Skip pages disallowed by robots.txt.

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

Pages fetched at the same time. Lower it for small sites.

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

Optional. Use a proxy only if the site blocks requests.

## Actor input object example

```json
{
  "startUrls": [
    "https://docs.apify.com/academy"
  ],
  "crawl": true,
  "maxPages": 50,
  "maxDepth": 3,
  "useSitemap": true,
  "includePatterns": [],
  "excludePatterns": [],
  "contentMode": "main",
  "removeSelectors": "",
  "includeLinks": false,
  "includeImages": false,
  "buildLlmsTxt": true,
  "respectRobotsTxt": true,
  "maxConcurrency": 5,
  "proxyConfiguration": {
    "useApifyProxy": false
  }
}
```

# Actor output Schema

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

One item per page with Markdown and metadata.

## `llmsTxt` (type: `string`):

Index of all converted pages.

## `llmsFull` (type: `string`):

All pages in one Markdown file.

# 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.apify.com/academy"
    ]
};

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

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

```

## MCP server setup

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