# Website to Markdown for AI & RAG: Fast Crawler (`tindacloud/website-to-markdown`) Actor

Crawl any website and convert every page into clean, LLM-ready Markdown for RAG, AI agents and fine-tuning. Main content extraction, sitemap discovery, chunking with overlap, token estimates. Fast HTTP crawler, pay per page.

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

## Pricing

from $1.50 / 1,000 pages

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 for AI & RAG: Fast Crawler

Crawl any website or documentation section and convert every page into **clean, LLM-ready Markdown**:

- main content only, without menus, cookie banners or footers
- page metadata, headings and last-modified dates
- optional **chunks with overlap**, ready for embeddings

Built for **RAG pipelines, AI agents, chatbots, knowledge bases and fine-tuning datasets**.

### Why this crawler

- **Fast and cheap.** Plain HTTP, no headless browser: 50 documentation pages in about 7 seconds in testing. You pay per converted page, and thin or empty pages below your word threshold are free.
- **Clean Markdown.**
  - Mozilla Readability main-content extraction, GitHub-flavored Markdown tables and fenced code blocks.
  - Absolute links, heading-anchor noise removed.
- **Finds the pages that matter.**
  - Discovers URLs from robots.txt sitemaps and follows internal links.
  - Stays inside the section you started from (e.g. /docs/), with include/exclude URL globs.
- **RAG-ready output.**
  - Heading-aware chunking with configurable size and overlap, and token estimates per page and chunk.
  - `lastModified` from sitemaps for incremental re-indexing.
- **Polite by default.** Respects robots.txt and removes tracking parameters.

### Input example

```json
{
  "startUrls": [{ "url": "https://docs.apify.com/platform/actors" }],
  "maxPages": 500,
  "maxCrawlDepth": 5,
  "stayWithinStartPath": true,
  "useSitemaps": true,
  "excludeUrlGlobs": ["**/changelog/**"],
  "extractionMode": "article",
  "includeLinks": true,
  "chunkSize": 1500,
  "chunkOverlap": 200
}
```

### Output example

```json
{
  "url": "https://docs.apify.com/get-started",
  "title": "Get started | Platform | Apify Documentation",
  "description": "Learn how the Apify platform works - what Actors are, how they get to Apify Store, and how to start by running existing Actors or building your own.",
  "language": "en",
  "canonicalUrl": "https://docs.apify.com/get-started",
  "lastModified": "Thu, 17 Sep 2026 12:02:20 GMT",
  "markdown": "Apify is a cloud platform for web scraping, data extraction, and automation. Everything on it revolves around *Actors* - serverless programs that run in the cloud. This page explains how the platform fits together and where to start, whether you want to use ex…",
  "headings": [
    {
      "level": 1,
      "text": "Get started"
    },
    {
      "level": 2,
      "text": "How Apify works"
    },
    {
      "level": 2,
      "text": "How Actors get to Apify Store"
    }
  ],
  "wordCount": 388,
  "tokenEstimate": 721,
  "chunks": [
    {
      "index": 0,
      "text": "Apify is a cloud platform for web scraping, data extraction, and automation. Everything on it revolves around *Actors* -…",
      "tokenEstimate": 293
    },
    {
      "index": 1,
      "text": "rom your code like a regular API.\n\nFor how the platform is built, what happens during a run, and how workloads stay isol…",
      "tokenEstimate": 238
    }
  ],
  "crawlDepth": 1
}
```

### Use cases

- **RAG & chatbots:** index product docs, help centers and blogs into vector databases.
- **AI agents:** give agents up-to-date website knowledge as Markdown.
- **Fine-tuning & evaluation datasets:** collect clean text corpora from websites.
- **Content migration & SEO audits:** export site content with headings and metadata.
- **Change monitoring:** re-crawl with sitemap `lastModified` dates.

### Pricing

Pay per converted page, plus a negligible start fee per run. Pages shorter than *Skip pages shorter than (words)* are not returned or charged.

### Notes

- Pages that render their content only with client-side JavaScript may produce little text. For those, a browser-based crawler is needed.
- Respect each website's terms of use when crawling and reusing content.

### Related Actors

Other scrapers from the same maker, built the same way — no browser where it isn't needed, one flat price per result:

- [Google Ads Transparency Scraper](https://apify.com/tindacloud/google-ads-transparency)
- [Website Contact & Email Scraper](https://apify.com/tindacloud/website-contact-scraper)

# Actor input Schema

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

Websites or sections to convert, e.g. https://docs.example.com/guide/. Pages under the same path are crawled.

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

Total pages to convert. You are charged per page.

## `maxCrawlDepth` (type: `integer`):

How many clicks away from the start URL to follow links (0 = only start URLs and sitemap pages).

## `stayWithinStartPath` (type: `boolean`):

Only crawl URLs under the start URL's folder (e.g. /docs/). Turn off to crawl the whole domain.

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

Discover pages from robots.txt and sitemap.xml, including last-modified dates.

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

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

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

Skip URLs matching these globs, e.g. **/tag/**, \**/page/*

## `extractionMode` (type: `string`):

How much of each page to keep.

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

Keep [text](url) links. Turn off for plain text-like Markdown.

## `includeImages` (type: `boolean`):

Keep ![alt](src) image references.

## `includePlainText` (type: `boolean`):

Adds a text field without Markdown syntax.

## `chunkSize` (type: `integer`):

Split each page into chunks of about this many characters for embeddings (0 = no chunking). ~4 characters ≈ 1 token.

## `chunkOverlap` (type: `integer`):

Characters repeated between consecutive chunks.

## `minWordCount` (type: `integer`):

Pages with less content are not returned or charged.

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

Skip URLs disallowed for all crawlers.

## `proxy` (type: `object`):

Usually not needed. Enable Apify Proxy if a site blocks requests.

## Actor input object example

```json
{
  "startUrls": [
    {
      "url": "https://docs.apify.com/platform/actors"
    }
  ],
  "maxPages": 100,
  "maxCrawlDepth": 5,
  "stayWithinStartPath": true,
  "useSitemaps": true,
  "extractionMode": "article",
  "includeLinks": true,
  "includeImages": false,
  "includePlainText": false,
  "chunkSize": 0,
  "chunkOverlap": 200,
  "minWordCount": 20,
  "respectRobotsTxt": true
}
```

# Actor output Schema

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

All converted pages in a table view.

# 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://docs.apify.com/platform/actors"
        }
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("tindacloud/website-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": [{ "url": "https://docs.apify.com/platform/actors" }] }

# Run the Actor and wait for it to finish
run = client.actor("tindacloud/website-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": [
    {
      "url": "https://docs.apify.com/platform/actors"
    }
  ]
}' |
apify call tindacloud/website-to-markdown --silent --output-dataset

```

## MCP server setup

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