# Website to Markdown for LLM & RAG - Clean Page Text (`admirala/webpage-to-markdown-llm`) Actor

Convert web pages to clean Markdown for LLMs, RAG and AI agents: strips navigation, cookie banners and ads; keeps headings, lists, tables and links. Title, language, word count. $0.002 per page.

- **URL**: https://apify.com/admirala/webpage-to-markdown-llm.md
- **Developed by:** [Ja doei](https://apify.com/admirala) (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.35 / 1,000 per 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

## Website to Markdown for LLM & RAG - Clean Page Text

> ✅ **Tested daily** with its default input (Apify's automated QA plus our own smoke test before every release).

**Website to Markdown** converter for LLMs, RAG and AI agents: turns any web page into clean Markdown, removing navigation, cookie banners, ads and scripts while keeping headings, lists, tables and links. Returns title, description, language and word count. **$0.002 per page**; failed pages are free.

### Input

| Field | Description |
|---|---|
| `urls` | Web page URLs to convert to Markdown, e.g. \["https://docs.apify.com/platform"]. $0.002 per page. |
| `removeNav` | true = keep only the main content (drop navigation, headers, footers, sidebars, cookie and newsletter pop-ups). |
| `includeLinks` | true = add a list of all links found on the page. |
| `maxChars` | Truncate the Markdown of very long pages to this many characters, e.g. 200000. |

### Output

One dataset item per result with: `url`, `title`, `wordCount`, `language`, `status` and more.

### Pricing (pay per event)

- Per page converted: $0.002

You only pay for successful results.

### Use with AI agents (MCP)

This Actor can be used as a tool by AI agents (Claude, Cursor, VS Code, other MCP clients) through the official [Apify MCP server](https://docs.apify.com/platform/integrations/mcp):

- Add only this Actor as a tool: `https://mcp.apify.com?tools=admirala/webpage-to-markdown-llm` (sign in with OAuth or an Apify API token).
- Or connect `https://mcp.apify.com` and let the agent find it with `search-actors` (e.g. "website to markdown"), read the input schema with `fetch-actor-details` and run it with `call-actor`.

Example input an agent can pass:

```json
{
  "urls": [
    "https://docs.apify.com/platform"
  ],
  "removeNav": true
}
```

Cost per call: $0.002 per page converted; failed or blocked pages are free. Results come back as dataset items (`get-dataset-items`).

### FAQ

**How do I convert a web page to Markdown?**
Put the URL in `urls`; each row contains the page as Markdown plus title, language and word count.

**Is the output good for RAG and LLM prompts?**
Yes, boilerplate (navigation, cookie banners, ads) is removed with `removeNav: true`, so you feed only the main content.

**Does it crawl a whole site?**
No, it converts exactly the URLs you give it. Use a sitemap or link list as input.

### Related actors

- Image Upscaler - AI Upscale Images 2x/4x (Real-ESRGAN) (coming soon to Apify Store)
- Open Graph & URL Metadata Extractor - Link Preview, Favicon (coming soon to Apify Store)

# Actor input Schema

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

Web page URLs to convert to Markdown, e.g. \["https://docs.apify.com/platform"]. $0.002 per page.

## `removeNav` (type: `boolean`):

true = keep only the main content (drop navigation, headers, footers, sidebars, cookie and newsletter pop-ups).

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

true = add a list of all links found on the page.

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

Truncate the Markdown of very long pages to this many characters, e.g. 200000.

## Actor input object example

```json
{
  "urls": [
    "https://docs.apify.com/platform"
  ],
  "removeNav": true,
  "includeLinks": false,
  "maxChars": 200000
}
```

# 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 = {
    "urls": [
        "https://docs.apify.com/platform"
    ]
};

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

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

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,admirala/webpage-to-markdown-llm"
        }
    }
}
```

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/ZvklU6Qn52t2n9bAO/builds/ZwxZUhK5p8ZRXbmCv/openapi.json
