# URL to Markdown for LLM & RAG – clean text, chunks – $1/1k (`henrycrawl/url-to-markdown`) Actor

Turn any list of public URLs into clean, LLM-ready Markdown with title, description, language, word count, optional links and RAG chunks. Fast HTTP (no browser). Works with AI agents via Apify MCP. Pay only per page; blocked/error rows are free.

- **URL**: https://apify.com/henrycrawl/url-to-markdown.md
- **Developed by:** [Henry Crawl](https://apify.com/henrycrawl) (community)
- **Categories:** AI, Developer tools, MCP servers
- **Features:** Limited permissions
- **Stats:** 1 total users, 0 monthly users, 0.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

$1.00 / 1,000 converted 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

## URL to Markdown for LLM & RAG

LLMs and RAG pipelines need clean text, not raw HTML full of menus, ads and scripts. This actor takes a list of public URLs and returns clean Markdown for each page, plus title, description, language and word count. It runs on plain HTTP with no browser, so it is fast and cheap.

### What you get

| Field | Description |
|---|---|
| `url` / `finalUrl` | Requested URL and the URL after redirects |
| `statusCode` | HTTP status |
| `title`, `description` | Page title and meta description |
| `lang` | Page language (`<html lang>`) |
| `author`, `publishedDate`, `siteName` | Metadata when the page provides it |
| `markdown` | Main content as clean Markdown (headings, lists, tables, bold/italic) |
| `wordCount`, `charCount` | Size of the Markdown |
| `links` / `linkCount` | Optional: absolute links with anchor text (`includeLinks: true`) |
| `chunks` | Optional: Markdown split on paragraph boundaries (`chunkSize` > 0) for embeddings |
| `truncated` | `true` if the page was larger than `maxPageSizeMb` |
| `type`, `status` | `result` / `OK`, or `error` with a code (`BLOCKED`, `HTTP_ERROR`, `FETCH_FAILED`, `UNSUPPORTED_CONTENT`, `EMPTY_CONTENT`) |

**Extraction modes:** `article` (main content only, recommended), `recall` (keeps more borderline text), `full` (whole page body minus scripts, nav and footer).

**Reliability:** timeouts, 429 and 5xx responses are retried up to 3 times with exponential backoff. Downloads are capped by size.

**Public pages only.** Pages that need a login, or that answer 401/403/429 or show a captcha or bot check, are not bypassed. They return a free `BLOCKED` row. Pages that only render with JavaScript may come back as `EMPTY_CONTENT` (also free).

### Example output (real run, Markdown shortened)

```json
{
 "url": "https://www.gnu.org/philosophy/free-sw.en.html",
 "finalUrl": "https://www.gnu.org/philosophy/free-sw.en.html",
 "statusCode": 200,
 "title": "What is Free Software? - GNU Project",
 "description": "Since 1983, developing the free Unix style operating system GNU, so that computer users can have the freedom to share and improve the software they use.",
 "lang": "en",
 "author": null,
 "publishedDate": "2026-06-09",
 "siteName": "gnu.org",
 "wordCount": 3900,
 "charCount": 23236,
 "contentType": "text/html",
 "truncated": false,
 "markdown": "# What is Free Software? - GNU Project\n\n## What is Free Software?\n\n“Free software” means software that respects users' freedom and community. ...",
 "type": "result",
 "status": "OK"
}
```

### Pricing

**$1 per 1,000 converted pages** (pay per event, $0.001 per page). Error and blocked rows are free. `maxResults` caps what you pay in a run.

### Use with AI agents (MCP)

Connect this actor to Claude, Cursor or any MCP client as a "read this web page" tool:

`https://mcp.apify.com/?tools=henrycrawl/url-to-markdown`

The agent sends URLs and gets back Markdown ready to use in its context.

### Example input

```json
{
  "startUrls": [
    "https://en.wikipedia.org/wiki/Retrieval-augmented_generation",
    "https://developer.mozilla.org/en-US/docs/Web/HTTP/Overview"
  ],
  "extractMode": "article",
  "includeLinks": false,
  "chunkSize": 1500,
  "chunkOverlap": 150,
  "maxResults": 100
}
```

# Actor input Schema

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

Public web pages to convert to Markdown (one URL per line). Pages behind login, captcha or bot walls are NOT bypassed: they return a free BLOCKED row.

## `extractMode` (type: `string`):

article = main content only (best for LLM/RAG); recall = keep more borderline text; full = whole <body> minus scripts/nav/footer.

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

Keep hyperlinks inside the Markdown and return a `links` list (absolute URL + anchor text, max 1000 per page).

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

If > 0, also return `chunks`: the Markdown split on paragraph boundaries into pieces of about this many characters (good for embeddings). 0 = off.

## `chunkOverlap` (type: `integer`):

Characters repeated between consecutive chunks (max half of chunk size).

## `maxPageSizeMb` (type: `integer`):

Stop downloading a page after this many MB (the rest is cut, row gets truncated = true).

## `timeoutSecs` (type: `integer`):

HTTP timeout per attempt. Failed/5xx/429 requests are retried up to 3 times with backoff.

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

Pages fetched in parallel.

## `acceptLanguage` (type: `string`):

Preferred page language sent to the server, e.g. en-US,en;q=0.9 or de-DE.

## `maxResults` (type: `integer`):

Maximum number of converted pages for the whole run (you are only charged for delivered pages; error rows are free).

## Actor input object example

```json
{
  "startUrls": [
    "https://en.wikipedia.org/wiki/Web_scraping",
    "https://en.wikipedia.org/wiki/Markdown",
    "https://en.wikipedia.org/wiki/Large_language_model",
    "https://docs.python.org/3/tutorial/introduction.html",
    "https://developer.mozilla.org/en-US/docs/Web/HTTP/Overview",
    "https://www.gnu.org/philosophy/free-sw.en.html",
    "https://example.com/",
    "https://blog.apify.com/what-is-web-scraping/",
    "https://www.python.org/about/",
    "https://httpbin.org/html",
    "https://en.wikipedia.org/wiki/Retrieval-augmented_generation",
    "https://www.rust-lang.org/learn"
  ],
  "extractMode": "article",
  "includeLinks": false,
  "chunkSize": 0,
  "chunkOverlap": 0,
  "maxPageSizeMb": 5,
  "timeoutSecs": 30,
  "maxConcurrency": 10,
  "acceptLanguage": "en-US,en;q=0.9",
  "maxResults": 20
}
```

# Actor output Schema

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

One row per result, plus free error rows (type = error).

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

Counts for this run (SUMMARY record).

# 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://en.wikipedia.org/wiki/Web_scraping",
        "https://en.wikipedia.org/wiki/Markdown",
        "https://en.wikipedia.org/wiki/Large_language_model",
        "https://docs.python.org/3/tutorial/introduction.html",
        "https://developer.mozilla.org/en-US/docs/Web/HTTP/Overview",
        "https://www.gnu.org/philosophy/free-sw.en.html",
        "https://example.com/",
        "https://blog.apify.com/what-is-web-scraping/",
        "https://www.python.org/about/",
        "https://httpbin.org/html",
        "https://en.wikipedia.org/wiki/Retrieval-augmented_generation",
        "https://www.rust-lang.org/learn"
    ],
    "maxResults": 20
};

// Run the Actor and wait for it to finish
const run = await client.actor("henrycrawl/url-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://en.wikipedia.org/wiki/Web_scraping",
        "https://en.wikipedia.org/wiki/Markdown",
        "https://en.wikipedia.org/wiki/Large_language_model",
        "https://docs.python.org/3/tutorial/introduction.html",
        "https://developer.mozilla.org/en-US/docs/Web/HTTP/Overview",
        "https://www.gnu.org/philosophy/free-sw.en.html",
        "https://example.com/",
        "https://blog.apify.com/what-is-web-scraping/",
        "https://www.python.org/about/",
        "https://httpbin.org/html",
        "https://en.wikipedia.org/wiki/Retrieval-augmented_generation",
        "https://www.rust-lang.org/learn",
    ],
    "maxResults": 20,
}

# Run the Actor and wait for it to finish
run = client.actor("henrycrawl/url-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://en.wikipedia.org/wiki/Web_scraping",
    "https://en.wikipedia.org/wiki/Markdown",
    "https://en.wikipedia.org/wiki/Large_language_model",
    "https://docs.python.org/3/tutorial/introduction.html",
    "https://developer.mozilla.org/en-US/docs/Web/HTTP/Overview",
    "https://www.gnu.org/philosophy/free-sw.en.html",
    "https://example.com/",
    "https://blog.apify.com/what-is-web-scraping/",
    "https://www.python.org/about/",
    "https://httpbin.org/html",
    "https://en.wikipedia.org/wiki/Retrieval-augmented_generation",
    "https://www.rust-lang.org/learn"
  ],
  "maxResults": 20
}' |
apify call henrycrawl/url-to-markdown --silent --output-dataset

```

## MCP server setup

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