# Website to Markdown — Clean Markdown for LLMs & RAG (`noniner/website-to-markdown`) Actor

Turn any web page into clean, LLM/RAG-ready Markdown. Strips nav/ads/boilerplate, optional same-domain crawl and overlap-aware chunking for vector databases. Keyless and fast.

- **URL**: https://apify.com/noniner/website-to-markdown.md
- **Developed by:** [Fredrik Hansson](https://apify.com/noniner) (community)
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

$100.00 / 1,000 pages converted (per 5)s

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 — Clean Markdown for LLMs & RAG

Turn any web page into **clean, LLM/RAG-ready Markdown**. Point it at one URL or a
whole docs site: it strips navigation, ads and boilerplate, keeps the main
content, and returns tidy Markdown — optionally split into **overlap-aware chunks**
ready to embed into a vector database.

Deterministic and **keyless** — no OpenAI key, no per-token cost. Fast, cheap, and
built for people **and** AI agents (available over MCP).

A clean [Firecrawl](https://www.firecrawl.dev/) / [Jina Reader](https://jina.ai/reader/)
alternative on Apify: pay-per-use, no subscription.

### What it does

- **Boilerplate removal** — drops `nav`, `header`, `footer`, `aside`, forms,
  scripts, ads and common menu/sidebar classes, then picks the richest
  `<main>`/`<article>` container.
- **Clean Markdown** — [turndown](https://github.com/mixmark-io/turndown) + GFM, so
  tables, code blocks and lists survive intact (ATX headings, fenced code).
- **Same-domain crawl** — set a crawl depth to walk a whole docs site; filter with
  include/exclude URL globs.
- **RAG chunking** — optional: split each page into ~N-token chunks with overlap so
  vector-DB retrieval keeps context across chunk edges.
- **Token + word counts** — every record carries a rough token estimate for budgeting.

### Input

| Field | Type | Default | Notes |
|---|---|---|---|
| `startUrls` | string\[] | — | Seed URLs (required). |
| `maxPages` | integer | 50 | Hard cap 200. One charge per page converted. |
| `maxDepth` | integer | 0 | Same-domain crawl depth. 0 = only the seeds. |
| `maxConcurrency` | integer | 5 | Pages fetched/converted in parallel. |
| `chunkForRag` | boolean | false | Emit chunk records instead of page records. |
| `chunkSize` | integer | 512 | Target chunk size in tokens. |
| `chunkOverlap` | integer | 50 | Token overlap between chunks (< chunkSize). |
| `includeUrlGlobs` | string\[] | — | Only follow matching links when crawling. |
| `excludeUrlGlobs` | string\[] | — | Never follow matching links (wins over include). |

### Output

One dataset record per page (or per chunk when `chunkForRag` is on):

```json
{
  "url": "https://quotes.toscrape.com/",
  "title": "Quotes to Scrape",
  "markdown": "# Quotes to Scrape\n\n> \"The world as we have created it...\"\n...",
  "wordCount": 412,
  "tokenEstimate": 540
}
```

Chunk records add `chunkIndex` and drop `wordCount`.

### Pricing

Pay-per-event: **$0.10 per 5 pages converted** (≈ **$0.02 / page**). No subscription,
no token fees — you only pay for pages actually converted.

### Part of the Fuze no-code data toolkit

One of 45+ no-code data tools — many chain directly into each other. Browse them all
at **[datatools-hub.vercel.app](https://datatools-hub.vercel.app)**.

# Actor input Schema

## `startUrls` (type: `array`):

The web pages to convert (one per line). With crawl depth > 0, same-domain links are followed from each.

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

Maximum number of pages to convert. One pay-per-event charge per page converted.

## `maxDepth` (type: `integer`):

Same-domain crawl depth. 0 = convert only the start URLs; 1 = also their same-domain links; and so on.

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

How many pages to fetch and convert in parallel.

## `chunkForRag` (type: `boolean`):

Emit overlap-aware Markdown chunks (one dataset record per chunk) instead of one record per page — ready to embed into a vector database.

## `chunkSize` (type: `integer`):

Approximate target size of each RAG chunk, in tokens. Only used when "Chunk for RAG" is on.

## `chunkOverlap` (type: `integer`):

Token overlap carried between consecutive chunks so retrieval keeps context across edges. Must be smaller than the chunk size.

## `includeUrlGlobs` (type: `array`):

Optional. When crawling, only follow links matching one of these globs, e.g. https://docs.example.com/\*\*. Empty = allow all same-domain links.

## `excludeUrlGlobs` (type: `array`):

Optional. When crawling, never follow links matching one of these globs, e.g. **/tag/**. Excludes win over includes.

## Actor input object example

```json
{
  "startUrls": [
    "https://quotes.toscrape.com/"
  ],
  "maxPages": 50,
  "maxDepth": 0,
  "maxConcurrency": 5,
  "chunkForRag": false,
  "chunkSize": 512,
  "chunkOverlap": 50
}
```

# Actor output Schema

## `markdown` (type: `string`):

All converted pages (or chunks) 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 = {
    "startUrls": [
        "https://quotes.toscrape.com/"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("noniner/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 = { "startUrls": ["https://quotes.toscrape.com/"] }

# Run the Actor and wait for it to finish
run = client.actor("noniner/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 '{
  "startUrls": [
    "https://quotes.toscrape.com/"
  ]
}' |
apify call noniner/website-to-markdown --silent --output-dataset

```

## MCP server setup

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