# Webpage to Markdown for LLMs & RAG (Clean, Bulk) (`quillbit-tools/webpage-to-markdown`) Actor

Convert web pages into clean Markdown for LLMs, RAG and AI agents. Strips nav, ads, scripts and boilerplate, keeps headings, links, lists and tables. Bulk, no browser, $2 per 1,000 pages.

- **URL**: https://apify.com/quillbit-tools/webpage-to-markdown.md
- **Developed by:** [Quillbit Tools](https://apify.com/quillbit-tools) (community)
- **Categories:** AI, Developer tools
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $2.00 / 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

## Webpage to Markdown for LLMs & RAG (Clean, Bulk)

**Webpage to Markdown** converts web pages into **clean Markdown** ready for LLMs, RAG pipelines, vector databases and AI agents. It strips navigation, headers, footers, sidebars, cookie banners, forms, scripts and ads, keeps the main content (`<main>` / `<article>` when present) and preserves **headings, links, lists, tables and code blocks** (GitHub-flavored Markdown). Relative links and image URLs are made absolute.

Each page returns its title, meta description, Markdown and word count. No browser, so it is fast and costs **$2 per 1,000 pages** — and you are only charged for pages that convert successfully.

### What can you use it for?

#### Convert a URL to Markdown for ChatGPT, Claude or other LLMs

Feed clean page text to a model without HTML noise and save tokens.

#### Build a RAG knowledge base

Turn documentation, blog posts or help-center articles into Markdown chunks for embeddings and vector search.

#### HTML to Markdown converter in bulk

Convert hundreds of pages in one run; export JSON, CSV or read via API.

#### Web fetch tool for AI agents

Call it from an agent through the Apify MCP server to read any web page as Markdown.

#### Content archiving and migration

Move blog posts or docs from an old CMS into Markdown-based tools like Notion, Obsidian, Hugo or Docusaurus.

### How to use it

1. Click **Try for free** (or **Start**).
2. Enter your input (see the example below) and click **Save & Start**.
3. Download results as JSON, CSV, Excel or HTML, or read them via the API.

### Input

- `urls` — Pages to convert, one per line.
- `mainContentOnly` — Remove headers, footers, navigation, sidebars, cookie banners and forms (default on).
- `keepLinks` — Keep hyperlinks as Markdown links (default on).
- `keepImages` — Keep images as Markdown image tags (default off).
- `concurrency` — Parallel requests (default 10).

Example input:

```json
{
  "urls": [
    "https://en.wikipedia.org/wiki/Markdown"
  ],
  "mainContentOnly": true,
  "keepLinks": true,
  "keepImages": false
}
```

### Output example

| url | title | wordCount | markdown |
|---|---|---|---|
| https://en.wikipedia.org/wiki/Markdown | Markdown - Wikipedia | 3214 | # Markdown - Wikipedia\n\nFor the marketing term, see [Price markdown](…)… |

All output fields: `url`, `finalUrl`, `status`, `title`, `description`, `markdown`, `wordCount`, `error`

### How much does it cost?

This Actor uses **pay-per-event** pricing. You pay only for results, not for servers or subscriptions:

- **$0.002 per page converted**, which is **$2.00 per 1,000 pages**
- plus Apify's standard **Actor start** event of $0.00005 per run (per GB of memory; the default 1 GB memory = one event)

| You process | You pay (approx.) |
|---|---|
| 100 pages | $0.20 |
| 1,000 pages | $2.00 |
| 10,000 pages | $20.00 |

Apify's free plan includes monthly platform credit, which is enough to try this Actor at no cost.

### Run it via API, schedule or AI agents

Run from your own code with the Apify API, JavaScript or Python client, schedule it in Apify Console, connect it to Make, Zapier, n8n or Google Sheets, or let an AI agent call it through the Apify MCP server (`https://mcp.apify.com`).

```bash
curl -X POST "https://api.apify.com/v2/acts/quillbit-tools~webpage-to-markdown/run-sync-get-dataset-items?token=YOUR_APIFY_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"urls": ["https://en.wikipedia.org/wiki/Markdown"], "mainContentOnly": true, "keepLinks": true, "keepImages": false}'
```

### FAQ

**Does it render JavaScript?**
No. It converts the HTML the server returns. Most articles, docs, blogs and Wikipedia work well; single-page apps that load content only with JavaScript may return little text.

**Am I charged for failed pages?**
No. The `page-converted` event is charged only when a page is converted. Any page that returns HTML is converted (even with a 404 status, so check `status`). DNS errors, timeouts and non-HTML files are output with an `error` and not charged.

**Does it crawl a whole site?**
No, it converts the URLs you give it. To get all URLs of a site first, run the Sitemap URL Extractor and pass its URLs here.

**How does it compare on price?**
$0.002 per page ($2 per 1,000). Many Markdown converters on the Store charge $5–$50 per 1,000 pages.

**Are tables kept?**
Yes. HTML tables become GitHub-flavored Markdown tables; code blocks are fenced.

### Related tools by Quillbit Tools

- [Bulk URL Status & Redirect Chain Checker](https://apify.com/quillbit-tools/bulk-redirect-status-checker)
- [Broken Link Checker – crawl a site for 404s](https://apify.com/quillbit-tools/broken-link-crawler)
- [Sitemap URL Extractor](https://apify.com/quillbit-tools/sitemap-url-extractor)
- [Domain Expiry, DNS & SSL Certificate Checker](https://apify.com/quillbit-tools/domain-expiry-dns-ssl-checker)
- [Website Tech Stack Detector](https://apify.com/quillbit-tools/tech-stack-detector)
- [RSS & Atom Feed to JSON Reader](https://apify.com/quillbit-tools/rss-feed-to-json)

Questions or a feature request? Open an issue on the Actor's **Issues** tab.

# Actor input Schema

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

Pages to convert, one per line.

## `mainContentOnly` (type: `boolean`):

Remove headers, footers, navigation, sidebars, cookie banners and forms; keep <main>/<article> when present.

## `keepLinks` (type: `boolean`):

Keep hyperlinks as Markdown links (off = plain text).

## `keepImages` (type: `boolean`):

Keep images as Markdown image tags.

## `concurrency` (type: `integer`):

How many requests to run in parallel.

## Actor input object example

```json
{
  "urls": [
    "https://en.wikipedia.org/wiki/Markdown"
  ],
  "mainContentOnly": true,
  "keepLinks": true,
  "keepImages": false,
  "concurrency": 10
}
```

# Actor output Schema

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

All result items in 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/Markdown"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("quillbit-tools/webpage-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://en.wikipedia.org/wiki/Markdown"] }

# Run the Actor and wait for it to finish
run = client.actor("quillbit-tools/webpage-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://en.wikipedia.org/wiki/Markdown"
  ]
}' |
apify call quillbit-tools/webpage-to-markdown --silent --output-dataset

```

## MCP server setup

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