# Web Page to Markdown for LLM & RAG - Clean Article Text (`propped_cloak/web-page-to-markdown`) Actor

Turn any web page into clean Markdown for LLMs, RAG and AI agents: main content only (no menus, ads or footers), tables kept, links made absolute, optional chunks. No browser. $1 per 1,000 pages.

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

## Pricing

from $0.80 / 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.
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

## Web Page to Markdown for LLM & RAG - Clean Article Text

Turn **any web page into clean Markdown** ready for ChatGPT, Claude, RAG pipelines and AI agents. Only the **main content** is kept (the article, the documentation page, the blog post): menus, cookie banners, ads, sidebars and footers are removed. Tables become Markdown tables, links are made absolute, and the text can be **split into chunks** for embeddings.

- **Reader View quality.** The main content is found with Mozilla Readability, the engine behind Firefox Reader View.
- **Clean Markdown.** Headings, lists, code blocks, tables (GitHub style) and links. Images are optional.
- **Ready for RAG.** Set `chunkSize` to get chunks that respect paragraph boundaries, alongside the full Markdown.
- **Fast and cheap.** One HTTP request per page, no browser: **$1 per 1,000 pages**.
- **No result, no charge.** Invalid URLs, pages that return an error, non-HTML files and internal addresses are not billed.

### What can I use it for?

- **RAG and chatbots:** feed documentation, help-center articles or blog posts to a vector database.
- **AI agents:** give an agent the readable text of any page through the Apify MCP server (see below), at a fraction of the tokens of raw HTML.
- **Content monitoring and research:** archive articles as Markdown, summarize them, or compare versions.
- **Migrations:** move pages from an old website or CMS to Markdown files (Docusaurus, Hugo, Astro, Notion import).

Tip: to convert a whole website, get its URLs with [Sitemap URL Extractor](https://apify.com/propped_cloak/sitemap-url-extractor) and pass them here. For PDF, Word, Excel or PowerPoint files, use [PDF, Word, Excel & PowerPoint to Markdown](https://apify.com/propped_cloak/document-to-markdown).

### Input

```json
{
    "urls": ["https://en.wikipedia.org/wiki/Markdown", "https://blog.apify.com/what-is-web-scraping/"],
    "mainContentOnly": true,
    "keepLinks": true,
    "keepImages": false,
    "chunkSize": 1000
}
```

### Output

One row per page. Example from a real run (Markdown and chunks shortened):

```json
{
    "url": "https://en.wikipedia.org/wiki/Markdown",
    "finalUrl": "https://en.wikipedia.org/wiki/Markdown",
    "status": 200,
    "title": "Markdown",
    "description": "From Wikipedia, the free encyclopedia",
    "siteName": null,
    "lang": "en",
    "publishedTime": null,
    "usedMainContent": true,
    "wordCount": 6829,
    "markdown": "From Wikipedia, the free encyclopedia\n\n| Markdown |\n| --- |\n|  |\n| [Filename extensions](https://en.wikipedia.org/wiki/Filename_extension \"Filename extension\") | `.md`, `.markdown`...",
    "chunks": [{ "index": 0, "text": "From Wikipedia, the free encyclopedia ..." }],
    "error": null
}
```

| Field | Meaning |
|---|---|
| `title`, `description`, `siteName`, `lang`, `publishedTime` | Page metadata (Open Graph and HTML tags) |
| `usedMainContent` | `true` when the main content was found; `false` means the whole page body was converted |
| `markdown` | The page as Markdown |
| `chunks` | Only when `chunkSize` > 0: pieces of at most `chunkSize` characters, split on paragraphs |
| `wordCount` | Words in the Markdown |

### Pricing

**$0.001 per page converted ($1 per 1,000 pages)** plus Apify's small run-start fee. No subscription, lower prices on higher Apify plans. Invalid URLs, pages returning an error, non-HTML files and internal addresses are free.

### How it works, and its limits

Each page is fetched once over HTTP (redirects followed, at most 4 requests per second per site), and its scripts are never executed. Pages that build their text with JavaScript after loading (some single-page apps) may come out nearly empty: check `wordCount`.

Author names are not extracted as a separate field.

### Use it from AI agents (MCP)

Add `web-page-to-markdown` to the [Apify MCP server](https://mcp.apify.com) in your MCP client (Claude, Cursor, VS Code...).

### Integrations

Apify API, schedules, webhooks, Make, Zapier, n8n, LangChain and LlamaIndex (Apify dataset loaders). Export as JSON, CSV, Excel or HTML.

### Related tools

Same developer, same pay-per-result pricing, outputs that chain together:

- [PDF, Word, Excel & PowerPoint to Markdown for RAG](https://apify.com/propped_cloak/document-to-markdown): PDF, Word, Excel and PowerPoint files to clean Markdown for LLMs.
- [RSS & Atom Feed Reader](https://apify.com/propped_cloak/rss-feed-reader): RSS and Atom feeds of any website as JSON.
- [Sitemap URL Extractor](https://apify.com/propped_cloak/sitemap-url-extractor): every URL of a website from its sitemaps.

### FAQ

**Can it log in or get past paywalls?** No. Only public pages are read.

**Something wrong or missing?** Open an issue on the Issues tab.

# Actor input Schema

## `urls` (type: `array`):

Web page URLs, one per line. Each page is fetched once, with no browser. Duplicates are removed.

## `mainContentOnly` (type: `boolean`):

Keep only the article or main text (like Firefox Reader View): menus, ads, sidebars and footers are dropped. Turn off to convert the whole page body.

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

Keep links as Markdown links, made absolute. Turn off for plain text with less noise for embeddings.

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

Keep images as Markdown image links (absolute URLs).

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

0 = no chunks. Otherwise the Markdown is also split on paragraph boundaries into chunks of at most this many characters (minimum 200), ready for embeddings.

## Actor input object example

```json
{
  "urls": [
    "https://en.wikipedia.org/wiki/Markdown",
    "https://blog.apify.com/what-is-web-scraping/"
  ],
  "mainContentOnly": true,
  "keepLinks": true,
  "keepImages": false,
  "chunkSize": 0
}
```

# Actor output Schema

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

One row per page: title, site name, language, publication date, word count, the Markdown and its chunks.

# 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 = {
    "urls": [
        "https://en.wikipedia.org/wiki/Markdown",
        "https://blog.apify.com/what-is-web-scraping/"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("propped_cloak/web-page-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 = { "urls": [
        "https://en.wikipedia.org/wiki/Markdown",
        "https://blog.apify.com/what-is-web-scraping/",
    ] }

# Run the Actor and wait for it to finish
run = client.actor("propped_cloak/web-page-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 '{
  "urls": [
    "https://en.wikipedia.org/wiki/Markdown",
    "https://blog.apify.com/what-is-web-scraping/"
  ]
}' |
apify call propped_cloak/web-page-to-markdown --silent --output-dataset

```

## MCP server setup

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