# Website Content Crawler for AI & RAG: Markdown, $0.40/1K (`leadgenguy/ai-website-content-crawler`) Actor

Crawl any website into clean text and Markdown for LLMs, RAG and search. Same input and output fields as Apify Website Content Crawler. Respects robots.txt. No browser, so fast and cheap: $0.40 per 1,000 pages.

- **URL**: https://apify.com/leadgenguy/ai-website-content-crawler.md
- **Developed by:** [Mokssh jaiin](https://apify.com/leadgenguy) (community)
- **Categories:** AI, Developer tools
- **Stats:** 1 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

Pay per event

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 Content Crawler for AI & RAG: Markdown — $0.40 per 1,000 pages

Turn any website into **clean text and Markdown** ready for LLMs, RAG pipelines, vector databases, chatbots and search. Give it a start URL; it follows links on the same site, strips menus, footers, cookie banners and ads, and returns each page's **main content with headings, lists, links, code blocks and tables kept**.

It uses the **same input and output fields as Apify's own Website Content Crawler** (`startUrls`, `maxCrawlPages`, `maxCrawlDepth`, `includeUrlGlobs`, `excludeUrlGlobs`, `removeElementsCssSelector`; output `url`, `crawl`, `metadata`, `text`, `markdown`), so existing integrations and prompts keep working.

### Why use it

- **Low price:** $0.40 per 1,000 pages, a flat price you can see before you run.
- **Fast:** it reads server HTML directly (no browser), so thousands of pages take minutes.
- **Clean output:** main-content detection, Markdown with structure, per-page title, description, language and Open Graph data.
- **Polite:** respects robots.txt, adjustable concurrency, same-site only.
- **Control:** include and exclude URL patterns, depth and page limits, sitemap discovery.

### Pricing

| Event | Price |
|---|---|
| Page crawled | $0.40 per 1,000 ($0.0004 each) |
| Actor start | $0.00005 |

Free Apify accounts are limited to **25 pages per run**.

### Input

```json
{
  "startUrls": [{ "url": "https://docs.example.com" }],
  "maxCrawlPages": 500,
  "maxCrawlDepth": 5,
  "includeUrlGlobs": [{ "glob": "https://docs.example.com/guides/**" }],
  "excludeUrlGlobs": [{ "glob": "https://docs.example.com/**/changelog/**" }],
  "useSitemaps": true,
  "saveMarkdown": true
}
```

### Output

````json
{
  "url": "https://docs.example.com/guides/start",
  "crawl": { "loadedUrl": "https://docs.example.com/guides/start", "loadedTime": "2026-10-19T10:00:00.000Z", "referrerUrl": "https://docs.example.com/", "depth": 1, "httpStatusCode": 200 },
  "metadata": { "canonicalUrl": "https://docs.example.com/guides/start", "title": "Getting started", "description": "...", "languageCode": "en", "openGraph": { "title": "...", "image": "...", "type": "website", "siteName": "Example" } },
  "screenshotUrl": null,
  "text": "Getting started\nInstall the package...",
  "markdown": "# Getting started\n\nInstall the package...\n\n```\nnpm install example\n```"
}
````

### Honest limits

- **No JavaScript rendering.** Pages that only build their content in the browser (some single-page apps) return little or nothing. Sites that serve their content in HTML, which includes most documentation sites, blogs, news and company sites, work well.
- **No screenshots** (`screenshotUrl` is always null) and no login or form handling.
- Some sites block automated requests. Turn on Apify Proxy in the input to retry through a proxy.
- Content extraction is automatic: unusual page layouts can include or miss some text. Use "Remove elements" to tune it.

### Feedback and reviews

Found a bug, or a page that came out badly? Open an issue on this Actor's **Issues** tab with the URL and it will be looked at quickly. If this Actor saved you time, a short and honest review helps other people find it. Thank you!

### Legal

Only crawl content you are allowed to use. The crawler respects robots.txt by default; respect each site's terms and copyright when you reuse the content.

# Actor input Schema

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

Web addresses to start from, e.g. <code>https://docs.example.com</code>. Links on the same site are followed.

## `maxCrawlPages` (type: `integer`):

Stop after saving this many pages. Free Apify plans: 25 per run.

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

How many link-hops from the start URLs. 0 saves only the start URLs.

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

Only follow links matching these patterns, e.g. <code>https://example.com/docs/\*\*</code>. Empty means the whole site.

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

Never follow links matching these patterns, e.g. <code>https://example.com/**/archive/**</code>.

## `crawlerType` (type: `string`):

This crawler reads the HTML the server sends (fast and cheap). Pages that only build their content with JavaScript are not supported.

## `removeElementsCssSelector` (type: `string`):

Parts of the page to drop before extracting text. Leave empty for a sensible default (navigation, footers, cookie banners, ads, forms).

## `saveMarkdown` (type: `boolean`):

Add the page content as Markdown (headings, lists, links, code and tables kept).

## `saveHtml` (type: `boolean`):

Also add the cleaned main-content HTML.

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

Also discover pages from the site's sitemap.

## `respectRobotsTxtFile` (type: `boolean`):

Skip pages the site asks crawlers not to visit. Recommended.

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

Pages fetched at the same time. Lower it to be gentler on small sites.

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

Off by default. Turn on Apify Proxy for sites that block direct requests.

## Actor input object example

```json
{
  "startUrls": [
    {
      "url": "https://crawlee.dev/js/docs/introduction"
    }
  ],
  "maxCrawlPages": 10,
  "maxCrawlDepth": 20,
  "includeUrlGlobs": [],
  "excludeUrlGlobs": [],
  "crawlerType": "cheerio",
  "saveMarkdown": true,
  "saveHtml": false,
  "useSitemaps": false,
  "respectRobotsTxtFile": true,
  "maxConcurrency": 8,
  "proxyConfiguration": {
    "useApifyProxy": false
  }
}
```

# Actor output Schema

## `jobs` (type: `string`):

All scraped jobs as a dataset.

# 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://crawlee.dev/js/docs/introduction"
        }
    ],
    "proxyConfiguration": {
        "useApifyProxy": false
    }
};

// Run the Actor and wait for it to finish
const run = await client.actor("leadgenguy/ai-website-content-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://crawlee.dev/js/docs/introduction" }],
    "proxyConfiguration": { "useApifyProxy": False },
}

# Run the Actor and wait for it to finish
run = client.actor("leadgenguy/ai-website-content-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://crawlee.dev/js/docs/introduction"
    }
  ],
  "proxyConfiguration": {
    "useApifyProxy": false
  }
}' |
apify call leadgenguy/ai-website-content-crawler --silent --output-dataset

```

## MCP server setup

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