# Web Page to Markdown for LLM & RAG (robots.txt, no browser) (`kman-br/web-page-to-markdown-robots`) Actor

Convert up to 500 URLs per run into clean Markdown: main content only, absolute links, title, description, language and canonical. Plain HTTP, no browser, no proxy. Respects robots.txt, Crawl-delay and meta noindex. E-mails, phones and CPF are masked.

- **URL**: https://apify.com/kman-br/web-page-to-markdown-robots.md
- **Developed by:** [Kman](https://apify.com/kman-br) (community)
- **Categories:** AI, Developer tools
- **Features:** Limited permissions
- **Stats:** 2 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

## Web Page to Markdown for LLM & RAG (robots.txt compliant)

**EN** · [PT-BR abaixo](#pt-br)

Give a list of URLs, get clean Markdown ready for LLM context, RAG indexing or archiving. Plain HTTP, **no headless browser and no proxy**, so it is fast and cheap.

### Why this Actor

- **Main content only**: picks `<main>` / `<article>`, drops menus, headers, footers, forms, scripts, cookie banners.
- **Absolute links**, optional images, title, meta description, language, canonical URL, word count.
- **Polite and compliant by default**: reads `robots.txt` (RFC 9309: 5xx = do not crawl), honours `Crawl-delay`, skips `noindex` pages, at most 1 request per host per second, identifies itself as `KmanMarkdownBot`.
- **Privacy**: e-mail addresses, phone numbers and CPF in the page text are masked; private/loopback addresses are refused.
- Blocked pages, errors and non-HTML responses are **free**.

### Input

```json
{ "urls": ["https://en.wikipedia.org/wiki/Markdown", "https://example.com/"], "conteudoPrincipal": true, "incluirLinks": true, "maxCaracteres": 100000 }
```

### Output

```json
{ "url": "https://example.com/", "status": "ok", "titulo": "Example Domain", "idioma": "en", "markdown": "This domain is for use in documentation examples…", "palavras": 25, "robots": "sem_robots_txt" }
```

### Pricing (pay per event)

- US$ 0.01 per run
- US$ 0.001 per page converted (1,000 pages = US$ 1)

### Limits

No JavaScript rendering: single-page apps that render content only in the browser return little text. Pages above 5 MB are refused and only the first 3 MB of HTML are converted. Every redirect hop is checked against private, loopback and cloud-metadata addresses. Memory is fixed at 512 MB, and each run has a compute budget tied to the price: if many hosts hang or fail, the run ends early with `status: parcial` and `motivo: orcamento_computacao`. You are responsible for respecting each site's terms of use.

***

### PT-BR

Converte até 500 URLs por execução em Markdown limpo para LLM/RAG, por HTTP simples, sem navegador e sem proxy.

- Só o conteúdo principal, links absolutos, título, descrição, idioma, canonical.
- Respeita robots.txt, Crawl-delay e noindex; 1 requisição por host por segundo.
- Mascara e-mail, telefone e CPF (LGPD); recusa endereços privados.
- Páginas acima de 5 MB são recusadas; redirecionamentos para endereço privado são bloqueados; se muitos hosts travarem, a execução termina como parcial (orçamento de computação).
- Preço: US$ 0,01 por execução + US$ 0,001 por página convertida. Bloqueadas e erros não são cobrados.

# Actor input Schema

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

Uma URL por linha, até 500.

## `conteudoPrincipal` (type: `boolean`):

Usa <main>/<article> e remove menu, cabeçalho, rodapé, formulários e scripts.

## `incluirLinks` (type: `boolean`):

Links ficam absolutos no Markdown.

## `incluirImagens` (type: `boolean`):

Inclui ![alt](url) das imagens.

## `maxCaracteres` (type: `integer`):

Corta o Markdown nesse tamanho (campo cortado=true).

## Actor input object example

```json
{
  "urls": [
    "https://example.com/"
  ],
  "conteudoPrincipal": true,
  "incluirLinks": true,
  "incluirImagens": false,
  "maxCaracteres": 100000
}
```

# Actor output Schema

## `results` (type: `string`):

No description

## `summary` (type: `string`):

RUN_SUMMARY: status, counts, charged events.

# 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": [
        "https://example.com/"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("kman-br/web-page-to-markdown-robots").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": ["https://example.com/"] }

# Run the Actor and wait for it to finish
run = client.actor("kman-br/web-page-to-markdown-robots").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": [
    "https://example.com/"
  ]
}' |
apify call kman-br/web-page-to-markdown-robots --silent --output-dataset

```

## MCP server setup

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

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/GCuZOmDvKGpbV2r0Z/builds/3rqM3yJXOiMeVqEUr/openapi.json
