# Website to Markdown Crawler for LLM, RAG & AI Context (`physealabs/website-markdown-crawler`) Actor

Crawl any website and get each page as clean Markdown with title, description, word count and token estimate. Menus, footers and cookie banners removed. Built by Physea Labs (Liminal). Launch Sale: 90% OFF for the first week. $0.001 per page.

- **URL**: https://apify.com/physealabs/website-markdown-crawler.md
- **Developed by:** [jay casey](https://apify.com/physealabs) (community)
- **Categories:** AI, Developer tools
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

$1.00 / 1,000 page converted to markdowns

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 Crawler for LLM, RAG & AI Context

Give it a URL and get every page of the site as clean Markdown, ready to paste into ChatGPT, load into a vector database or feed an agent. Navigation, footers, cookie banners and scripts are stripped before conversion.

🚀 **Launch Sale: 90% OFF for the first week!** Prices below are the regular rates; launch-week runs are billed at a tenth of them.

### What can it do?

| What you get | Features |
|---|---|
| 📝 Clean Markdown: headings, lists, tables, code blocks, links | ⚡ Plain HTTP, no browser: 5 pages in about 2 seconds |
| 🔢 Word count and token estimate per page | 🤖 robots.txt respected, same-site and same-path scoping |
| 🏷️ Title, meta description, language, canonical URL | 📤 JSON, CSV, API, LangChain / LlamaIndex loaders |

### Who this is for

- RAG pipelines and vector databases that need clean page text
- Building a custom GPT or agent knowledge base from docs sites
- Content audits and migrations: every page's text in one dataset
- Feeding competitor docs or help centers into an LLM for analysis

### What you get back

| Field | Type | What you get | Example |
|---|---|---|---|
| `url` | `string` | Page URL | `https://crawlee.dev/python/docs/quick-start` |
| `title` | `string` | Page <title> | `Quick start | Crawlee for Python` |
| `markdown` | `string` | Clean Markdown of the main content | `# Quick start\n\nThis short tutorial...` |
| `word_count` | `integer` | Words in the Markdown | `1268` |
| `est_tokens` | `integer` | Rough LLM token estimate (chars / 4) | `3790` |
| `depth` | `integer` | Link hops from the start URL | `0` |
| `description` | `string` | Meta description | `This short tutorial will help you...` |
| `canonical_url` | `string` | Canonical URL | `https://crawlee.dev/python/docs/quick-start` |
| `status` | `string` | `ok`, `error` or `skipped` | `ok` |

Every run also writes `RUN_SUMMARY.json` to the key-value store (counts, spend-limit flag, pricing).

### What you need to provide

| Field | Type | What it does | Example |
|---|---|---|---|
| `startUrls` | `array` | Pages to start from. Links on the same site (and under the same path, by default) are followed. | `[{"url": "https://crawlee.dev/python/docs/quick-start"}]` |
| `maxPages` | `integer` | Stop after this many pages are converted. | `5` |
| `maxDepth` | `integer` | 0 = only the start URLs, 1 = plus pages they link to, and so on. | `1` |
| `stayUnderStartPath` | `boolean` | Only follow links below the start URL's folder (e.g. /docs/). | `true` |
| `includeGlobs` | `array` | Optional glob patterns, e.g. https://example.com/blog/\* | `-` |
| `excludeGlobs` | `array` | Optional glob patterns, e.g. */tag/* | `-` |
| `keepLinks` | `boolean` | Off gives plain text-only Markdown (fewer tokens). | `true` |
| `respectRobotsTxt` | `boolean` | Skip pages the site disallows for crawlers. | `true` |
| `maxConcurrency` | `integer` | Pages fetched at the same time. | `5` |

#### Quick start

1. Click **Try for free**.
2. Press **Start**: the sample input finishes in under a minute with no API keys or setup.
3. Replace the sample with your own values and run again.
4. Open the dataset, or export it as JSON, CSV or Excel.

### Pricing

🚀 **Launch Sale: 90% OFF for the first week!**

- `page-converted`: **$0.001** per page converted to Markdown ($1 per 1,000 pages).
- Failed, empty, non-HTML and robots-blocked pages are not charged.
- Set a max cost per run in the run options and the run stops cleanly when it hits it.
- Normal Apify platform usage applies.

### Limits and honest notes

- Pages are fetched as HTML without a browser. Sites that render their text only with JavaScript come back as `error` rows ("no readable text") and are not charged.
- PDFs, images and other non-HTML files are skipped.
- The crawl stays on the start URL's host; use several start URLs for several sites.
- No other Apify actor is called: everything is collected in-house over plain HTTP.

### Run it from code

Same input as the Console sample:

```json
{
  "startUrls": [
    {
      "url": "https://crawlee.dev/python/docs/quick-start"
    }
  ],
  "maxPages": 5,
  "maxDepth": 1
}
```

```sh
curl -X POST "https://api.apify.com/v2/acts/physealabs~website-markdown-crawler/run-sync-get-dataset-items?token=$APIFY_TOKEN" \
  -H "Content-Type: application/json" -d @input.json
```

```python
from apify_client import ApifyClient
items = ApifyClient("YOUR_APIFY_TOKEN").actor("physealabs/website-markdown-crawler").call(run_input={"startUrls": [{"url": "https://crawlee.dev/python/docs/quick-start"}], "maxPages": 5, "maxDepth": 1})
```

It also works from Zapier, Make, n8n and Apify schedules.

### About Physea Labs · Liminal

Built and maintained by **Physea Labs**: the same extraction layer that feeds [Liminal](https://physea.ai), our grounded research and decision engine. If it is good enough to feed Liminal's citations, it is good enough for your pipeline.

# Actor input Schema

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

Pages to start from. Links on the same site (and under the same path, by default) are followed.

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

Stop after this many pages are converted.

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

0 = only the start URLs, 1 = plus pages they link to, and so on.

## `stayUnderStartPath` (type: `boolean`):

Only follow links below the start URL's folder (e.g. /docs/).

## `includeGlobs` (type: `array`):

Optional glob patterns, e.g. https://example.com/blog/\*

## `excludeGlobs` (type: `array`):

Optional glob patterns, e.g. */tag/*

## `keepLinks` (type: `boolean`):

Off gives plain text-only Markdown (fewer tokens).

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

Skip pages the site disallows for crawlers.

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

Pages fetched at the same time.

## Actor input object example

```json
{
  "startUrls": [
    {
      "url": "https://crawlee.dev/python/docs/quick-start"
    }
  ],
  "maxPages": 5,
  "maxDepth": 1,
  "stayUnderStartPath": true,
  "keepLinks": true,
  "respectRobotsTxt": true,
  "maxConcurrency": 5
}
```

# Actor output Schema

## `pages` (type: `string`):

One row per item; error rows explain anything that was skipped and are never charged.

## `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": [
        {
            "url": "https://crawlee.dev/python/docs/quick-start"
        }
    ],
    "maxPages": 5,
    "maxDepth": 1
};

// Run the Actor and wait for it to finish
const run = await client.actor("physealabs/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": [{ "url": "https://crawlee.dev/python/docs/quick-start" }],
    "maxPages": 5,
    "maxDepth": 1,
}

# Run the Actor and wait for it to finish
run = client.actor("physealabs/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": [
    {
      "url": "https://crawlee.dev/python/docs/quick-start"
    }
  ],
  "maxPages": 5,
  "maxDepth": 1
}' |
apify call physealabs/website-markdown-crawler --silent --output-dataset

```

## MCP server setup

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