# Website Content Crawler for AI — Clean Markdown, 4x Cheaper (`joyouscam35875/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. Perfect for feeding AI models. $0.001/page — 4x cheaper than the official Apify crawler.

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

## Pricing

Pay per usage

This Actor is paid per platform usage. The Actor is free to use, and you only pay for the Apify platform usage, which gets cheaper the higher subscription plan you have.

Learn more: https://docs.apify.com/actors/running/actors-in-store.md#pay-per-usage

## What's an Apify Actor?

Actors are web data automations that power AI and operations. They run on the Apify platform to scrape websites, process data, connect APIs, and automate workflows.
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.
Actors are written with capital "A".

## 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.
The best way to integrate Actors is as follows.

- **AI agents and MCP clients** — the [Apify MCP server](https://docs.apify.com/integrations/mcp.md) at `https://mcp.apify.com` (remote, streamable HTTP, OAuth on first use).
- **Agentic workflows and local Actor development** — [Agent Skills](https://apify.com/.well-known/agent-skills/index.json) with the [Apify CLI](https://docs.apify.com/cli/docs.md): `npm install -g apify-cli`, then `apify login`.
- **JavaScript/TypeScript projects** — the official [JS/TS client](https://docs.apify.com/api/client/js/docs.md): `npm install apify-client`.
- **Python projects** — the official [Python client](https://docs.apify.com/api/client/python/docs.md): `pip install apify-client`.
- **Any other language** — the [REST API](https://docs.apify.com/api/v2.md).

For usage examples, see the [API](#api) section below.

For more details, see Apify documentation as [Markdown index](https://docs.apify.com/llms.txt) and [Markdown full-text](https://docs.apify.com/llms-full.txt).

# README

## 🕷️ Website Content Crawler for AI — Clean Markdown, 4x 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**.

### Why This Actor?

| Feature | This Actor | Apify Web Scraper | Generic Crawlers |
|---------|-----------|-------------------|------------------|
| **Price per page** | **$0.001** | $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 |

**4x 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 |
| `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.001 per page crawled** — that's it.

| Pages | Cost | vs. Alternatives |
|-------|------|------------------|
| 100 | $0.10 | Save $0.30+ |
| 1,000 | $1.00 | Save $3.00+ |
| 10,000 | $10.00 | Save $30.00+ |
| 100,000 | $100.00 | Save $300.00+ |

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

### 🛡️ Responsible Crawling

- ✅ Respects `robots.txt` directives
- ✅ 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:** Auto-detected from Content-Type headers
- **Language detection:** Heuristic-based from content analysis

### Changelog

#### 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.001/page

***

### 🔗 More Scrapers by Ken Digital

| Scraper | What it does | Price |
|---------|-------------|-------|
| [YouTube Channel Scraper](https://apify.com/joyouscam35875/youtube-channel-scraper) | Videos, stats, metadata via official API | $0.001/video |
| [France Job Scraper](https://apify.com/joyouscam35875/france-job-scraper) | WTTJ + France Travail + Hellowork | $0.005/job |
| [France Real Estate Scraper](https://apify.com/joyouscam35875/france-real-estate-scraper) | 5 sources + DVF price analysis | $0.008/listing |
| [Website Content Crawler](https://apify.com/joyouscam35875/website-content-crawler) | HTML to Markdown for AI/RAG | $0.001/page |
| [Google Trends Scraper](https://apify.com/joyouscam35875/google-trends-scraper) | Keywords, regions, related queries | $0.002/keyword |
| [GitHub Repo Scraper](https://apify.com/joyouscam35875/github-repo-scraper) | Stars, forks, languages, topics | $0.002/repo |
| [RSS News Aggregator](https://apify.com/joyouscam35875/rss-news-aggregator) | Multi-source feed parsing | $0.0005/article |
| [Instagram Profile Scraper](https://apify.com/joyouscam35875/instagram-profile-scraper) | Followers, bio, posts | $0.0015/profile |
| [Google Maps Scraper](https://apify.com/joyouscam35875/google-maps-scraper) | Businesses, reviews, contacts | $0.002/result |
| [TikTok Scraper](https://apify.com/joyouscam35875/tiktok-scraper) | Videos, likes, shares | $0.001/video |
| [Google SERP Scraper](https://apify.com/joyouscam35875/google-serp-scraper) | Search results, PAA, snippets | $0.003/search |
| [Trustpilot Scraper](https://apify.com/joyouscam35875/trustpilot-scraper) | Reviews, ratings, sentiment | $0.001/review |

👉 [View all scrapers](https://apify.com/joyouscam35875)

# 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.

## `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": [],
  "outputFormat": "markdown"
}
```

# 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("joyouscam35875/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("joyouscam35875/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 joyouscam35875/website-content-crawler --silent --output-dataset

```

## MCP server setup

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