# Website to Markdown — LLM-Ready Content Crawler for RAG (`actor-forge/website-to-markdown`) Actor

Crawl any website and get clean, LLM-ready Markdown for every page: main content only (no menus, footers or cookie banners), absolute links, tables, title, description, author and publish date. For RAG, vector databases, AI agents and training data. Flat $1 per 1,000 pages.

- **URL**: https://apify.com/actor-forge/website-to-markdown.md
- **Developed by:** [ActorForge](https://apify.com/actor-forge) (community)
- **Categories:** AI, Developer tools, SEO tools
- **Security:** 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 results

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 — LLM-Ready Content Crawler for RAG

Crawl any website and get clean, LLM-ready Markdown for every page: main content only (no menus, footers or cookie banners), absolute links, tables, title, description, author and publish date. For RAG, vector databases, AI agents and training data. Flat $1 per 1,000 pages.

**Turn any website into clean, LLM-ready Markdown.** Give it a start URL and it crawls the site (following links and the sitemap, staying on the site and under the path you gave) and returns one row per page with the **main content only**. Menus, sidebars, footers, cookie banners and buttons are removed using Firefox Reader View's algorithm, and the page body is the fallback when there is no article. You get **Markdown with absolute links, images and tables**, plus title, description, language, author, publish date, canonical URL and word count, optionally with plain text, cleaned HTML and the page's links. Use it to feed **RAG pipelines and vector databases** (Pinecone, Qdrant, Weaviate), build chatbot knowledge bases from documentation, give **AI agents** a fast web-to-text tool, create fine-tuning datasets, migrate content, or monitor competitors' docs and blogs. **Flat, predictable pricing: $1 per 1,000 pages**, with no compute bill on top and no 8 GB browser runs. Duplicate pages, non-HTML files, JavaScript-only pages and pages blocked by robots.txt are never charged.

### What data does it return?

Every run outputs clean, schema-validated rows like these:

| url | title | wordCount | language | markdown |
| --- | --- | --- | --- | --- |
| https://docs.apify.com/actors/development | Actor development - Platform - Apify Documentation | 412 | en | ## Actor development\n\nActors are serverless programs… |
| https://simonwillison.net/2024/Dec/31/llms-in-2024/ | Things we learned about LLMs in 2024 | 7262 | en-gb | 31st December 2024\n\nA *lot* has happened in the world of Large Language Models… |
| https://en.wikipedia.org/wiki/Retrieval-augmented_generation | Retrieval-augmented generation - Wikipedia | 2382 | en | **Retrieval-augmented generation** (**RAG**) is a technique that enables [large language models](https://en.wikipedia.org/wiki/Large_language_model)… |

### How much does it cost?

Transparent pay-per-event pricing — you only pay for what you get, and the
actor **always respects your run budget**: set a maximum total charge and it
stops cleanly at the cap instead of overrunning.

| Event | Price | Charged | Worked example |
| --- | --- | --- | --- |
| `page-result` | $0.001 | per page converted and delivered (all output formats included) | 100 pages = $0.10; a 1,000-page documentation site = $1.00 |
| `apify-actor-start` | $0.00005 | per run per GB of memory (platform start fee) | One run at up to 1 GB = $0.00005; at 4 GB = $0.0002 |

### Input options

| Field | Type | Required | Default | Description |
| --- | --- | --- | --- | --- |
| `startUrls` | array | yes | — | Where to start crawling. The crawl stays on the same site and under each URL's path: https://docs.example.com/guides crawls only the guides; a bare domain crawls the whole site. Use include globs to widen or narrow it. |
| `maxPages` | integer | no | `100` | Stop after converting this many pages (across all start URLs). To convert only the start URLs themselves, set Max link depth to 0. |
| `maxDepth` | integer | no | `10` | How many links away from a start URL to follow. 0 = only the start URLs themselves (no crawling, no sitemaps). |
| `includeSubdomains` | boolean | no | `false` | Also crawl subdomains of the start site (e.g. blog.example.com when starting at example.com). Pages on another host are only reached when you also set include globs that cover them, e.g. https://\*.example.com/**. |
| `includeGlobs` | array | no | `[]` | Only crawl URLs matching one of these, e.g. https://example.com/blog/** (\*\* = anything, \* = anything except /). Replaces the default 'stay under the start path' rule. |
| `excludeGlobs` | array | no | `[]` | Never crawl URLs matching these, e.g. **/tag/** or \**/login*. |
| `useSitemap` | boolean | no | `true` | Also discover pages from the site's sitemap.xml (and sitemaps listed in robots.txt). Finds pages that links miss. |
| `onlyMainContent` | boolean | no | `true` | Keep just the article or main content (Firefox Reader View's algorithm), dropping menus, sidebars, footers and banners. Turn off to keep the whole page body (navigation is still removed). |
| `removeSelectors` | array | no | `[]` | Extra elements to strip before conversion, e.g. .newsletter-signup or #comments. |
| `outputFormats` | array | no | `["markdown"]` | Which content fields to return for each page. Same price whatever you pick. |
| `includeLinks` | boolean | no | `false` | Add the list of absolute links found on each page. |
| `minWords` | integer | no | `0` | Skip thin pages (tag lists, empty archives) with fewer words than this. Skipped pages are not charged. |
| `respectRobotsTxt` | boolean | no | `true` | Skip pages that the site's robots.txt disallows for crawlers. |

### Limits & honest notes

- Pages are fetched as static HTML without a browser, which is fast, cheap and works for most documentation, blogs, news, knowledge bases and e-commerce sites. Pages whose content is rendered only by JavaScript (single-page apps) are detected, reported and not charged.
- The crawl stays on the start URL's host and under its path, unless you set include globs. To cover subdomains or both the www and bare domain, add include globs such as https://\*.example.com/\*\*.
- Pages disallowed by robots.txt are skipped by default. If a site's robots.txt can't be fetched (HTTP 5xx or a network error, after one retry), the whole site is skipped (RFC 9309) and its start URL is reported as skipped, not charged. Login-protected content is not supported. Some sites block datacenter IPs; those start URLs are reported with their HTTP error and not charged.
- Duplicates are removed by normalised URL (tracking parameters and fragments ignored), redirect target and identical content, and are never charged twice.
- Very large sites: results stream as they are crawled, and runs resume after a platform migration without re-charging pages already delivered.
- Respects your run budget: set a maximum total charge and the crawl stops cleanly at the cap.

### Related ActorForge actors

- [Sitemap URL Extractor](https://apify.com/actor-forge/sitemap-extractor) — list every URL of a site first
- [PDF to Markdown](https://apify.com/actor-forge/pdf-to-markdown) — the same clean Markdown for PDFs
- [SEO Audit Crawler](https://apify.com/actor-forge/seo-audit)
- [Website Change Monitor](https://apify.com/actor-forge/website-change-monitor)

### Changelog

- **2026-10-18** — Initial release: same-site crawling with sitemaps, path scoping and globs; Readability main-content extraction; Markdown/text/HTML outputs; metadata; JavaScript-page detection; dedupe; migration-safe resume.

***

*Built and maintained by **ActorForge**. Reliability first: every actor in the
portfolio is monitored by an automated nightly self-test, and breakages are
typically fixed the same day.*

# Actor input Schema

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

Where to start crawling. The crawl stays on the same site and under each URL's path: https://docs.example.com/guides crawls only the guides; a bare domain crawls the whole site. Use include globs to widen or narrow it.

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

Stop after converting this many pages (across all start URLs). To convert only the start URLs themselves, set Max link depth to 0.

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

How many links away from a start URL to follow. 0 = only the start URLs themselves (no crawling, no sitemaps).

## `includeSubdomains` (type: `boolean`):

Also crawl subdomains of the start site (e.g. blog.example.com when starting at example.com). Pages on another host are only reached when you also set include globs that cover them, e.g. https://\*.example.com/\*\*.

## `includeGlobs` (type: `array`):

Only crawl URLs matching one of these, e.g. https://example.com/blog/\*\* (\*\* = anything, \* = anything except /). Replaces the default 'stay under the start path' rule.

## `excludeGlobs` (type: `array`):

Never crawl URLs matching these, e.g. **/tag/** or \**/login*.

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

Also discover pages from the site's sitemap.xml (and sitemaps listed in robots.txt). Finds pages that links miss.

## `onlyMainContent` (type: `boolean`):

Keep just the article or main content (Firefox Reader View's algorithm), dropping menus, sidebars, footers and banners. Turn off to keep the whole page body (navigation is still removed).

## `removeSelectors` (type: `array`):

Extra elements to strip before conversion, e.g. .newsletter-signup or #comments.

## `outputFormats` (type: `array`):

Which content fields to return for each page. Same price whatever you pick.

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

Add the list of absolute links found on each page.

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

Skip thin pages (tag lists, empty archives) with fewer words than this. Skipped pages are not charged.

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

Skip pages that the site's robots.txt disallows for crawlers.

## Actor input object example

```json
{
  "startUrls": [
    "https://docs.apify.com/platform/actors"
  ],
  "maxPages": 100,
  "maxDepth": 10,
  "includeSubdomains": false,
  "includeGlobs": [],
  "excludeGlobs": [],
  "useSitemap": true,
  "onlyMainContent": true,
  "removeSelectors": [],
  "outputFormats": [
    "markdown"
  ],
  "includeLinks": false,
  "minWords": 0,
  "respectRobotsTxt": true
}
```

# Actor output Schema

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

One row per crawled page with clean Markdown of its main content, plus title, description, language, author and publish date.

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

Pages delivered, pages found but not crawled, and counts of skipped pages by reason (none of them charged).

# 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/platform/actors"
    ]
};

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

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

```

## MCP server setup

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