# Website to Markdown: Web Page & HTML to Markdown for LLMs (`forgeloop/website-to-markdown`) Actor

Convert web pages to clean Markdown for LLMs, RAG and AI agents. Removes menus, cookie banners, headers and footers and keeps the main content, links and images. Bulk URLs, fast plain HTTP, no browser. Pay per converted page, errors and empty pages are free.

- **URL**: https://apify.com/forgeloop/website-to-markdown.md
- **Developed by:** [Markus Heiß](https://apify.com/forgeloop) (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

from $1.50 / 1,000 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

## Website to Markdown: Web Page & HTML to Markdown for LLMs

Turn web pages into clean Markdown that language models can read. Give it a list of URLs, get back one item per page with the main content as Markdown, without menus, cookie notes, headers and footers.

Made for RAG pipelines, AI agents, chatbots with a knowledge base, and anyone who pastes web pages into an LLM and wants fewer tokens and less noise.

### What it does

- Downloads each page over plain HTTP. No browser, so it is fast and cheap.
- Finds the **main content** with Mozilla's Readability, the engine behind Firefox Reader View. If that finds nothing useful, it falls back to the whole page body.
- Converts it to Markdown:
  - **Headings** as `#`, `##`, `###`
  - **Bullet and numbered lists**
  - **Tables** as Markdown tables
  - **Code blocks** fenced, with the language when the page names it
  - **Links and images** with absolute URLs, so they still work outside the page
- Drops in-page jump links and footnote anchors, which only add tokens.
- Returns title, language, a short excerpt, the author line if the article shows one, word and character counts.

### Input

| Field | Description | Default |
|---|---|---|
| URLs | Web pages to convert, one item per URL, no crawling | |
| Only main content | Article text only, without menus, headers, footers and sidebars | on |
| Include links | Keep links as Markdown links. Off keeps only the link text | on |
| Include images | Add images as Markdown image links | off |
| Page timeout | Seconds before a page is given up | 30 |
| Parallel requests | Pages processed at the same time, 1 to 20 | 5 |

### Output

One dataset item per URL:

```json
{
  "url": "https://developer.mozilla.org/en-US/docs/Web/HTTP/Overview",
  "finalUrl": "https://developer.mozilla.org/en-US/docs/Web/HTTP/Overview",
  "statusCode": 200,
  "title": "Overview of HTTP - HTTP | MDN",
  "excerpt": "HTTP is a protocol for fetching resources such as HTML documents. ...",
  "lang": "en-US",
  "mainContent": true,
  "markdown": "# Overview of HTTP\n\n**HTTP** is a [protocol](https://developer.mozilla.org/en-US/docs/Glossary/Protocol) for fetching resources ...",
  "wordCount": 2263,
  "characters": 17073,
  "error": null
}
```

`byline` is added when the article shows an author line. `mainContent` is `false` when the whole page body was used.

A failed page returns the URL, the HTTP status if there was one, and an `error` text.

Export as JSON, CSV or Excel, or read it through the Apify API.

### Pricing

Pay per converted page with content. Errors, empty pages and non-HTML files are not charged. You can cap the cost of a run with the maximum charge setting in Apify.

Each run also has a start fee of 0.00005 USD per GB of memory, which Apify shows as Actor Start.

### Limits

- Pages that build their content only with JavaScript (some single-page apps) return little or no text. They get an error item and are not charged.
- PDF files and images are not converted. They return an error that says so. Use a PDF tool for PDF files.
- Pages behind a login or a bot wall are not supported.
- Pages larger than 10 MB are skipped.
- Only public `http` and `https` addresses. Local and private network addresses are refused, also after redirects.

### Data source, permitted use and legal

- **Data source:** Public web pages at the URLs you enter. The Actor fetches them live during the run.
- **Snapshot:** Results show the source at the time of the run. We do not guarantee that they are complete, current or correct.
- **For business use:** This Actor is offered to businesses only, not to consumers.
- **Permitted use:** Process only content you are allowed to access and use, for example your own websites and documents or public pages you have a legitimate reason to process. Respect the terms of the websites and the rights in the content.
- **Your responsibility:** You choose the URLs and decide what happens with the results. If results contain personal data, you are the controller and need your own legal basis.
- **No circumvention:** The Actor does not log in, solve captchas or bypass paywalls, bot protection or other access restrictions. Do not use it for that.
- **Request volume:** One request per URL, with the number of parallel requests you set (default 5). Do not use it to put excessive load on a website.
- **Provider:** forgeloop, Markus Heiss, Austria. [Imprint](https://devhem.github.io/forgeloop-legal/imprint.html), [Privacy Notice](https://devhem.github.io/forgeloop-legal/privacy.html), [Terms of Use](https://devhem.github.io/forgeloop-legal/terms.html).

### Questions and issues

Open an issue on the Actor page.

# Actor input Schema

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

Web pages to convert. A missing https:// is added automatically. One output item per URL, no crawling. Format: a list of objects with a url key, like \[{"url": "https://example.com/article"}]. Plain strings are not accepted.

## `onlyMainContent` (type: `boolean`):

Keep only the article or main text and drop menus, headers, footers and sidebars. Off converts the whole page body.

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

Keep links as Markdown links with absolute URLs. Off keeps only the link text, which saves tokens.

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

Add images as Markdown image links with absolute URLs and alt text.

## `timeoutSeconds` (type: `integer`):

Give up on a page after this many seconds.

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

How many pages are downloaded and converted at the same time.

## Actor input object example

```json
{
  "urls": [
    {
      "url": "https://en.wikipedia.org/wiki/Markdown"
    },
    {
      "url": "https://developer.mozilla.org/en-US/docs/Web/HTTP/Overview"
    }
  ],
  "onlyMainContent": true,
  "includeLinks": true,
  "includeImages": false,
  "timeoutSeconds": 30,
  "maxConcurrency": 5
}
```

# 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": [
        {
            "url": "https://en.wikipedia.org/wiki/Markdown"
        },
        {
            "url": "https://developer.mozilla.org/en-US/docs/Web/HTTP/Overview"
        }
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("forgeloop/website-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": [
        { "url": "https://en.wikipedia.org/wiki/Markdown" },
        { "url": "https://developer.mozilla.org/en-US/docs/Web/HTTP/Overview" },
    ] }

# Run the Actor and wait for it to finish
run = client.actor("forgeloop/website-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": [
    {
      "url": "https://en.wikipedia.org/wiki/Markdown"
    },
    {
      "url": "https://developer.mozilla.org/en-US/docs/Web/HTTP/Overview"
    }
  ]
}' |
apify call forgeloop/website-to-markdown --silent --output-dataset

```

## MCP server setup

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