# Website to Markdown Crawler for AI, RAG & HTML to Markdown (`datafeedlab/website-markdown-crawler`) Actor

Website to Markdown crawler and HTML to Markdown converter for AI agents, RAG pipelines and LLM apps. Respects robots.txt and sitemaps.

- **URL**: https://apify.com/datafeedlab/website-markdown-crawler.md
- **Developed by:** [DataFeed Lab](https://apify.com/datafeedlab) (community)
- **Categories:** AI, Developer tools, Automation
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 88.9% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

$1.00 / 1,000 page (markdown)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 Crawler for AI, RAG & HTML to Markdown

**A website to Markdown crawler and HTML to Markdown converter for AI agents, RAG pipelines and LLM apps.** The Actor starts from the URLs you give it, stays on the same site, optionally reads the **sitemap**, and **always respects robots.txt** (including `Crawl-delay`). Each saved page includes Markdown, headings, title, description, canonical URL, language and link counts.

No browser and no proxy are required for ordinary public HTML, which keeps runs fast and cheap.

💸 **$1.00 per 1,000 pages. No start fee.** Pages blocked by robots.txt, marked `noindex`, non-HTML responses and failed requests are free.

### Why this Actor?

| | This Actor | Typical browser crawlers |
|---|---|---|
| Price | **$1 / 1,000 pages**, no start fee | often $3+ / 1,000, plus start fees or compute-heavy browsers |
| Output | Clean Markdown + headings + metadata | often raw HTML or noisy text |
| robots.txt & sitemaps | ✅ always on (robots); sitemaps optional | sometimes ignored |
| Browser | Not used (HTTP + HTML) | Playwright / Puppeteer |
| Built for | AI, RAG, MCP, embeddings | general scraping |

Apify's official Website Content Crawler is a solid free option if you want a full browser and more features. This Actor is the cheaper, simpler path when you need Markdown from public HTML and want predictable pay-per-page pricing.

### Use cases

- **RAG / vector stores** — crawl a docs site or help center and embed the Markdown.
- **AI agents / MCP** — give an agent clean page text instead of raw HTML.
- **Content inventories & migrations** — export titles, headings and body copy from a site.
- **Research** — collect public articles or documentation from a domain list.

### How to use

1. Paste one or more **start URLs** (or domains).
2. Set **Max pages** and **Max link depth**. Depth `0` keeps only the start URLs (and sitemap URLs if enabled).
3. Leave **Read sitemaps** on to discover pages from `robots.txt` and `/sitemap.xml`.
4. Optionally restrict URLs with include/exclude patterns (e.g. `*/docs/*`).
5. Run and export the Overview table, or take the `markdown` field into your vector store.

The Actor **never disables robots.txt**. It does not log in, fill forms, solve CAPTCHAs or bypass bot protection. Sites that block automated access are reported in the run summary and are not charged.

#### Example input

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

#### Example output

```json
{
  "url": "https://example.com",
  "finalUrl": "https://example.com/",
  "statusCode": 200,
  "title": "Example Domain",
  "description": null,
  "language": "en",
  "headings": [{"level": 1, "text": "Example Domain"}],
  "markdown": "# Example Domain\n\nThis domain is for use in illustrative examples…",
  "wordCount": 38,
  "depth": 0,
  "source": "public HTML (robots.txt respected)",
  "scrapedAt": "2026-11-13T21:00:00+00:00"
}
```

### Pricing

Pay-per-event: **$0.001 per saved page** ($1.00 per 1,000). No start fee. Set a maximum cost per run to cap spend. Skipped and failed URLs are listed in `RUN_SUMMARY` and are free.

### Responsible use

- Fetches only publicly reachable HTTP(S) pages that **robots.txt allows** for this Actor's User-Agent.
- Honours `Crawl-delay` and an optional extra per-host delay.
- By default skips pages with a `noindex` robots meta tag.
- Stays on the same site (registrable domain, origin, or path prefix).
- No login, no CAPTCHA solving, no bypass of bot protection, and no structured extraction of personal emails or phone numbers. The Markdown is the visible public content of the page.

You are responsible for how you use the data (copyright, site terms, and applicable law). Do not crawl sites that forbid it in robots.txt or their terms.

### Limitations

- JavaScript-only pages may return little or no content, because no browser is used. That is a deliberate trade-off for cost and speed.
- Some sites block datacenter IP addresses; those URLs are reported as failed and are free.
- Markdown is taken from `article` / `main` when present, otherwise from the page body after dropping scripts and styles.

### FAQ

**Is this a replacement for Apify's Website Content Crawler?** It covers the same "HTML to Markdown for AI" job with a simpler, cheaper HTTP crawler. Use the official crawler if you need a real browser, JS rendering or its extra integrations.

**Can I start from a sitemap only?** Yes — pass the site's home page (or the sitemap URL as a start URL) and keep *Read sitemaps* on. The home page and sitemap entries are queued first.

**Can I call it from an AI agent?** Yes, via the Apify API, official clients, or [Apify's MCP server](https://mcp.apify.com).

### More Actors by DataFeed Lab

ToS-compliant data Actors for growth, product and research teams. All are callable from the Apify API, integrations, or [Apify's MCP server](https://mcp.apify.com) for AI agents.

- [Greenhouse Jobs Scraper](https://apify.com/datafeedlab/ats-jobs-scraper) — Official Greenhouse, Lever, Ashby, Workable, SmartRecruiters and Recruitee job APIs, with salary, remote flag and a new-jobs monitor. $1 per 1,000 jobs.
- [WHOIS Lookup](https://apify.com/datafeedlab/bulk-domain-intel) — Bulk WHOIS/RDAP domain age and expiry, DNS, SPF/DMARC and SSL checker. $1 per 1,000 domains.
- [Contact Details Scraper](https://apify.com/datafeedlab/contact-details-scraper) — Company emails, phones, social profiles, contact forms and tech stack (no personal emails). $2 per 1,000 sites with contacts.
- [Shopify Scraper](https://apify.com/datafeedlab/shopify-products-scraper) — Products, prices, variants, stock and sales, with a price/stock monitor. $0.70 per 1,000 products.
- [Tech Stack Detector](https://apify.com/datafeedlab/tech-stack-detector) — BuiltWith alternative: CMS, Shopify, analytics, pixels and hosting. $1 per 1,000 sites.
- [App Store Reviews Scraper](https://apify.com/datafeedlab/app-store-reviews) — Official Apple iOS reviews and metadata. $0.08 per 1,000 rows.
- [OpenStreetMap POI Scraper](https://apify.com/datafeedlab/osm-places) — Local business leads via the official Overpass API. $0.50 per 1,000 places.
- [Hacker News Scraper](https://apify.com/datafeedlab/hacker-news-scraper) — Stories, search, Ask HN and parsed Who is Hiring jobs. $0.10 per 1,000 items.

# Actor input Schema

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

Pages or domains to start from (one per line). The crawler stays on the same site, follows links, and can also read the site's sitemap.

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

Maximum HTML pages to save (and charge). Failed, blocked, non-HTML and robots-disallowed URLs are free.

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

0 = only the start URLs (and sitemap URLs, if enabled). 1 = also follow links from those pages, and so on.

## `scope` (type: `string`):

Limits which URLs may be crawled. same_domain allows other subdomains of the same site; same_origin is stricter; path_prefix also stays under each start URL's path.

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

Discover URLs from robots.txt Sitemap: lines and /sitemap.xml. Only URLs on the same site are queued.

## `respectNoIndex` (type: `boolean`):

Skip pages whose HTML meta robots includes noindex. Those pages are free.

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

Optional. Keep only URLs matching at least one pattern. \* is a wildcard, e.g. */docs/* or https://example.com/blog/\*.

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

Optional. Drop URLs matching any pattern, e.g. */tag/* or \*/wp-login.php.

## `maxMarkdownChars` (type: `integer`):

Longer pages are truncated (a \[truncated] marker is added). Lowers dataset size for RAG chunking.

## `requestDelaySecs` (type: `number`):

The Actor also honours Crawl-delay from robots.txt when it is higher than this value.

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

Parallel requests. Each host is still rate-limited individually.

## Actor input object example

```json
{
  "startUrls": [
    "https://example.com",
    "https://www.iana.org/domains/reserved"
  ],
  "maxPages": 50,
  "maxDepth": 2,
  "scope": "same_domain",
  "useSitemaps": true,
  "respectNoIndex": true,
  "maxMarkdownChars": 20000,
  "requestDelaySecs": 0,
  "maxConcurrency": 4
}
```

# Actor output Schema

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

Crawled pages ('Overview' view).

## `runSummary` (type: `string`):

Counts and errors (free).

# 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://example.com",
        "https://www.iana.org/domains/reserved"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("datafeedlab/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://example.com",
        "https://www.iana.org/domains/reserved",
    ] }

# Run the Actor and wait for it to finish
run = client.actor("datafeedlab/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://example.com",
    "https://www.iana.org/domains/reserved"
  ]
}' |
apify call datafeedlab/website-markdown-crawler --silent --output-dataset

```

## MCP server setup

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