# Website to Markdown — URL & Website Content Crawler (`ponderable_hydrometer/website-to-markdown`) Actor

Website to Markdown converter and content crawler for LLMs and RAG. Turn a URL, a list of URLs or a same-site crawl into clean Markdown: scripts, menus and footers removed; headings, lists, links, tables and code kept. HTML to Markdown, no browser.

- **URL**: https://apify.com/ponderable_hydrometer/website-to-markdown.md
- **Developed by:** [Ponderable Hydrometer](https://apify.com/ponderable_hydrometer) (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.00 / 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

## Website to Markdown — URL & Website Content Crawler

**Turn a URL, a list of URLs or a small website into Markdown an LLM can actually use.** Headings, lists, links, tables and code survive; scripts, menus and cookie banners do not. Point it at a documentation page with a crawl depth of 1–2 to build a RAG corpus in one run.

### What you can do with it

- **Build a RAG or fine-tuning corpus** from a docs site, a help centre or a blog: one Markdown document per page.
- **Feed pages to an LLM or an AI agent** as clean text instead of raw HTML.
- **Archive or diff content**: store the Markdown of important pages and compare it on the next run.
- **HTML to Markdown at scale**: convert a list of URLs in one run.

### Input

| Field | Type | Default | Description |
|-------|------|---------|-------------|
| `urls` | array | — | Start pages. A bare domain such as `example.com` is accepted. |
| `crawlDepth` | integer | `0` | Follow same-site links this many levels deep (0–5). |
| `maxPages` | integer | `50` | Total page cap across all start URLs. |
| `mode` | string | `main` | `main` keeps the article body and drops menus, footers and sidebars; `full` keeps the whole page body. |

Input example:

```json
{
  "urls": ["https://docs.apify.com/platform/actors"],
  "crawlDepth": 1,
  "maxPages": 20,
  "mode": "main"
}
```

### What you get

One row per page: `url`, `finalUrl`, `title`, `description`, `depth`, `markdown`, `words`.

### Output sample

```json
{
  "url": "https://docs.apify.com/platform/actors",
  "finalUrl": "https://docs.apify.com/platform/actors",
  "title": "Actors | Platform | Apify Documentation",
  "description": "Learn how to develop, run and share serverless cloud programs.",
  "depth": 0,
  "markdown": "# Actors\n\nActors are serverless cloud programs that can do almost anything…",
  "words": 812
}
```

### Use it from the API or an AI agent

Start a run and read the Markdown back in one HTTP call:

```bash
curl -X POST "https://api.apify.com/v2/acts/ponderable_hydrometer~website-to-markdown/run-sync-get-dataset-items?token=<YOUR_API_TOKEN>" \
  -H "Content-Type: application/json" \
  -d '{"urls": ["https://docs.apify.com/platform/actors"], "crawlDepth": 0}'
```

AI agents can call it through the Apify MCP server: `https://mcp.apify.com?tools=ponderable_hydrometer/website-to-markdown`.

### How it works

Each page is fetched over plain HTTP and parsed. In `main` mode Mozilla's Readability picks out the main content; if it finds none, the page body is used with navigation, header, footer and sidebar elements removed. The HTML is then converted to Markdown with ATX headings, fenced code blocks and `-` bullets. With `crawlDepth` above 0, links that stay on the same origin (same scheme, host and port) are queued, up to `maxPages`.

### Limits and good to know

- **No browser.** Pages are fetched without running JavaScript, so content that only appears after scripts run (many single-page apps) is not included.
- **Same site only.** The crawl does not leave the start URL's origin and skips files such as PDFs, images, audio and video. Crawling does not read `robots.txt`; use it on sites you may crawl.
- **Pages that fail or have no text produce no row and no charge.** That includes error responses, non-HTML content and empty pages. If no page at all can be converted, the run ends as FAILED.
- **`main` mode is a heuristic.** On unusual layouts it can drop a section you wanted; switch to `full` for those pages.
- `maxPages` counts converted pages, which are the billed results. `words` is a whitespace word count of the Markdown.
- Sites that block automated requests may answer with an error; those pages are skipped.

### FAQ

**Does it handle pages behind a login?** No. It fetches public pages only.

**Can it return HTML or plain text instead?** No, the output is Markdown.

**How do I convert a sitemap's worth of pages?** Pass the URLs in `urls` with `crawlDepth: 0`, or start from an index page with a crawl depth of 1–2.

### Pricing

Pay per result — **$1.00 per 1,000 results** (one page = one result), plus Apify's standard per-run start event ($0.00005 per GB of memory, so a fraction of a cent per run). No subscription.

# Actor input Schema

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

Pages to convert. With a crawl depth above 0, links on the same site are followed.

## `crawlDepth` (type: `integer`):

0 = only the given URLs. 1 = also the pages they link to on the same site, and so on.

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

Stop after this many pages in total.

## `mode` (type: `string`):

How much of each page to keep.

## Actor input object example

```json
{
  "urls": [
    "https://docs.apify.com/platform/actors"
  ],
  "crawlDepth": 1,
  "maxPages": 5,
  "mode": "main"
}
```

# Actor output Schema

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

All rows produced by this run, as JSON.

# 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"
    ],
    "crawlDepth": 1,
    "maxPages": 5
};

// Run the Actor and wait for it to finish
const run = await client.actor("ponderable_hydrometer/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": ["https://docs.apify.com/platform/actors"],
    "crawlDepth": 1,
    "maxPages": 5,
}

# Run the Actor and wait for it to finish
run = client.actor("ponderable_hydrometer/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": [
    "https://docs.apify.com/platform/actors"
  ],
  "crawlDepth": 1,
  "maxPages": 5
}' |
apify call ponderable_hydrometer/website-to-markdown --silent --output-dataset

```

## MCP server setup

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