# Website to Markdown: Crawl a Whole Site into Clean Pages (`accountable_eel/site-to-markdown`) Actor

Website to Markdown crawler: give it one URL and get every page of the site, or of one docs section, as clean Markdown for LLMs and RAG. Sitemap and link discovery, robots.txt obeyed, plain HTTP with no browser, billed per page converted.

- **URL**: https://apify.com/accountable_eel/site-to-markdown.md
- **Developed by:** [Adriana Voss](https://apify.com/accountable_eel) (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.25 / 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.
Since this Actor supports Apify Store discounts, the price gets lower the higher subscription plan you have.

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: Crawl a Whole Site into Clean Pages

**Give it one URL and get every page of that website, or of one section of it, as clean Markdown, one row per page.**
A website to Markdown crawler for LLM context, RAG indexes and docs-to-knowledge-base jobs: it reads the site's own sitemap, follows its links, obeys robots.txt, and turns each page into Markdown with the menus, footers, cookie banners and scripts removed and the code blocks kept as fenced code. Plain HTTP, no browser, so it is fast and cheap on server-rendered sites, and it says so plainly (and charges nothing) on a site that only renders in JavaScript.

**Who uses it**

- **RAG and agent builders** loading a product's docs, a help centre or a blog into a vector store.
- **Developers** who want a library's documentation as Markdown files to paste into a model's context.
- **Content and SEO teams** taking a text snapshot of a site section before a migration.

**Related actors:** to convert a list of URLs you already have, use [URL to Markdown](https://apify.com/accountable_eel/url-to-markdown). To list a site's URLs without converting them, use [Sitemap URL Discovery](https://apify.com/accountable_eel/sitemap-url-discovery). This actor does both for one site: it finds the pages and converts them.

### How to use

1. **In the Apify Console.** Open the actor page and click **Start** — the `startUrls` field is already pre-filled with a working example. Results land in the run's dataset as soon as each item is found.
2. **Via the API.** Call it directly with a POST request — no Console needed once you have an API token:
   ```bash
   curl "https://api.apify.com/v2/acts/accountable_eel~site-to-markdown/run-sync-get-dataset-items?token=<YOUR_TOKEN>" \
     -X POST \
     -H "Content-Type: application/json" \
     -d '{"startUrls":["https://docs.python.org/3/library/"]}'
   ```
3. **On a schedule.** Save this actor as an Apify **Task** with the input you want, then add a **Schedule** (hourly, daily, weekly) so it runs on its own — no server of your own required.

### Input

```json
{
  "startUrls": [
    "https://docs.python.org/3/library/"
  ]
}
```

One per line. The crawl stays on that site and inside that folder: a homepage crawls the whole site, https://docs.example.com/guide/ crawls only the guide. Pages come from the site's own sitemap first, then from links, and robots.txt is obeyed. Accepted formats: https://docs.example.com/, https://example.com/blog/, example.com.

**What gets crawled.** The crawl stays on the host you gave and inside the folder of the URL you gave: `https://docs.example.com/guide/` (or `https://docs.example.com/guide/intro.html`) reads only `/guide/...`, a homepage reads the whole site. The start page is read first, then the pages listed in the site's sitemap that fall inside that folder, then pages reached by links, nearest first. `maxPages` (default 50, up to 500) counts converted pages, so it is also the most you can be charged per website; for a bigger site, give one line per section. A single `startUrl` string is accepted in place of the `startUrls` list.

**What is left out, and never charged.** Pages that robots.txt disallows (they are not requested at all), files that are not HTML, a second copy of a page already returned (same canonical URL or same text), pages that answer with an error or a bot-protection page, and pages with no readable content in their raw HTML.

### Output

One row per page, for example:

| url | title | wordCount | lang | extractedBy | depth | discoveredVia | markdown |
| --- | --- | --- | --- | --- | --- | --- | --- |
| https://docs.python.org/3/library/ | The Python standard library | 1903 | en | main-content | 0 | start | `# The Python standard library` ... |
| https://docs.python.org/3/library/intro.html | Introduction | 1016 | en | readability | 1 | link | `# Introduction` ... |
| https://docs.python.org/3/library/json.html | json — JSON encoder and decoder | 3701 | en | readability | 1 | link | `# json — JSON encoder and decoder` ... |

Every row also carries `site`, `startUrl`, `pageCount` (pages returned for that site in this run), `pagesSkipped`, `truncated`, `stoppedReason`, `description`, `publishedAt`, `statusCode` and `scrapedAt`. A value the page does not give (`description`, `lang`, `publishedAt`) is `null`, never an empty string. `depth` is `null` for a page that came from the sitemap.

All columns:

| query | found | status | site | startUrl | pageCount | pagesSkipped | truncated | stoppedReason | pages | url | title | description | lang | markdown | wordCount | publishedAt | extractedBy | statusCode | depth | discoveredVia | scrapedAt |
| --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- |
| https://docs.python.org/3/library/ | true | OK | <site> | <start url> | <pages returned for this site> | <pages tried and not returned> | <more pages were available> | <why the crawl stopped early> | \<all pages (full list)> | <page url> | <page title> | \<description / excerpt> | <language> | <clean markdown content> | <word count> | \<published date (if given by the page)> | <how the content was found> | <http status code> | <clicks from the start url> | <how the page was found> | 1970-01-01T00:00:00.000Z |

A website where no page could be converted comes back as one row with `"found": false` and the reason (it does not exist, robots.txt disallows the start URL, the site answered with a block page, or the site is rendered by JavaScript), and is never charged. Pages that were tried and not returned are listed with their reason in the run's `OUTPUT` key-value record, next to the reason a crawl stopped early (`MAX_PAGES`, `BLOCKED`, `TOO_MANY_UNREADABLE_PAGES`, `TIME_LIMIT`).

### When a site needs a real browser

This actor never runs JavaScript. A site whose HTML is an empty shell that a script fills in later has nothing to convert over plain HTTP: those pages are skipped and not charged, and the crawl gives up on such a site after a bounded number of tries rather than requesting every URL in its sitemap. For those sites use a browser-based crawler such as [Website Content Crawler](https://apify.com/apify/website-content-crawler).

### Pricing

Pay-per-event. A flat per-run fee covers session/proxy warmup; you're billed
per item only when data is actually found and returned — see
`.actor/pay_per_event.json` for exact prices. A miss is never charged.

### Example runs

Paste any of these into the Input tab and press Start. All three return rows with no key, no token
and no account of your own beyond an Apify login.

**One section of a documentation site.** The pre-filled example: the first 5 pages of the Python standard library reference.

```json
{
  "startUrls": ["https://docs.python.org/3/library/"],
  "maxPages": 5
}
```

**A whole small site, from its homepage.** The Python Enhancement Proposals site, 25 pages.

```json
{
  "startUrls": ["https://peps.python.org/"],
  "maxPages": 25
}
```

**Two sections in one run, each with its own page limit.** One line per section; `maxPages` applies to each.

```json
{
  "startUrls": [
    "https://docs.python.org/3/tutorial/",
    "https://docs.python.org/3/howto/"
  ],
  "maxPages": 20
}
```

### Use it from Clay, n8n, Make, or an AI agent

This actor runs synchronously over plain HTTP — call it directly from a script, a workflow tool, or an AI agent, no Apify Console needed once you have an API token.

```bash
curl "https://api.apify.com/v2/acts/accountable_eel~site-to-markdown/run-sync-get-dataset-items?token=<YOUR_TOKEN>" \
  -X POST \
  -H "Content-Type: application/json" \
  -d '{"startUrls":["https://docs.python.org/3/library/"]}'
```

**n8n.** Add an HTTP Request node: Method `POST`, URL `https://api.apify.com/v2/acts/accountable_eel~site-to-markdown/run-sync-get-dataset-items?token=<YOUR_TOKEN>`, Body Content Type `JSON`, JSON Body `{"startUrls":["https://docs.python.org/3/library/"]}` (swap in an expression from an earlier node for a real value).

**Clay.** Add an "HTTP API" column: Method `POST`, URL `https://api.apify.com/v2/acts/accountable_eel~site-to-markdown/run-sync-get-dataset-items?token=<YOUR_TOKEN>`, Body `{"startUrls":["{{website}}"]}`, mapping the row's website into the `startUrls` array.

**MCP.** In Claude, Cursor, or any MCP client with the Apify MCP server, ask for "website to markdown crawler" — the agent will find and run this actor.

# Actor input Schema

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

One per line. The crawl stays on that site and inside that folder: a homepage crawls the whole site, https://docs.example.com/guide/ crawls only the guide. Pages come from the site's own sitemap first, then from links, and robots.txt is obeyed. Accepted formats: https://docs.example.com/, https://example.com/blog/, example.com. You're only charged for the ones we actually find — a miss costs nothing.

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

Up to 500. The crawl stops once this many pages have been converted, so this is also the most you can be charged per website. For a bigger site, run it once per section.

## `testRun` (type: `boolean`):

Turn this on to test your input on a small sample before running the full list. Turn it off to process everything.

## `onlyFound` (type: `boolean`):

Only keep rows where something was actually found. Misses are always free, whether or not you show them here.

## `includeKeywords` (type: `array`):

Optional. Only keep results that mention at least one of these words (e.g. a job title, a city, a product name). Leave empty to keep everything.

## `excludeKeywords` (type: `array`):

Optional. Drop any result that mentions one of these words. Leave empty to skip nothing.

## `maxResults` (type: `integer`):

Optional. Stop the run once this many results have been found — useful for a quick, cheap sample. Leave blank for no limit.

## `columns` (type: `array`):

Choose which pieces of information to include in each result row. All are included by default.

## `expandRows` (type: `boolean`):

When on, each page gets its own row. Turn off to get one row per website with all its pages in a `pages` list. The charge is the same either way: one per page converted.

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

Parallel requests. Keep conservative — this target has no browser fallback, so getting blocked costs more than slow-and-steady.

## `proxyConfiguration` (type: `object`):

Apify Proxy config. Residential recommended for anti-bot-sensitive targets.

## Actor input object example

```json
{
  "startUrls": [
    "https://docs.python.org/3/library/"
  ],
  "maxPages": 5,
  "testRun": false,
  "onlyFound": false,
  "includeKeywords": [],
  "excludeKeywords": [],
  "columns": [
    "site",
    "startUrl",
    "pageCount",
    "pagesSkipped",
    "truncated",
    "stoppedReason",
    "pages",
    "url",
    "title",
    "description",
    "lang",
    "markdown",
    "wordCount",
    "publishedAt",
    "extractedBy",
    "statusCode",
    "depth",
    "discoveredVia"
  ],
  "expandRows": true,
  "maxConcurrency": 2,
  "proxyConfiguration": {
    "useApifyProxy": true
  }
}
```

# 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 = {
    "startUrls": [
        "https://docs.python.org/3/library/"
    ],
    "maxPages": 5,
    "includeKeywords": [],
    "excludeKeywords": []
};

// Run the Actor and wait for it to finish
const run = await client.actor("accountable_eel/site-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://docs.python.org/3/library/"],
    "maxPages": 5,
    "includeKeywords": [],
    "excludeKeywords": [],
}

# Run the Actor and wait for it to finish
run = client.actor("accountable_eel/site-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://docs.python.org/3/library/"
  ],
  "maxPages": 5,
  "includeKeywords": [],
  "excludeKeywords": []
}' |
apify call accountable_eel/site-to-markdown --silent --output-dataset

```

## MCP server setup

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