# Web Page to Markdown for LLMs - Fast & Cheap (`aolmo/page-to-markdown`) Actor

Turns any URL into clean Markdown and plain text: main content only (no menus, footers or cookie banners), absolute links, tables and code blocks, plus title, author, date and language. No browser, sub-second, $0.0005 per page. MCP-ready for AI agents.

- **URL**: https://apify.com/aolmo/page-to-markdown.md
- **Developed by:** [Antonio del Olmo Tena](https://apify.com/aolmo) (community)
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

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

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

Give it URLs and get back clean Markdown you can feed straight into an LLM, a RAG index or an agent: only the main content of each page (no menus, headers, footers, sidebars, cookie banners or share buttons), with headings, lists, tables, code blocks, absolute links and images preserved. Each page also comes with plain text, word count, title, description, author, publish and modified dates, language and canonical URL.

No browser and no proxies: a plain HTTP request and a few milliseconds of processing per page, which is why it costs $0.0005 per page and answers in well under a second. Built for AI agents and automation (it is available through Apify's MCP integration) as much as for people who just need readable text.

### What you get

One Dataset item per URL with:

- `markdown`: the main content as Markdown (ATX headings, `-` lists, fenced code blocks, GFM tables, absolute links and image URLs).
- `text`: the same content as plain text, and `wordCount`.
- `title`, `description`, `siteName`, `author`, `publishedAt`, `modifiedAt`, `language`, `canonical`.
- `links` and `images` found in the content (absolute, deduplicated).
- `mainContentUsed`: `false` when no main block was detected and the whole page was converted.
- `likelyJsRendered`: `true` when the page seems to render its content only in the browser, so the Markdown may be empty.
- `truncated`: `true` when the Markdown was cut at **Max Markdown characters**.

Pages that cannot be fetched are returned with an `error` field and are not charged. Pages with no readable text are not charged either.

### How to use it

1. Open the **Input** tab.
2. Paste the page URLs in **Page URLs**, one per line.
3. Leave **Main content only** on for articles, docs and posts; turn it off to convert the whole page.
4. Click **Start**. Read the Markdown in **Output** or export as JSON.
5. From code or an agent, call the API below; schedule the Actor to monitor pages and get `CONTENT_CHANGED` and `TITLE_CHANGED` events when they change.

### Input

```json
{
  "urls": ["https://docs.apify.com/platform/actors", "https://en.wikipedia.org/wiki/Markdown"],
  "mainContent": true,
  "maxChars": 100000
}
```

| Field         | Description |
|---------------|-------------|
| `urls`        | Public http(s) URLs. Up to 50 per run. Private or internal addresses are rejected. |
| `mainContent` | Default `true`. Keeps the article/main block and removes site chrome. |
| `maxChars`    | Default 100,000, maximum 500,000. Longer Markdown is cut at a line break. |

### Output example

```json
{
  "url": "https://blog.example/posts/hello",
  "title": "Hello World | Example Blog",
  "description": "A post about things",
  "author": "Jane Doe",
  "publishedAt": "2026-10-01T10:00:00Z",
  "language": "en",
  "markdown": "# Hello World\n\nFirst paragraph with a [link](https://blog.example/related) and **bold** text.\n\n- Item one\n- Item two\n\n| Col A | Col B |\n| --- | --- |\n| 1 | 2 |",
  "text": "Hello World First paragraph with a link and bold text. Item one Item two Col A Col B 1 2",
  "wordCount": 18,
  "truncated": false,
  "mainContentUsed": true,
  "likelyJsRendered": false,
  "links": ["https://blog.example/related"],
  "images": [],
  "timestamp": "2026-10-04T10:00:00.000Z"
}
```

### Pricing

You pay per page, nothing else:

- **Page converted** ($0.0005): one page with readable content turned into Markdown. 1,000 pages cost $0.50.
- **Content changed** ($0.002): only in scheduled runs, when a monitored page's content changed since the previous run.
- **Actor start** ($0.00005): Apify's standard start fee.

Failed pages and pages with no readable text are free. Comparable Actors charge $0.002 to $0.003 per page.

### Use it as an API

```bash
curl -X POST "https://api.apify.com/v2/acts/USERNAME~page-to-markdown/run-sync-get-dataset-items?token=YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"urls":["https://docs.apify.com/platform/actors"]}'
```

Replace `USERNAME~page-to-markdown` with the Actor id shown on this page. The call returns the items directly. Add `&format=json&clean=true` to get a compact response for prompts.

### FAQ

**The Markdown is empty or very short.** Check `likelyJsRendered`: some sites render their content only in the browser. This Actor reads the HTML the server sends, which keeps it fast and cheap; for those sites use a browser-based crawler.

**It kept something that is not content, or dropped something that is.** Set **Main content only** to `false` to get the whole page, then filter on your side. Detection relies on `article`/`main` blocks and text density, which works for most articles, documentation and blog posts.

**Does it follow links or crawl a whole site?** No, it converts exactly the URLs you give it. Combine it with a sitemap or a list of links when you need a whole section.

**Is anything bypassed?** No. Plain requests to public pages, never to private or internal addresses, and no evasion of anti-bot systems.

# Actor input Schema

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

One per line. Public http(s) pages; private or internal addresses are rejected. Up to 50 per run.

## `mainContent` (type: `boolean`):

Keep only the article/main block and drop navigation, headers, footers, sidebars, cookie banners and share buttons. Turn off to convert the whole page.

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

Longer Markdown is cut at a line break and flagged with truncated: true.

## `product` (type: `string`):

Internal. Leave as is.

## Actor input object example

```json
{
  "urls": [
    "https://docs.apify.com/platform/actors",
    "https://en.wikipedia.org/wiki/Markdown"
  ],
  "mainContent": true,
  "maxChars": 100000,
  "product": "page-to-markdown"
}
```

# Actor output Schema

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

Dataset items: url, changed, events, data, timestamp and error (when the target failed).

# 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/actors",
        "https://en.wikipedia.org/wiki/Markdown"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("aolmo/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://docs.apify.com/platform/actors",
        "https://en.wikipedia.org/wiki/Markdown",
    ] }

# Run the Actor and wait for it to finish
run = client.actor("aolmo/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://docs.apify.com/platform/actors",
    "https://en.wikipedia.org/wiki/Markdown"
  ]
}' |
apify call aolmo/page-to-markdown --silent --output-dataset

```

## MCP server setup

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