# Website to Markdown Converter for LLM & RAG (`iscle/url-to-markdown-llm`) Actor

Website to Markdown converter for LLMs, RAG and AI agents. Turns web pages and PDFs into clean Markdown without menus, ads or footers; keeps headings, lists, tables and links and adds title and metadata. Fast, no browser, pay per page converted.

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

## Pricing

Pay per event

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

## Website to Markdown Converter for LLM & RAG

Convert any list of web pages, and PDFs, into **clean Markdown** ready for ChatGPT, Claude, RAG pipelines, vector databases and AI agents. Menus, cookie banners, ads and footers are removed with Mozilla Readability (the Firefox Reader View engine); headings, lists, tables, code blocks and links are kept.

### Why this Actor

- **LLM-ready output:** Markdown plus `title`, `author`, `publishedAt`, `language`, `wordCount` and `approxTokens` for chunking and cost control.
- **Fast and cheap:** plain HTTP, no headless browser. Five documentation pages converted in about 2 seconds in our test.
- **PDFs too:** a link to a PDF is converted to Markdown automatically.
- **Optional crawl:** follow links under the same site and path to convert a whole docs section or blog.
- **Fair price:** pay only per page that produced content; failed and empty pages are free.
- **Token savers:** drop links or images from the Markdown with one switch.

### Input

| Field | Description |
|---|---|
| `urls` | Pages or PDF links. |
| `extractMode` | `article` (main content, default) or `full` (whole body). |
| `includeLinks` / `includeImages` | Keep `[text](url)` links / `![alt](src)` images. |
| `crawlSameSite` | Also follow links under the same host and path. |
| `maxPages` | Hard cap on pages (and cost). |
| `maxConcurrency` | Parallel requests (default 10). |
| `proxyConfiguration` | Optional proxy. |

```json
{ "urls": ["https://docs.apify.com/platform/actors/"], "crawlSameSite": true, "maxPages": 5 }
```

### Output

Real example from a test run on 18 Nov 2026 (Markdown shortened):

```json
{
  "url": "https://docs.apify.com/platform/actors/",
  "finalUrl": "https://docs.apify.com/actors",
  "statusCode": 200,
  "status": "ok",
  "title": "Actors | Platform | Apify Documentation",
  "description": "Learn how to develop, run and share serverless cloud programs. Create your own web scraping and automation tools and publish them on the Apify platform.",
  "language": "en",
  "canonicalUrl": "https://docs.apify.com/actors",
  "markdown": "# Actors | Platform | Apify Documentation\n\nActors are serverless cloud programs that take a structured JSON input, perform a task (web scraping, browser automation, data processing, and more), and optionally produce a structured output. Run them manually in [Apify Console](https://console.apify.com/actors), through the [API](https://docs.apify.com/api) or [CLI](https://docs.apify.com/cli)…",
  "extraction": "article",
  "wordCount": 262,
  "charCount": 2075,
  "approxTokens": 519,
  "fetchMs": 131
}
```

Other results from the same tests: the Wikipedia article *Large language model* (Markdown with tables and references), an Apify blog post (1,442 words) and the 15-page PDF *Attention Is All You Need* (`extraction: "pdf"`).

### Pricing (pay per event)

- **$0.002** per run start.
- **$0.001 per converted page** ($1 per 1,000). Errors, blocked and empty pages are free.

### Notes

Pages that need JavaScript to render their text or that block automated access may return little content or an error (not charged). Respect each website's terms and copyright when reusing content.

### Related Actors

- [PDF Text Extractor: PDF to Markdown & Text](https://apify.com/iscle/pdf-to-text-markdown): Extract text from PDF URLs as clean Markdown or plain text, page by page, with metadata. For LLM and RAG pipelines. Pay per PDF.
- [Google News Scraper: Real Article URLs, Any Country](https://apify.com/iscle/google-news-scraper): Scrape Google News by keyword or topic in any country and language. Headline, publisher, date and real article URL. Fast, no browser.

# Actor input Schema

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

Web pages or PDF links to convert.

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

Main content uses Mozilla Readability (the Firefox Reader View engine) and falls back to the full body when no article is found.

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

Keep [text](url) links. Turn off for shorter, cheaper LLM context.

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

Keep ![alt](src) images.

## `crawlSameSite` (type: `boolean`):

Follow links to pages under the same host and path as each start URL, up to the page limit.

## `maxPages` (type: `integer`):

Hard cap on pages converted (and billed) in the run.

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

Pages fetched at the same time.

## `proxyConfiguration` (type: `object`):

Optional. Off by default.

## Actor input object example

```json
{
  "urls": [
    "https://en.wikipedia.org/wiki/Large_language_model",
    "https://blog.apify.com/what-is-web-scraping/"
  ],
  "extractMode": "article",
  "includeLinks": true,
  "includeImages": false,
  "crawlSameSite": false,
  "maxPages": 100,
  "maxConcurrency": 10,
  "proxyConfiguration": {
    "useApifyProxy": false
  }
}
```

# Actor output Schema

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

All records saved to the default dataset.

# 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/Large_language_model",
        "https://blog.apify.com/what-is-web-scraping/"
    ]
};

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

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

```

## MCP server setup

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