# LLM-Ready Web Scraper (`devoted_helix/llm-web-scraper`) Actor

Convert web pages to clean, LLM-friendly text. Perfect for RAG pipelines, AI chatbot training, and fine-tuning datasets. Removes ads,menus, and clutter automatically.

- **URL**: https://apify.com/devoted\_helix/llm-web-scraper.md
- **Developed by:** [batuhan senavci](https://apify.com/devoted_helix) (community)
- **Categories:** AI, Other, SEO tools
- **Stats:** 6 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

$2.50/month + usage

To use this Actor, you pay a monthly rental fee to the developer. The rent is subtracted from your prepaid usage every month after the free trial period. You also pay for the Apify platform usage, which gets cheaper the higher Apify subscription plan you have.

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

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

## LLM-Ready Web Scraper

Converts web pages to clean, LLM-friendly formats. Perfect for building AI applications.

### Use Cases

- **RAG Pipelines**: Get chunked content ready for vector databases
- **Fine-tuning Datasets**: Export as JSONL for LLM training
- **Knowledge Bases**: Build AI chatbot training data
- **Content Extraction**: Clean text without ads, menus, or clutter

### Features

- Automatic content extraction (removes ads, navigation, footers)
- Multiple output formats: Markdown, JSON, JSONL
- Optional chunking with overlap for RAG
- Batch URL processing
- Metadata extraction (title, description, domain)

### Output Formats

#### Markdown

```markdown
---
title: "Page Title"
url: https://example.com/page
domain: example.com
scraped_at: 2024-01-15T10:30:00Z
---

Clean page content here...
```

#### JSON

```json
{
  "url": "https://example.com/",
  "success": true,
  "content": "Clean text content...",
  "metadata": {
    "title": "Page Title",
    "description": "Meta description"
  },
  "word_count": 1500
}
```

#### JSONL (Fine-tuning)

```json
{
  "prompt": "Content from Page Title:",
  "completion": "Clean text content..."
}
```

### With Chunks (RAG-ready)

```json
{
  "chunks": [
    {"chunk_id": 0, "text": "First chunk...", "word_count": 500},
    {"chunk_id": 1, "text": "Second chunk...", "word_count": 500}
  ],
  "chunk_count": 5
}
```

### Input Parameters

| Parameter | Type | Default | Description |
|-----------|------|---------|-------------|
| url | string | - | Single URL to scrape |
| urls | array | - | Multiple URLs for batch processing |
| outputFormat | string | markdown | Output format: markdown, json, jsonl |
| includeChunks | boolean | false | Split into RAG-ready chunks |
| chunkSize | integer | 500 | Words per chunk |
| chunkOverlap | integer | 50 | Overlap between chunks |
| maxConcurrency | integer | 5 | Parallel scraping limit |

### Example Input

```json
{
  "urls": [
    "https://docs.python.org/3/tutorial/",
    "https://docs.python.org/3/library/"
  ],
  "outputFormat": "json",
  "includeChunks": true,
  "chunkSize": 500
}
```

### Pricing

Pay only for what you use. Typical cost: $0.01-0.05 per URL depending on page size.

# Actor input Schema

## `url` (type: `string`):

A single URL to scrape

## `urls` (type: `array`):

List of URLs to scrape (for batch processing)

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

Format of the extracted content

## `includeChunks` (type: `boolean`):

Split content into overlapping chunks for RAG/embeddings

## `chunkSize` (type: `integer`):

Number of words per chunk (only if Include Chunks is enabled)

## `chunkOverlap` (type: `integer`):

Overlap between chunks for context continuity

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

Maximum number of pages to scrape simultaneously

## Actor input object example

```json
{
  "url": "https://example.com/",
  "outputFormat": "markdown",
  "includeChunks": false,
  "chunkSize": 500,
  "chunkOverlap": 50,
  "maxConcurrency": 5
}
```

# 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 = {
    "url": "https://example.com/"
};

// Run the Actor and wait for it to finish
const run = await client.actor("devoted_helix/llm-web-scraper").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 = { "url": "https://example.com/" }

# Run the Actor and wait for it to finish
run = client.actor("devoted_helix/llm-web-scraper").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 '{
  "url": "https://example.com/"
}' |
apify call devoted_helix/llm-web-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,devoted_helix/llm-web-scraper"
        }
    }
}

```

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/hkfkDpMRSNASLf024/builds/N7szpCzlb7JYSCqaz/openapi.json
