# Web Page to Markdown for AI & RAG: Bulk, Clean, Chunked (`blueberry_rainstorm/web-page-to-markdown`) Actor

Convert any list of URLs or a whole sitemap into clean, LLM-ready Markdown. Main content only, metadata (author, dates, language), token counts and optional RAG chunks. Fast HTTP with automatic browser fallback for JavaScript sites. Pay only for pages converted.

- **URL**: https://apify.com/blueberry_rainstorm/web-page-to-markdown.md
- **Developed by:** [Rabii Slimane](https://apify.com/blueberry_rainstorm) (community)
- **Categories:** AI, Developer tools
- **Features:** Limited permissions
- **Stats:** 1 total users, 0 monthly users, 0.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

$1.00 / 1,000 page converteds

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

## Web Page to Markdown for AI & RAG: Bulk, Clean, Chunked

Turn any list of URLs, or a whole sitemap, into **clean Markdown that LLMs love**: no menus, cookie banners, ads or footers. Each page comes with metadata, word and token counts, and optional **RAG-ready chunks**.

### Why this one

| | This Actor | Typical alternatives |
|---|---|---|
| Many URLs per run | ✅ List or sitemap, up to 100k pages | Some fetch one URL per run |
| Price | **$1 per 1,000 pages**, failed pages free | Pay-per-page or unpredictable compute costs |
| JavaScript sites | ✅ Auto: fast HTTP first, Chrome only when needed | Always-browser (slow, costly) or never |
| Main content extraction | ✅ Mozilla Readability + menu/ad/cookie removal | Often whole-page dumps |
| Metadata | ✅ Title, description, author, published/modified dates, language, canonical URL, site name, image | Usually title only |
| RAG chunks with heading path | ✅ Optional, with overlap and token counts | Rare |
| Token estimate per page | ✅ | Rare |
| Simple setup | ✅ Sensible defaults, ~10 options | Often 50+ options |

### Output

```json
{
  "url": "https://react.dev",
  "status": "ok",
  "title": "React",
  "description": "React is the library for web and native user interfaces...",
  "author": null,
  "publishedAt": null,
  "language": "en",
  "canonicalUrl": "https://react.dev/",
  "markdown": "# React\n\nThe library for web and native user interfaces\n\n## Create user interfaces from components\n...",
  "wordCount": 588,
  "approxTokens": 1050,
  "renderedWithBrowser": true,
  "chunks": [{ "index": 0, "headingPath": "React > Create user interfaces from components", "text": "...", "approxTokens": 480 }]
}
```

Pages that fail (404, timeout, blocked, empty) are returned with `"status": "failed"` and an `error` message, and **are not charged**.

### Tips

- **Content: Main content only** is best for articles, docs and blogs. Use **Full page** for homepages, listings and product pages.
- Turn on **RAG chunk size** (e.g. 500) to get chunks ready for Pinecone, Weaviate, Qdrant, pgvector, LangChain or LlamaIndex.
- Use **Sitemaps** to convert a whole docs site in one run.
- Plain-text and `.md` URLs (like GitHub raw files) are passed through as-is.

### Pricing

**$1 per 1,000 pages converted** ($0.001 per page), compute included. Failed pages are free. Set "Maximum cost per run" in Apify to cap spending.

### Responsible use

Respect each website's terms and copyright. This tool reads public pages only and does not bypass logins or CAPTCHAs.

# Actor input Schema

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

Pages to convert. Add as many as you like.

## `sitemapUrls` (type: `array`):

Convert every page listed in these sitemaps (sitemap indexes are followed).

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

Upper limit of pages per run.

## `contentMode` (type: `string`):

What part of the page to convert.

## `renderMode` (type: `string`):

Auto detects JavaScript-only pages and blocked requests and re-renders them in Chrome.

## `includeLinks` (type: `boolean`):

Keep hyperlinks as Markdown links. Turn off for plain text with formatting.

## `includeImages` (type: `boolean`):

Keep images as Markdown image tags.

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

Also split each page into chunks of about this many tokens, split on headings, each with its heading path. Ready for vector databases.

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

Overlap between consecutive chunks of a long section.

## `removeSelectors` (type: `string`):

Extra elements to strip before converting, e.g. .related-posts, #comments

## `waitSecs` (type: `integer`):

Extra wait after a browser-rendered page loads.

## `timeoutSecs` (type: `integer`):

Give up on a page after this long. Failed pages are free.

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

How many pages to fetch at once.

## Actor input object example

```json
{
  "urls": [
    {
      "url": "https://en.wikipedia.org/wiki/Web_scraping"
    },
    {
      "url": "https://react.dev"
    }
  ],
  "maxPages": 1000,
  "contentMode": "main",
  "renderMode": "auto",
  "includeLinks": true,
  "includeImages": false,
  "chunkSize": 0,
  "chunkOverlap": 100,
  "waitSecs": 1,
  "timeoutSecs": 40,
  "maxConcurrency": 8
}
```

# Actor output Schema

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

No description

## `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 = {
    "urls": [
        {
            "url": "https://en.wikipedia.org/wiki/Web_scraping"
        },
        {
            "url": "https://react.dev"
        }
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("blueberry_rainstorm/web-page-to-markdown").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 = { "urls": [
        { "url": "https://en.wikipedia.org/wiki/Web_scraping" },
        { "url": "https://react.dev" },
    ] }

# Run the Actor and wait for it to finish
run = client.actor("blueberry_rainstorm/web-page-to-markdown").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 '{
  "urls": [
    {
      "url": "https://en.wikipedia.org/wiki/Web_scraping"
    },
    {
      "url": "https://react.dev"
    }
  ]
}' |
apify call blueberry_rainstorm/web-page-to-markdown --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,blueberry_rainstorm/web-page-to-markdown"
        }
    }
}
```

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/8q6GybtdPyNSi0zl2/builds/JOIBhaHsvtfmb0YX2/openapi.json
