# Website to Markdown Crawler for AI (`latam_data/website-to-markdown-crawler-for-ai`) Actor

Crawl any website and get clean Markdown or text of every page for ChatGPT, RAG, vector databases and LLMs. Follows sitemaps and links, respects robots.txt. Fast, cheap, no browser.

- **URL**: https://apify.com/latam_data/website-to-markdown-crawler-for-ai.md
- **Developed by:** [Cristian Camilo Gomez Diaz](https://apify.com/latam_data) (community)
- **Features:** Limited permissions, Multi-tenant, Server interface
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $0.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

### What does Website to Markdown Crawler do?

**Website to Markdown Crawler** crawls any website and returns the **clean content of every page as Markdown or plain text**, ready for **ChatGPT, Claude, RAG pipelines, vector databases, custom GPTs and LLM fine-tuning**. Give it a start URL and it follows the **sitemap and internal links**, removes menus, headers, footers and cookie banners, and keeps headings, lists, links, tables and code blocks.

- 🤖 **LLM-ready Markdown**: clean, structured content with headings, tables and code
- 🗺️ **Sitemap + link crawling**: finds pages fast, with depth, include and exclude filters
- 🧹 **Three content modes**: main content, article (Mozilla Readability) or full page
- 🤝 **Polite**: respects robots.txt by default
- ⚡ **No browser**: hundreds of pages per minute at a low price
- 💸 **Pay only for saved pages**: empty and failed pages are free

### Why crawl websites to Markdown?

- 🧠 **RAG and AI chatbots**: feed your docs, help center or website into a vector database (Pinecone, Qdrant, Weaviate, Chroma) or an AI assistant.
- 📚 **Custom GPTs and knowledge bases**: export a whole site as knowledge files.
- 🔍 **SEO and content audits**: get every page's title, description, word count and content.
- 🏷️ **Competitor research**: read the full content of competitor sites and docs.
- 🗃️ **Archiving and migration**: move content from an old CMS to a new one.

### How to use it

1. Click **Try for free**.
2. Add one or more **Start URLs**, for example `https://docs.example.com`.
3. Set **Max pages** and, if needed, **Include** or **Exclude** patterns.
4. Click **Start** and download the results as JSON, CSV, Excel or Markdown fields, or use the API.

### Input example

```json
{
    "startUrls": [{ "url": "https://docs.apify.com/academy" }],
    "maxPages": 200,
    "maxDepth": 3,
    "extractionMode": "main",
    "outputFormats": ["markdown"],
    "useSitemap": true,
    "stayOnPath": true,
    "excludeUrlGlobs": ["**/changelog/**"]
}
```

### Output example

```json
{
    "url": "https://docs.apify.com/academy/web-scraping-for-beginners",
    "title": "Web scraping for beginners | Academy",
    "description": "Learn how to develop web scrapers with this comprehensive and practical course.",
    "language": "en",
    "depth": 1,
    "wordCount": 812,
    "markdown": "# Web scraping for beginners\n\nLearn how to develop web scrapers...\n\n## What you will learn\n\n- How to collect data...",
    "crawledAt": "2026-11-18T17:30:00.000Z"
}
```

### How much does it cost?

This Actor uses **pay per result**: you pay only for the pages saved, plus a tiny start fee. Empty pages, errors and pages blocked by robots.txt are free. See the **Pricing** tab for the current price. Apify's free plan includes monthly credits, enough for thousands of pages.

### Tips

- **Only the docs section**: turn on **Stay inside the start URL path** or add an include pattern like `https://example.com/docs/**`.
- **Blogs and news**: use **Article (Readability)** mode for the cleanest text.
- **Single articles from many sites**: use our [Article Text Extractor](https://apify.com/latam_data/article-text-extractor).
- **News monitoring**: combine with our [Google News Scraper](https://apify.com/latam_data/google-news-scraper).
- **Screenshots or PDFs of pages**: use our [Website Screenshot & PDF Generator](https://apify.com/latam_data/website-screenshot-pdf-generator).
- **Websites that need JavaScript**: this crawler reads the HTML the server sends, which works for most docs, blogs and company sites. Pages that load all content with JavaScript may come back short.

### Integrations and API

Send pages to Pinecone, Qdrant, Google Sheets, Airtable, Notion or a webhook with [Make](https://www.make.com/en/register?pc=latamdata), Zapier, n8n or LangChain, or call the Actor from your code with the [Apify API](https://docs.apify.com/api/v2). New to Apify? [Create a free account here](https://apify.com?fpr=rfn03e).

Need ready-made data APIs? See [Zyla API Hub](https://zylalabs.com/a/f9jcfkz8). Crawling sites that block you? Proxies from [Webshare](https://www.webshare.io/?referral_code=v5e0reweus4m) or scraping APIs like [ScraperAPI](https://www.scraperapi.com/?fp_ref=camilo-66b5f5) and [ScrapeOps](https://scrapeops.io?fpr=camilo-1a3b24) help.

### Is it legal?

The crawler reads public pages, does not log in and respects robots.txt by default. You are responsible for having the right to use the content you crawl, for respecting copyright and each website's terms, and for not collecting personal data without a legal basis.

### Feedback

Need another option or format? Open an issue in the **Issues** tab.

# Actor input Schema

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

Websites or sections to crawl, for example https://docs.example.com. The crawler stays on the same domain.

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

Maximum number of pages to save.

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

How many clicks away from the start URL to follow links. 0 = only the start URLs (plus sitemap URLs if enabled).

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

Main content removes menus, headers, footers and sidebars. Article mode uses Mozilla Readability (best for blogs and news). Full page keeps everything in the body.

## `outputFormats` (type: `array`):

Markdown keeps headings, lists, links, tables and code blocks. Text is plain text. HTML is the raw page.

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

Also find pages from the site's sitemap. Finds more pages faster.

## `stayOnPath` (type: `boolean`):

Only crawl pages under the start URL's folder, for example only /docs/ pages.

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

Optional. Only save pages whose URL matches one of these patterns. Use \* for any text in one path part and \*\* for anything, for example https://example.com/blog/\*\*

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

Optional. Skip pages whose URL matches one of these patterns, for example **/tag/** or **/login**

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

Skip pages the website's robots.txt asks crawlers not to visit.

## `minWords` (type: `integer`):

Pages with fewer words (empty or redirect pages) are skipped and not charged.

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

How many pages to download at the same time. Lower it if the website blocks you.

## Actor input object example

```json
{
  "startUrls": [
    {
      "url": "https://docs.apify.com/academy"
    }
  ],
  "maxPages": 50,
  "maxDepth": 3,
  "extractionMode": "main",
  "outputFormats": [
    "markdown"
  ],
  "useSitemap": true,
  "stayOnPath": false,
  "respectRobotsTxt": true,
  "minWords": 20,
  "maxConcurrency": 10
}
```

# 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/academy"
        }
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("latam_data/website-to-markdown-crawler-for-ai").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/academy" }] }

# Run the Actor and wait for it to finish
run = client.actor("latam_data/website-to-markdown-crawler-for-ai").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/academy"
    }
  ]
}' |
apify call latam_data/website-to-markdown-crawler-for-ai --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,latam_data/website-to-markdown-crawler-for-ai"
        }
    }
}
```

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/TjQee9OfNRFzL7sf3/builds/iGG2a5IFRgFO3aZrt/openapi.json
