# Website Content Crawler to Markdown for AI, LLM and RAG (`talcoe/website-to-markdown`) Actor

This website content crawler turns any public site into clean Markdown for LLMs and RAG, starting from URLs or a sitemap with depth, include and exclude filters, billed per page.

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

## Pricing

from $1.00 / 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

### What does Website to Markdown for LLMs and RAG do?

Give it a start URL and it crawls the site over plain HTTP, strips the menus, footers, cookie banners and scripts, and hands back each page as clean Markdown. Every page also comes with its title, description, headings, links and word count. A default run of 100 pages finishes in about 10 seconds because no browser is involved, and you pay one flat price per page converted.

### Data source

Public pages of the site you point it at, fetched live on every run, plus its sitemap if you switch that option on.

### Why use it?

- Feed a RAG index or vector store with docs, help centers and blogs without writing a parser per site.
- Give an AI agent a Markdown copy of a site it can read in one pass.
- Snapshot a competitor's public pages on a schedule and diff the text.
- Skip the cost of a headless browser. Pages that render on the server convert in a fraction of a second each.

You get this for free with every run: robots.txt is respected, duplicate pages are dropped, and the run stops at your page cap so the bill has a ceiling.

### How to use it

1. Open the Actor, paste one or more start URLs and set the page cap.
2. Click Start. Download results as JSON, CSV or Excel, or read them through the API.
3. Add a Schedule and an Integration (Slack, Google Sheets, webhook) to refresh the Markdown automatically.

### Input

| Field | Description |
|---|---|
| `startUrls` | Pages where the crawl begins. Links on the same site and its subdomains are followed. |
| `maxDepth` | Link hops from the start URLs. `0` converts only the start URLs. Default `2`. |
| `useSitemap` | Also load the sitemap (from robots.txt or `/sitemap.xml`) and add its URLs. Default off. |
| `includeGlobs` | Only follow URLs that match one of these globs, such as `https://docs.apify.com/actors/**`. |
| `excludeGlobs` | Never follow URLs that match one of these globs, such as `**/changelog/**`. |
| `respectRobotsTxt` | Skip every URL that robots.txt disallows for all crawlers. Default on. |
| `includeImages` | Keep images as Markdown images. Default off. |
| `maxResults` | Hard stop for the run. You are billed per page converted, so this caps the cost. Default `100`. |
| `proxyConfiguration` | Apify proxy is recommended for larger runs or sites that block datacenter IPs. |

Example input:

```json
{
    "startUrls": [{ "url": "https://docs.apify.com/" }],
    "maxDepth": 2,
    "includeGlobs": ["https://docs.apify.com/actors/**"],
    "maxResults": 100
}
```

### Output

Every record has the same shape:

```json
{
    "id": "https://docs.apify.com/academy",
    "url": "https://docs.apify.com/academy",
    "title": "Apify Academy | Academy | Apify Documentation",
    "description": "Learn everything about web scraping and automation with our free courses.",
    "markdown": "# Apify Academy\n\nLearn everything about web scraping and automation...\n\n## Beginner courses\n\n...",
    "wordCount": 257,
    "headings": [{ "level": 1, "text": "Apify Academy" }, { "level": 2, "text": "Beginner courses" }],
    "links": [{ "text": "Web scraping with AI", "url": "https://docs.apify.com/academy/scraping-with-ai" }],
    "depth": 1,
    "language": "en",
    "canonicalUrl": "https://docs.apify.com/academy",
    "referrerUrl": "https://docs.apify.com/",
    "statusCode": 200,
    "scrapedAt": "2026-11-19T00:28:44.970Z"
}
```

| Field | Meaning |
|---|---|
| `id` | Canonical URL, safe for deduplication between runs |
| `url` | Final URL after redirects |
| `title`, `description` | From the page metadata |
| `markdown` | Main content as Markdown, with absolute links, tables and fenced code blocks |
| `wordCount` | Words in the Markdown |
| `headings` | Heading levels and text in page order |
| `links` | Unique links inside the main content, up to 300 |
| `depth` | Link hops from a start URL |
| `language`, `canonicalUrl` | From the `html` and `link` tags when present |
| `referrerUrl` | The page the crawler found this one on |

### Pricing

Pay per event: a small fee when a run starts, then a fixed price per page returned. Pages with no text and duplicates are not charged. Set `maxResults` to cap any run.

### Limitations

- Pages that build their content in the browser with JavaScript come back thin or empty, and empty pages are dropped. Server rendered sites, docs, blogs and most CMS pages work well.
- Login walls, captchas and paywalled content are out of scope.
- PDFs, images and other files are skipped.
- Main content detection is automatic. On unusual layouts you may see a stray menu line. Use `excludeGlobs` to skip page types you do not want.

### FAQ

**Is this legal?** The Actor reads pages the site publishes for any visitor without a login and obeys robots.txt by default. You are responsible for how you use the content.

**Can I crawl several sites at once?** Yes. Add several start URLs and each site is followed on its own host.

**Something is missing or broken?** Open an issue in the Issues tab; response time is usually under a day.

# Actor input Schema

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

Pages where the crawl begins. Only links on the same site (and its subdomains) are followed.

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

How many link hops to follow from the start URLs. 0 converts only the start URLs.

## `useSitemap` (type: `boolean`):

Load the site's sitemap (from robots.txt or /sitemap.xml) and add its URLs to the crawl. Good for full coverage of docs sites.

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

Only follow URLs that match one of these globs, for example https://docs.apify.com/platform/\*\*. Start URLs are always converted. Leave empty to allow the whole site.

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

Never follow URLs that match one of these globs, for example **/changelog/**.

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

Skip every URL that robots.txt disallows for all crawlers.

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

Keep image tags as Markdown images. Off by default to keep the text clean for LLMs.

## `maxResults` (type: `integer`):

Hard stop for the run. You are billed per page converted, so this caps the cost.

## `proxyConfiguration` (type: `object`):

Apify proxy is recommended for larger runs or sites that block datacenter IPs.

## Actor input object example

```json
{
  "startUrls": [
    {
      "url": "https://docs.apify.com/"
    }
  ],
  "maxDepth": 2,
  "useSitemap": false,
  "includeGlobs": [],
  "excludeGlobs": [],
  "respectRobotsTxt": true,
  "includeImages": false,
  "maxResults": 100,
  "proxyConfiguration": {
    "useApifyProxy": false
  }
}
```

# Actor output Schema

## `results` (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://docs.apify.com/"
        }
    ],
    "proxyConfiguration": {
        "useApifyProxy": false
    }
};

// Run the Actor and wait for it to finish
const run = await client.actor("talcoe/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/" }],
    "proxyConfiguration": { "useApifyProxy": False },
}

# Run the Actor and wait for it to finish
run = client.actor("talcoe/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/"
    }
  ],
  "proxyConfiguration": {
    "useApifyProxy": false
  }
}' |
apify call talcoe/website-to-markdown --silent --output-dataset

```

## MCP server setup

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