# Website to Markdown Crawler for AI, RAG and LLMs (`dennydevelops/website-markdown-crawler`) Actor

Crawl any public website into clean Markdown or text for AI chatbots, RAG and LLM training. Fast browserless crawler, sitemaps, robots.txt, change-only re-crawls. Flat price per page.

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

## Pricing

Pay per event + usage

This Actor is paid per event and usage. You are charged both the fixed price for specific events and for Apify platform usage.

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 Crawler for AI, RAG and LLMs

Turn any public website into **clean Markdown or plain text** for AI chatbots, RAG pipelines, vector databases and LLM fine-tuning, at a **flat, predictable price per page**.

- **Fast and lightweight:** a browserless HTTP crawler. 18 Python docs pages (44,000 words) took 4.6 seconds in testing.
- **Clean output:** keeps headings, lists, tables, code and links in the main content; drops menus, headers, footers, cookie banners, forms and scripts. Add your own CSS selectors to drop more.
- **Finds pages for you:** follows links within your chosen scope (whole site, subdomain, path, or just the URLs you give) and reads `sitemap.xml`.
- **Polite:** respects robots.txt by default, retries with backoff, identifies itself.
- **Change-only re-crawls:** schedule it and get only pages that are new or changed since the last run. Unchanged pages cost a fraction of a full page.
- **Flags JavaScript-only pages** (`likelyNeedsJavascript`) instead of silently returning empty content.

### Input

```json
{
  "startUrls": ["https://docs.example.com/"],
  "crawlScope": "path-prefix",
  "maxPages": 500,
  "outputFormat": "markdown",
  "excludeUrlGlobs": ["*/changelog/*"],
  "onlyChangedPages": false
}
```

| Field | Default | Notes |
|---|---|---|
| `startUrls` | – | One or more sites or sections |
| `crawlScope` | path-prefix | `same-domain` (incl. subdomains), `same-subdomain`, `path-prefix`, `start-urls-only` |
| `maxPages` | 100 | Hard cap on pages fetched (and on cost) |
| `maxDepth` | 5 | Clicks from the start URLs |
| `useSitemaps` | true | |
| `includeUrlGlobs` / `excludeUrlGlobs` | – | e.g. `https://example.com/blog/*`, `*?page=*` |
| `outputFormat` | markdown | `markdown`, `text`, `both` |
| `removeSelectors` | – | Extra CSS selectors to drop |
| `keepNavigationAndFooter` | false | |
| `includeLinks` | false | Links found on each page |
| `onlyChangedPages` | false | Re-crawl mode |
| `respectRobotsTxt` | true | |
| `maxConcurrency` | 10 | |

### Output

```json
{
  "url": "https://docs.python.org/3/tutorial/classes.html",
  "title": "9. Classes — Python 3 documentation",
  "description": null,
  "language": "en",
  "canonicalUrl": "https://docs.python.org/3/tutorial/classes.html",
  "depth": 1,
  "wordCount": 5961,
  "likelyNeedsJavascript": false,
  "contentHash": "…",
  "changedSinceLastRun": null,
  "crawledAt": "2026-11-01T20:00:00Z",
  "markdown": "# 9. Classes\n\nClasses provide a means of bundling data and functionality together…"
}
```

### Pricing (pay per event + usage)

| Event | Price | When |
|---|---|---|
| `apify-actor-start` | $0.001 | Once per run |
| `page` | $0.0005 | One page returned ($0.50 per 1,000 pages) |
| `unchanged-page` | $0.0001 | Change-only mode: page re-checked, unchanged |

Plus Apify platform usage, which is small because there's no browser: a few hundredths of a cent per 100 pages.

### Limitations

- Pages that render their content only with JavaScript are flagged rather than rendered.
- Only public pages; no logins.
- Use it on sites you're allowed to crawl.

# Actor input Schema

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

Websites or sections to crawl, e.g. https://docs.example.com.

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

Maximum pages fetched per run (also caps your cost).

## `crawlScope` (type: `string`):

Which links to follow.

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

How many clicks away from the start URLs.

## `useSitemaps` (type: `boolean`):

Also discover pages from sitemap.xml and robots.txt sitemaps.

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

Only crawl URLs matching these patterns, e.g. https://example.com/blog/\*

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

Skip URLs matching these patterns, e.g. */tag/*, *?page=*

## `outputFormat` (type: `string`):

Markdown keeps headings, lists, tables and links; text is plain.

## `removeSelectors` (type: `array`):

Extra page parts to drop, e.g. .sidebar, #comments.

## `keepNavigationAndFooter` (type: `boolean`):

By default menus, headers, footers, cookie banners and forms are removed.

## `includeLinks` (type: `boolean`):

Add the list of links found on each page.

## `onlyChangedPages` (type: `boolean`):

Return only pages that are new or changed since the last run of the same start URLs; unchanged pages cost $0.0001 instead of a full page.

## `respectRobotsTxt` (type: `boolean`):

Skip pages the site asks crawlers not to visit.

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

Parallel requests.

## `stateStoreName` (type: `string`):

Named store for change-only mode.

## Actor input object example

```json
{
  "startUrls": [
    "https://docs.apify.com/academy"
  ],
  "maxPages": 100,
  "crawlScope": "path-prefix",
  "maxDepth": 5,
  "useSitemaps": true,
  "outputFormat": "markdown",
  "keepNavigationAndFooter": false,
  "includeLinks": false,
  "onlyChangedPages": false,
  "respectRobotsTxt": true,
  "maxConcurrency": 10,
  "stateStoreName": "website-markdown-crawler-state"
}
```

# Actor output Schema

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

No description

## `summary` (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.apify.com/academy"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("dennydevelops/website-markdown-crawler").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.apify.com/academy"] }

# Run the Actor and wait for it to finish
run = client.actor("dennydevelops/website-markdown-crawler").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.apify.com/academy"
  ]
}' |
apify call dennydevelops/website-markdown-crawler --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,dennydevelops/website-markdown-crawler"
        }
    }
}
```

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/3Sgxd3ZfUdDhuU4LH/builds/PCKFwqwPjhp8zhroC/openapi.json
