# Website to Markdown Crawler – Clean RAG Content (`signal_lab/website-to-markdown-crawler`) Actor

Website-to-Markdown crawler for RAG and LLM datasets. Extract clean content, SEO metadata, links, JSON-LD, sitemaps, and robots.txt-compliant pages.

- **URL**: https://apify.com/signal\_lab/website-to-markdown-crawler.md
- **Developed by:** [Signal Lab](https://apify.com/signal_lab) (community)
- **Categories:** AI, Developer tools, SEO tools
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $1.00 / 1,000 markdown page 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/platform/actors/running/actors-in-store#pay-per-event

## What's an Apify Actor?

Actors are web data automations that power AI and operations. They run on the Apify platform to scrape websites, process data, connect APIs, and automate workflows.
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.
Actors are written with capital "A".

## 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.
The best way to integrate Actors is as follows.

- **AI agents and MCP clients** — the [Apify MCP server](https://docs.apify.com/integrations/mcp.md) at `https://mcp.apify.com` (remote, streamable HTTP, OAuth on first use).
- **Agentic workflows and local Actor development** — [Agent Skills](https://apify.com/.well-known/agent-skills/index.json) with the [Apify CLI](https://docs.apify.com/cli/docs.md): `npm install -g apify-cli`, then `apify login`.
- **JavaScript/TypeScript projects** — the official [JS/TS client](https://docs.apify.com/api/client/js/docs.md): `npm install apify-client`.
- **Python projects** — the official [Python client](https://docs.apify.com/api/client/python/docs.md): `pip install apify-client`.
- **Any other language** — the [REST API](https://docs.apify.com/api/v2.md).

For usage examples, see the [API](#api) section below.

For more details, see Apify documentation as [Markdown index](https://docs.apify.com/llms.txt) and [Markdown full-text](https://docs.apify.com/llms-full.txt).

# README

## Website to Markdown Crawler – Clean RAG Content

Convert public web pages into clean Markdown for RAG, LLM applications, semantic search, audits, and content analysis. Each successful page includes readable content plus SEO metadata, headings, canonical URL, links, JSON-LD, crawl depth, and timestamps.

### Start in under a minute

```json
{
  "startUrls": [{ "url": "https://example.com" }],
  "maxPages": 10,
  "maxDepth": 1,
  "sameDomainOnly": true,
  "useSitemaps": true,
  "respectRobotsTxt": true
}
```

Start with one page for a quick test, then raise `maxPages` and `maxDepth`. Use include/exclude patterns and custom CSS removal selectors to control what enters the dataset.

### Example result shape

```json
{
  "url": "https://example.com/",
  "finalUrl": "https://example.com/",
  "statusCode": 200,
  "title": "Example Domain",
  "description": null,
  "canonicalUrl": null,
  "language": "en",
  "headings": ["Example Domain"],
  "markdown": "# Example Domain\n\nThis domain is for use in illustrative examples...",
  "textLength": 125,
  "links": ["https://www.iana.org/domains/example"],
  "jsonLd": [],
  "depth": 0,
  "scrapedAt": "2026-08-09T10:37:49.000Z"
}
```

### Why use this Actor

- Readable Markdown instead of raw HTML.
- Main-content preference with scripts, forms, navigation, footers, and common noise removed.
- Sitemap discovery and robots.txt support.
- Same-domain control, crawl depth, and hard page caps.
- Include/exclude URL fragments and custom removal selectors.
- Built-in SSRF protection for localhost, private IPs, metadata hosts, and credentialed URLs.
- One paid result only for each successful HTML page; skipped and failed pages are summarized in `OUTPUT`.

### Best for

- Preparing small and medium websites for RAG or semantic search.
- Creating Markdown corpora for LLM analysis.
- Extracting documentation, blogs, help centers, and public knowledge bases.
- SEO and content inventory workflows.

### Pricing and limitations

Current launch pricing starts at **$1 per 1,000 successful Markdown page results**; the Pricing tab shows every billable event and the exact estimate.

This is an HTTP crawler. It does not execute client-side JavaScript or bypass login, paywalls, CAPTCHAs, robots rules, or anti-bot controls. Dynamic single-page applications may return incomplete content. Use only where you have a lawful basis and respect site terms, copyright, privacy, and crawl-rate expectations.

# Actor input Schema

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

Public HTTP(S) pages only. Private network targets are blocked.

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

Hard cap on successful HTML pages emitted to the dataset.

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

Maximum number of same-domain link hops from a start URL.

## `sameDomainOnly` (type: `boolean`):

Follow only links whose hostname matches one of the supplied start URLs.

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

Read sitemap URLs declared by robots.txt or the conventional /sitemap.xml path.

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

Skip paths disallowed for the wildcard user agent.

## `includePatterns` (type: `array`):

Optional plain-text URL fragments; at least one must match.

## `excludePatterns` (type: `array`):

Skip URLs containing any of these plain-text fragments.

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

Optional CSS selectors removed before the main page content is converted to Markdown.

## Actor input object example

```json
{
  "startUrls": [
    {
      "url": "https://example.com"
    }
  ],
  "maxPages": 1,
  "maxDepth": 2,
  "sameDomainOnly": true,
  "useSitemaps": true,
  "respectRobotsTxt": true,
  "includePatterns": [],
  "excludePatterns": [
    "/login",
    "/logout",
    "/cart",
    "/checkout"
  ],
  "removeSelectors": [
    ".cookie-banner",
    ".newsletter-popup"
  ]
}
```

# Actor output Schema

## `pages` (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": [
        {
            "url": "https://example.com"
        }
    ],
    "maxPages": 1,
    "maxDepth": 0,
    "sameDomainOnly": true,
    "useSitemaps": false,
    "respectRobotsTxt": true
};

// Run the Actor and wait for it to finish
const run = await client.actor("signal_lab/website-to-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://example.com" }],
    "maxPages": 1,
    "maxDepth": 0,
    "sameDomainOnly": True,
    "useSitemaps": False,
    "respectRobotsTxt": True,
}

# Run the Actor and wait for it to finish
run = client.actor("signal_lab/website-to-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://example.com"
    }
  ],
  "maxPages": 1,
  "maxDepth": 0,
  "sameDomainOnly": true,
  "useSitemaps": false,
  "respectRobotsTxt": true
}' |
apify call signal_lab/website-to-markdown-crawler --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,signal_lab/website-to-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/aWIVezL10rh3NHimV/builds/9bvVphYQMmA0lCMZt/openapi.json
