# Website Content Crawler for AI — Clean Markdown, 2x Cheaper (`cycha/website-content-crawler`) Actor

Crawl any website and extract clean text/markdown for LLMs, RAG pipelines, vector databases. BFS crawl with depth control, robots.txt support, boilerplate removal. $0.002/page, half the price of the official Apify crawler.

- **URL**: https://apify.com/cycha/website-content-crawler.md
- **Developed by:** [Ken Digital](https://apify.com/cycha) (community)
- **Categories:** AI
- **Stats:** 93 total users, 6 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $1.60 / 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.
Since this Actor supports Apify Store discounts, the price gets lower the higher subscription plan you have.

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 — Clean Markdown, 2x Cheaper

Crawl any website and extract **clean, structured content** as Markdown, plain text, or HTML. Built specifically for feeding **AI models, LLM applications, vector databases, and RAG pipelines**.

> **New name:** this actor is now `cycha/website-content-crawler` (it was `joyouscam35875/website-content-crawler` until 21 October 2026). If an API call or integration stopped working, update the name, or use the actor ID `SBz2Q1ygdW3W7bfyN`, which never changes.

### Why This Actor?

| Feature | This Actor | Apify Web Scraper | Generic Crawlers |
|---------|-----------|-------------------|------------------|
| **Price per page** | **$0.002** | $0.004+ | $0.005+ |
| **Output format** | Markdown, Text, HTML | Raw HTML | Raw HTML |
| **AI-ready content** | ✅ Clean, no boilerplate | ❌ Manual cleaning needed | ❌ Manual cleaning needed |
| **Strips ads/nav/scripts** | ✅ Automatic | ❌ No | ❌ No |
| **robots.txt** | ✅ Respected | ⚠️ Optional | ❌ Often ignored |
| **Zero config** | ✅ Just add URLs | ❌ Needs selectors | ❌ Needs setup |

**2x cheaper than alternatives.** Same quality output. No configuration needed.

### 🎯 Perfect For

- **RAG pipelines** — Feed clean documents into your retrieval system
- **LLM fine-tuning** — Training data without HTML noise
- **Vector databases** — Chunk clean markdown for embeddings (Pinecone, Weaviate, Qdrant)
- **Knowledge bases** — Build structured content libraries
- **Content analysis** — Word counts, link graphs, language detection
- **AI agents** — Give your agents access to any website's content

### 🚀 Quick Start

#### Input

```json
{
    "startUrls": [
        { "url": "https://docs.python.org/3/" }
    ],
    "maxPages": 50,
    "maxDepth": 3,
    "outputFormat": "markdown"
}
```

#### Output (per page)

```json
{
    "url": "https://docs.python.org/3/tutorial/index.html",
    "title": "The Python Tutorial",
    "content": "# The Python Tutorial\n\nPython is an easy to learn, powerful programming language. It has efficient high-level data structures and a simple but effective approach to object-oriented programming...\n\n## An Informal Introduction to Python\n\nIn the following examples, input and output are distinguished by the presence or absence of prompts...\n\n- [Whetting Your Appetite](appetite.html)\n- [Using the Python Interpreter](interpreter.html)\n- [An Informal Introduction to Python](introduction.html)\n- [More Control Flow Tools](controlflow.html)",
    "wordCount": 1247,
    "language": "en",
    "links": [
        "https://docs.python.org/3/tutorial/appetite.html",
        "https://docs.python.org/3/tutorial/interpreter.html"
    ],
    "crawledAt": "2026-03-28T21:00:00.000Z",
    "statusCode": 200
}
```

### ⚙️ Configuration

| Parameter | Type | Default | Description |
|-----------|------|---------|-------------|
| `startUrls` | Array | *required* | URLs to start crawling from |
| `maxPages` | Number | 50 | Maximum pages to crawl |
| `maxDepth` | Number | 3 | How deep to follow links (0 = start URLs only) |
| `sameDomainOnly` | Boolean | true | Only follow links on the same domain |
| `includeGlobs` | Array | \[] | Only crawl URLs matching these glob patterns |
| `excludeGlobs` | Array | \[] | Skip URLs matching these glob patterns |
| `respectRobotsTxt` | Boolean | true | Follow the site's robots.txt (turn off for your own site) |
| `outputFormat` | Enum | "markdown" | Output format: `markdown`, `text`, or `html` |

### 🧹 What Gets Cleaned

The crawler automatically removes:

- ✂️ **Navigation bars** (`<nav>`, menu classes)
- ✂️ **Headers & footers** (site-wide, not content headings)
- ✂️ **Scripts & styles** (JavaScript, CSS)
- ✂️ **Ads & tracking** (common ad container patterns)
- ✂️ **Cookie banners & popups**
- ✂️ **Social share buttons**
- ✂️ **Sidebars & widgets**
- ✂️ **Comment sections**

What's **preserved**:

- ✅ Headings (H1-H6 → `#` to `######`)
- ✅ Paragraphs with proper spacing
- ✅ Lists (ordered and unordered)
- ✅ Links with URLs
- ✅ Code blocks
- ✅ Bold and italic text
- ✅ Tables
- ✅ Image alt text
- ✅ Blockquotes

### 🔗 Integration Examples

#### Feed into OpenAI / LangChain

```python
from langchain.text_splitter import RecursiveCharacterTextSplitter
from apify_client import ApifyClient

client = ApifyClient("YOUR_TOKEN")
run = client.actor("your-username/website-content-crawler").call(
    run_input={"startUrls": [{"url": "https://example.com"}], "maxPages": 100}
)

splitter = RecursiveCharacterTextSplitter(chunk_size=1000)
for item in client.dataset(run["defaultDatasetId"]).iterate_items():
    chunks = splitter.split_text(item["content"])
    # Feed chunks to your LLM / vector DB
```

#### Load into Pinecone

```python
import pinecone
from openai import OpenAI

## After running the crawler...
for item in dataset.iterate_items():
    embedding = openai_client.embeddings.create(
        input=item["content"][:8000],
        model="text-embedding-3-small"
    ).data[0].embedding

    index.upsert([(item["url"], embedding, {"title": item["title"], "content": item["content"]})])
```

### 💰 Pricing

**$0.002 per page crawled** — that's it.

| Pages | Cost | vs. Alternatives |
|-------|------|------------------|
| 100 | $0.20 | Save $0.20+ |
| 1,000 | $2.00 | Save $2.00+ |
| 10,000 | $20.00 | Save $20.00+ |
| 100,000 | $200.00 | Save $200.00+ |

No monthly fees. No minimum commitment. Pay only for what you crawl.

### 🛡️ Responsible Crawling

- ✅ Respects `robots.txt` the way Google reads it (RFC 9309: wildcards, most specific rule wins); can be turned off for your own sites
- ✅ Rate-limited requests (max ~2 req/sec per domain)
- ✅ Proper User-Agent identification
- ✅ Follows redirects correctly
- ✅ Skips binary files automatically

### 📊 Technical Details

- **Engine:** httpx with HTTP/2 support
- **Parser:** Python stdlib `html.parser` (fast, no heavy dependencies)
- **Crawl strategy:** Breadth-first search (BFS) with depth control
- **Deduplication:** URL normalization prevents re-crawling
- **Encoding:** Detected like a browser does (Content-Type header, `<meta charset>`, byte-order mark, UTF-8 / Windows-1252 fallback)
- **Language detection:** Heuristic-based from content analysis

### Changelog

#### 2026-10-22

- robots.txt read per the standard (RFC 9309): `*` and `$` wildcards, most specific rule wins, rules for other bots no longer applied; new `respectRobotsTxt` option
- Page encoding also read from `<meta charset>`: no more garbled accents on older sites

#### v1.0 (2026-03-28)

- Initial release
- BFS crawling with depth control
- Markdown/text/HTML output formats
- robots.txt compliance
- Boilerplate removal (nav, footer, ads, scripts)
- Link extraction and same-domain filtering
- Glob pattern matching for URL inclusion/exclusion
- Pay-per-event pricing at $0.002/page

***

### Related actors by the same developer

| Actor | What it does |
|---|---|
| [Google News & RSS Scraper](https://apify.com/cycha/rss-news-aggregator) | Articles by keyword, language and country, or from any feed |
| [Google Trends Scraper](https://apify.com/cycha/google-trends-scraper) | Interest over time, related queries and regions for up to 500 keywords |
| [Google Maps Scraper](https://apify.com/cycha/google-maps-scraper) | Local businesses with phone, website and emails, no API key |
| [Amazon Scraper](https://apify.com/cycha/amazon-scraper) | Search results and product details in 17 countries |

# Actor input Schema

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

List of URLs to start crawling from.

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

Maximum number of pages to crawl.

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

How many links deep to follow from start URLs. 0 = only start URLs.

## `sameDomainOnly` (type: `boolean`):

Only follow links on the same domain as the start URL.

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

Only crawl URLs matching these glob patterns. Leave empty to crawl all.

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

Skip URLs matching these glob patterns.

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

Skip pages the site's robots.txt disallows for crawlers (rules for <code>WebsiteContentCrawler</code>, else for <code>\*</code>), and skip a site whose robots.txt is unreachable (server error), as the robots.txt standard requires. Turn off to crawl your own site or a site you have permission to crawl.

## `outputFormat` (type: `string`):

Format for the extracted content.

## Actor input object example

```json
{
  "startUrls": [
    {
      "url": "https://docs.python.org/3/"
    }
  ],
  "maxPages": 50,
  "maxDepth": 3,
  "sameDomainOnly": true,
  "includeGlobs": [],
  "excludeGlobs": [],
  "respectRobotsTxt": true,
  "outputFormat": "markdown"
}
```

# Actor output Schema

## `overview` (type: `string`):

One row per crawled page, with its text as clean Markdown or plain text.

# 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.python.org/3/"
        }
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("cycha/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://docs.python.org/3/" }] }

# Run the Actor and wait for it to finish
run = client.actor("cycha/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://docs.python.org/3/"
    }
  ]
}' |
apify call cycha/website-content-crawler --silent --output-dataset

```

## MCP server setup

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