# URL to Markdown for AI Agents & LLMs (Web Page Fetch) (`plainprobe/url-to-markdown`) Actor

Get clean, LLM-ready Markdown from any URL: main content only (no menus, footers or cookie banners), tables kept, with title, author, date, language and token count. 1 to 1,000 URLs per run, JavaScript pages rendered when needed. $1 per 1,000 pages; failures free.

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

## Pricing

from $1.00 / 1,000 pages converted

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/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 AI Agents & LLMs

Turn web pages into clean, LLM-ready Markdown. Give one URL or up to 1,000; get back the **main content only** (no menus, footers, cookie banners or "related articles" blocks), with tables kept and useful metadata: title, author, publication date, language, word count and an estimated token count.

**$1 per 1,000 pages converted. Failed, blocked or empty pages are free.**

### When to use it

- An AI agent (via the Apify MCP server or API) needs to read a page it found.
- A RAG pipeline needs clean text from a list of URLs: docs, blogs, news, government pages, product pages.
- You want many pages in **one run** instead of one run per URL.

### When not to use it

- Pages behind a login, a paywall or a bot challenge (Cloudflare, DataDome…): we report them as `ACCESS_DENIED` and never try to bypass them.
- Pages that `robots.txt` disallows: reported as `ROBOTS_DISALLOWED`, never fetched.
- Web search: this Actor fetches URLs you give it; it does not search.
- Crawling a whole site: pass the list of URLs (our *Sitemap URL Extractor* can build it).

### Input

```json
{
  "urls": ["https://www.python.org/about/", "https://en.wikipedia.org/wiki/Large_language_model"],
  "contentMode": "main",
  "formats": ["markdown"],
  "renderJs": "auto"
}
```

| Field | Default | What it does |
|---|---|---|
| `urls` | — | 1 to 1,000 page URLs (duplicates removed). |
| `contentMode` | `main` | `main` = article/main content only; `full` = the whole page body. |
| `formats` | `["markdown"]` | Any of `markdown`, `text`, `html` (cleaned). |
| `includeLinks` / `includeImages` | `true` / `false` | Keep links or image references in the Markdown. |
| `renderJs` | `auto` | `auto` starts a headless browser only when the plain HTML has no readable content (single-page apps); `never` or `always`. |
| `maxCharsPerPage` | 0 (no limit) | Truncate long pages; `truncated: true` tells you it happened. |
| `acceptLanguage`, `timeoutSecs`, `maxConcurrency` | `en-US,en;q=0.8`, 30, 10 | Request options. |

### Output (one item per URL, in input order)

```json
{
  "url": "https://www.python.org/about/",
  "finalUrl": "https://www.python.org/about/",
  "status": "ok",
  "httpStatus": 200,
  "title": "About Python™",
  "author": null,
  "publishedAt": null,
  "language": "en",
  "markdown": "# About Python\n\nPython is a programming language that lets you work quickly...",
  "wordCount": 412,
  "tokenEstimate": 560,
  "renderedWithBrowser": false,
  "truncated": false,
  "fetchedAt": "2026-12-04T05:10:00.000Z",
  "tookMs": 640,
  "source": "https://www.python.org/about/",
  "error": null
}
```

Fields that do not apply are `null`, never missing. On failure `status` is `error` and `error` is `{ "code", "message", "retryable" }` with a stable code: `INVALID_URL`, `BLOCKED_URL`, `DNS_FAILED`, `ROBOTS_DISALLOWED`, `ACCESS_DENIED`, `NOT_FOUND`, `RATE_LIMITED`, `SERVER_ERROR`, `HTTP_ERROR`, `UNSUPPORTED_CONTENT`, `EMPTY_CONTENT`, `TIMEOUT`, `TOO_MANY_REDIRECTS`, `FETCH_FAILED`, `INTERNAL_ERROR`. One bad URL never fails the run.

### Benchmark (4 December 2026, same 30 real URLs, Apify platform)

| | Pages with content | Time for 30 URLs | Price per 1,000 pages | Failures charged |
|---|---|---|---|---|
| **This Actor** (1 run) | 25/30 | **16 s** | **$1.00** | **No** |
| apify/web-fetch (1 run per URL) | 30/30 | 136 s (3 runs at a time) | $1.50 | — |
| apify/rag-web-browser (1 run per URL) | 25/30 | 135 s (3 runs at a time) | $2.28 | — |

The 5 pages we did not return were refused by the site (bot challenge or HTTP 403) or disallowed by `robots.txt`; we respect both by design. Raw data: available on request.

### Pricing

- `page`: **$0.001** per page returned with readable content (`status: "ok"`).
- Invalid URLs, errors, blocked and empty pages: **free**.
- Set a maximum cost per run in Apify to cap spending; the Actor stops cleanly when it is reached.

### Data, legality and limits

- Public pages only, fetched without logging in. We honour `robots.txt` and do not bypass bot protections or paywalls.
- Private and internal network addresses are refused (`BLOCKED_URL`), including after redirects and inside the browser.
- You are responsible for how you use the content (copyright and the site's terms still apply).
- Each page is limited in size and time (`timeoutSecs`, max 120 s).

### FAQ

**Why fewer words than other tools?** We remove navigation, footers, cookie banners and link lists, so your LLM reads less noise and you pay for fewer tokens. Use `contentMode: "full"` for the whole page.
**Does it handle JavaScript sites?** Yes: in `auto` mode a headless browser is started only for pages whose HTML has no readable content.
**How many URLs per run?** Up to 1,000; split larger lists.

# Actor input Schema

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

Web pages to fetch, one per line (1 to 1,000). One result per URL, in the same order. The scheme is optional (example.com works). For PDF, Word or PowerPoint files use plainprobe/document-to-markdown.

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

main: the article or main content only, without navigation, header, footer, sidebars and cookie banners (best for LLMs and RAG). full: the whole visible page.

## `formats` (type: `array`):

markdown (default), text (plain text without links or formatting) and/or html (the raw HTML of the page).

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

Keep hyperlinks as \[text]\(absolute URL). Turn off to save tokens: only the link text is kept.

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

Keep images as !\[alt]\(absolute URL). Off by default: images rarely help a text model.

## `renderJs` (type: `string`):

auto: plain HTTP first (fast); a headless browser only when the page has almost no text and is a JavaScript app. never: HTTP only. always: render every page (slower).

## `maxCharsPerPage` (type: `integer`):

Longer Markdown is cut at a word boundary and flagged truncated: true. 0 = no limit. 200,000 characters is about 50,000 tokens.

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

Optional Accept-Language header, for example fr-FR,fr;q=0.9, for sites that serve several languages.

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

Maximum time for one page, including one automatic retry on network errors, HTTP 429 and 5xx.

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

Pages fetched at the same time (1 to 20).

## Actor input object example

```json
{
  "urls": [
    "https://www.python.org/about/",
    "https://en.wikipedia.org/wiki/Markdown",
    "https://blog.cloudflare.com/"
  ],
  "contentMode": "main",
  "formats": [
    "markdown"
  ],
  "includeLinks": true,
  "includeImages": false,
  "renderJs": "auto",
  "maxCharsPerPage": 200000,
  "timeoutSecs": 30,
  "maxConcurrency": 10
}
```

# Actor output Schema

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

One record per URL, in input order: Markdown, metadata, token estimate, typed error.

# 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://www.python.org/about/",
        "https://en.wikipedia.org/wiki/Markdown",
        "https://blog.cloudflare.com/"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("plainprobe/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 = { "urls": [
        "https://www.python.org/about/",
        "https://en.wikipedia.org/wiki/Markdown",
        "https://blog.cloudflare.com/",
    ] }

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

```

## MCP server setup

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