# HTML to Markdown Converter (`snappytools/html-to-markdown-converter`) Actor

Give it a public web page URL and you get back that page as clean Markdown, with menus, footers and sidebars stripped out, ready to drop into an LLM prompt. You paste in a list of URLs. You get one row per URL, in the same order. Pages that fail still get a row.

- **URL**: https://apify.com/snappytools/html-to-markdown-converter.md
- **Developed by:** [Snappy](https://apify.com/snappytools) (community)
- **Categories:** Other
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

$1.70 / 1,000 results

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

## HTML to Markdown Converter – web page to Markdown for LLMs

HTML to Markdown converter that turns any public web page URL into clean Markdown, with menus, footers and sidebars stripped out, ready for an LLM prompt.

You paste in a list of URLs. You get one row per URL, in the same order, with the page `title`, the `markdown` text, a `wordCount`, the final `url` after redirects and a `status` that tells you if it worked. Pages that fail still get a row with a plain reason, so one bad link never sinks the run.

You can run it on a schedule to refresh a fixed set of pages.

### Why this one

- **One row per URL, always.** Every input gets a record in input order, including bad or unreachable links, marked `invalid`, `not_found` or `error`.
- **Main content, not the whole page.** Readability picks the article body before conversion, and you can switch it off with **Main content only**.
- **Plain HTTP, no browser.** Pages are fetched directly, so runs start fast and stay light.
- **Bounded output.** **Max Markdown characters** caps each page and sets `truncated` when text is cut, so your context window stays predictable.
- **Pay per result.** $1.70 per 1,000 results, and runs with no results cost nothing.

### Quick start

```json
{
  "extractMainContent": true,
  "maxChars": 500,
  "urls": [
    "https://example.com",
    "https://www.iana.org/help/example-domains",
    "https://en.wikipedia.org/wiki/Markdown"
  ]
}
```

This returns three rows, each with the page title and its content as Markdown, cut to 500 characters. In a test run on 15 Nov 2026 it returned 3 rows.

### What you can use it for

| Who | What for |
|---|---|
| AI agent builders | Turn a URL from a tool call into compact text for the model's context |
| RAG pipeline owners | Feed documentation pages into a vector store as Markdown |
| Content teams | Copy published articles into a Markdown-based CMS or notes app |
| Researchers | Keep readable snapshots of public pages for later review |

### How to use it

1. Click **Try for free**.
2. In **Page URLs**, add one public link per line, for example `https://example.com`.
3. Leave **Main content only** on to drop menus, footers and sidebars, or turn it off to convert the whole page body.
4. Set **Max Markdown characters** if you need shorter output, for example `20000`.
5. Click **Start**.

To keep a set of pages fresh, save the input and add it under **Schedules**.

### What data you get

Each row describes one input URL.

| Field | What it is | Example |
|---|---|---|
| `id` | Stable ID for the URL | `0f115db062b7c0dd` |
| `input` | The value you passed in | `https://example.com` |
| `url` | Final URL after redirects | `https://example.com/` |
| `status` | `ok`, `invalid`, `not_found` or `error` | `ok` |
| `reason` | Plain reason when the status is not ok | `null` |
| `title` | Page title | `Example Domain` |
| `markdown` | Page content as Markdown | `# Example Domain ...` |
| `wordCount` | Words in the Markdown | `28` |
| `truncated` | True when cut to the character limit | `false` |
| `httpStatus` | HTTP status of the final response | `200` |
| `contentType` | Response content type | `text/html; charset=utf-8` |
| `checkedAt` | When the page was fetched | `2026-11-15T10:50:29.842Z` |
| `source` | Where the data came from, with the page link | `{ "name": "Public web page (direct HTTP fetch)", "url": "https://example.com/" }` |

### Pricing

| Event | Price |
|---|---|
| Result (one per row written to the dataset) | $0.0017 |

There is no start fee, and runs with no results cost nothing.

| Run | Cost |
|---|---|
| 100 results | $0.17 |
| 1,000 results | $1.70 |
| 10,000 results | $17.00 |

### Good to know

- **Limits:** up to 50 URLs per run, and Markdown capped by **Max Markdown characters** (500 to 200,000).
- **Where the data comes from:** each page is fetched directly from its public address. Nothing behind a login, paywall or bot check is touched.
- **Not included:** content drawn by JavaScript after load, PDFs and other non-HTML files.
- **Private addresses are refused:** localhost and private network addresses are marked `invalid`.
- **Freshness:** content is whatever the page served at `checkedAt`.
- **Not affiliated:** this tool isn't affiliated with or endorsed by the owners of the sites you convert.

### FAQ

**How do I convert HTML to Markdown in bulk?** Paste up to 50 public URLs into **Page URLs** and click **Start**. You get one Markdown row per URL.

**Does it run JavaScript on the page?** No. It reads the HTML the server sends, which works for most articles and docs.

**What happens to a broken link?** You get a row with status `not_found` or `error` and a reason, and the rest of the run carries on.

**Can I keep the whole page?** Yes, turn off **Main content only**.

### Getting the data out

Download results as Excel, CSV or JSON from the Output tab. Send them to Google Sheets, Slack, Zapier, Make or webhooks from the **Integrations** tab. Every run is available through the Apify API, and you can run it on a timetable from **Schedules**.

### Questions or problems

Open an issue on the **Issues** tab and include the run link. I reply within one business day.

### Related tools

- [Bulk Email Syntax and MX Validator](https://apify.com/snappytools/email-syntax-mx-validator): check email addresses in bulk
- [TED Europa Tender Scraper](https://apify.com/snappytools/ted-europa-tender-scraper): export public tenders from TED Europa
- [Companies House Company Scraper](https://apify.com/snappytools/companies-house-uk-scraper): get UK company records

# Actor input Schema

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

List of public http or https web page URLs to convert, one per line, for example https://example.com. Maximum 50 per run.

## `extractMainContent` (type: `boolean`):

When true, menus, footers and sidebars are removed with Readability before converting. Set false to convert the whole page body.

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

Longest Markdown kept per page, for example 20000. Longer output is cut and marked truncated. Between 500 and 200000.

## Actor input object example

```json
{
  "urls": [
    "https://example.com",
    "https://www.iana.org/help/example-domains",
    "https://en.wikipedia.org/wiki/Markdown"
  ],
  "extractMainContent": true,
  "maxChars": 100000
}
```

# 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": [
        "https://example.com",
        "https://www.iana.org/help/example-domains",
        "https://en.wikipedia.org/wiki/Markdown"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("snappytools/html-to-markdown-converter").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://example.com",
        "https://www.iana.org/help/example-domains",
        "https://en.wikipedia.org/wiki/Markdown",
    ] }

# Run the Actor and wait for it to finish
run = client.actor("snappytools/html-to-markdown-converter").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://example.com",
    "https://www.iana.org/help/example-domains",
    "https://en.wikipedia.org/wiki/Markdown"
  ]
}' |
apify call snappytools/html-to-markdown-converter --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,snappytools/html-to-markdown-converter"
        }
    }
}
```

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/7QeFf82Y1g5xJC0ju/builds/7iUXSJ2M3pZuh2Rge/openapi.json
