# Website to Markdown Scraper - Static Pages for AI & RAG (`pellucid_bird/website-markdown-scraper`) Actor

Your go-to static website scraper for AI and RAG preparation. Convert public HTML URLs into Markdown, plain text, titles and links with source URLs, timestamps and hashes. Respects robots rules; no login or JavaScript execution.

- **URL**: https://apify.com/pellucid_bird/website-markdown-scraper.md
- **Developed by:** [O M](https://apify.com/pellucid_bird) (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

from $1.09 / 1,000 page saveds

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

## Website to Markdown Scraper — Static Pages for AI & RAG

Turn known public webpage URLs into **clean Markdown and plain text**, ready for retrieval pipelines, knowledge bases, research and content analysis. Each saved page includes its title, links, final URL, observation time and content hashes, so you can trace the text back to its source and detect changes.

- **Prepare AI context:** preserve headings, paragraphs, lists, code blocks and tables while removing common navigation and scripts.
- **Process a precise URL list:** each distinct fetched URL becomes one dataset row; links are returned for your next step.
- **Track coverage:** the run report distinguishes saved pages, duplicates, denied sources, empty content and spending limits.

No API key or website login is needed. This Actor reads server-delivered HTML over HTTP. JavaScript execution, browser rendering, site crawling, search, embeddings and generated summaries are outside its scope.

### Example result

Excerpt from a real local run on November 12, 2026. The complete dated record and provenance are included in `examples/page.json` and `examples/page-provenance.json`.

```json
{
  "url": "https://creativecommons.org/2026/11/09/commons-stories-part-4/",
  "finalUrl": "https://creativecommons.org/2026/11/09/commons-stories-part-4/",
  "title": "Commons Stories: Part 4 - Creative Commons",
  "contentSelection": "main",
  "staticHttp": true
}
```

The complete result also contains the actual `markdown`, `text`, `links`, source checksum and observation timestamp. The example source is attributed to Creative Commons under its [content policy](https://creativecommons.org/terms/); check exceptions on individual pages.

### Quick start

Paste the input below into the Console, start the Actor, and open **Saved Markdown pages**. Export JSON to preserve link arrays and Markdown line breaks; CSV and Excel exports are also available through Apify.

```json
{
  "urls": ["https://creativecommons.org/2026/11/09/commons-stories-part-4/"],
  "maxItems": 1,
  "maxEstimatedCostUsd": 0.1
}
```

Supply up to 100 absolute public HTTP(S) URLs that you are authorized to process. Different paths on the same website remain separate pages. URL fragments, credentials and private-network destinations are rejected.

### Pricing

**$1.09 per 1,000 saved pages + $0.0109 per run**, with Apify resources used during the run included.

`total = $0.0109 + ($0.00109 × saved pages)`

| Saved pages in one run |    Total |
| ---------------------- | -------: |
| 0                      |  $0.0109 |
| 1                      | $0.01199 |
| 10                     |  $0.0218 |
| 100                    |  $0.1199 |

Only successful nonempty pages saved to the dataset receive the result event. Failed, empty, denied and duplicate pages do not. A started customer run still incurs the startup event even when it saves no pages.

Set the platform spending limit and `maxEstimatedCostUsd`; the stricter limit applies. Resource cost guards may stop a run early. Subscription charges, taxes and storage access after a run are outside the run price. The active Pricing tab is authoritative.

### Before you start

- Use static documentation, articles, help pages and other HTML pages whose main text is present in the HTTP response. A client-only application can return no usable text.
- Robots disallow rules, login forms, source challenges and HTTP403/429 are respected. No cookies, residential proxies or challenge bypass are used.
- Content selection prefers the first `main`, then the first `article`, then the cleaned body. `BODY_FALLBACK` is reported when no semantic container exists. CSS layout is not rendered, so extraction is not a visual screenshot of the page.
- This returns a bounded snapshot of the supplied pages. It does not automatically discover or follow website links.
- Source text can contain errors or untrusted instructions. Treat it as source data when supplying it to an AI system. The Actor does not verify claims, grant content rights or generate answers.

### Input reference

| Field                 | Default  | Meaning                                                                             |
| --------------------- | -------- | ----------------------------------------------------------------------------------- |
| `urls`                | required | 1–100 absolute public page URLs.                                                    |
| `maxItems`            | 100      | 1–100 maximum saved unique pages.                                                   |
| `requestTimeoutSecs`  | 15       | 1–30 seconds per physical request, including DNS and response.                      |
| `maxRetries`          | 1        | 0–2 retries for transient network errors and HTTP500/502/503/504.                   |
| `maxPageDurationSecs` | 90       | 10–180 seconds for robots, crawl-delay, redirects, retries and conversion per page. |
| `maxEstimatedCostUsd` | 1        | Additional conservative run allowance, 0–100 USD. Zero stops source work.           |

Repeated identical normalized input URLs are processed once. Redirects are bounded, and each destination origin has its robots policy checked before its page is fetched. Two inputs ending at the same final URL produce one saved row and separate source outcomes. Canonical links remain metadata and do not merge distinct fetched URLs. The first valid HTTP(S) HTML base resolves relative links; it is never fetched and does not replace the final page URL.

### Output reference

| Field                                   | Meaning                                                                                                    |
| --------------------------------------- | ---------------------------------------------------------------------------------------------------------- |
| `url`, `finalUrl`                       | Requested URL and the URL actually fetched after allowed redirects.                                        |
| `pageKey`, `inputKey`                   | SHA-256 keys of normalized final and input URLs.                                                           |
| `title`, `description`, `language`      | Source metadata; missing values are `null`.                                                                |
| `canonicalUrl`                          | Same-origin canonical link, when supplied; a cross-origin canonical is ignored with a warning.             |
| `markdown`, `text`                      | Cleaned source content. No AI rewriting or summarization.                                                  |
| `links`                                 | Up to 100 unique HTTP(S) links from the selected content, with visible anchor text. Links are not fetched. |
| `contentSelection`, `warnings`          | Selected HTML container and extraction limits/fallback notices.                                            |
| `sourceBodySha256`, `markdownSha256`    | Hash of the decoded response as UTF-8 and hash of the resulting Markdown.                                  |
| `scrapedAt`, `httpStatus`, `staticHttp` | Observation time, successful HTTP status and static-HTTP provenance.                                       |
| `encodedBytes`, `decodedBytes`          | Received encoded body size and decoded response bytes.                                                     |

Scripts, styles, navigation, forms, explicitly hidden elements and embedded media are removed. Images and attachments are not downloaded. Markdown preserves semantic text formatting; table cells are normalized to readable rows. Nested tables flatten once within their outer cell with a warning. Code indentation is preserved. Metadata strings and link text have bounded lengths, and the link list reports truncation with `LINKS_LIMIT`. Full page content that exceeds the text limit is rejected instead of silently truncated.

### Run report, limits and recovery

Open **Coverage and costs** (`OUTPUT`) for per-input status, error code, robots decisions, request attempts and modeled resource use. `SUCCEEDED` means every unique requested input was saved or already saved. `PARTIAL` means some pages were saved while others failed or a limit stopped collection. `FAILED` means no useful result was saved or storage failed. `INTERRUPTED` means a run/resource limit or interruption stopped work; confirmed dataset rows remain available.

Up to 100 URLs is a ceiling within the five-minute run allowance, not a promise that every batch will finish. Use smaller batches for large pages, slow sources or sites with crawl delays. Confirmed pages remain available when the run stops early.

Limits per run: 100 saved pages, 5 minutes, 1,000 request attempts, 256 MiB encoded and decoded transfer each, and 32 MiB output. Each HTTP response is limited to 1 MiB encoded and decoded; each page has at most five redirects and 30 request attempts. HTML parsing has an 8-second total worker deadline, including initialization, and a bounded heap. Very complex pages can fail safely. Markdown and text are each limited to 128 KiB, and each complete dataset row to 384 KiB.

Robots files larger than 512,000 bytes, HTML responses or inaccessible policies stop that source. HTTP404/410 robots files are treated as absent. The common `Crawl-delay` extension is honored up to 60 seconds; longer/invalid delays stop that source. A minimum 250 ms interval is applied per origin. A long delay can consume the page or run allowance.

Successful pages are saved as they are processed. Resuming an interrupted run with the same input keeps confirmed pages and continues within the remaining run allowance. If a dataset append has an uncertain outcome, the Actor stops and retains a marker; it does not blindly retry a potentially billed row. A fresh run creates a new snapshot and may create new charges.

### API use

Run this Actor with an Apify API token or the official Apify client, supplying the same JSON input as the Console. `urls` is the required argument; the default dataset contains page rows and the default key-value store contains `OUTPUT`. Schedules, exports and integrations use Apify's standard Actor interfaces.

### Source access and software

Process pages you own, have permission to use or may lawfully process under their license and terms. A public URL and permissive robots policy do not by themselves grant content redistribution rights. The default example comes from a site with an explicit reuse license; that license does not apply to other websites.

Cheerio and Turndown parse supplied HTML strings without executing page JavaScript or loading subresources. Dependency notices are retained in `THIRD_PARTY_NOTICES.md` and the pinned package lock. This Actor is an independent tool; it is not affiliated with or endorsed by source websites.

# Actor input Schema

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

Absolute public HTTP(S) page URLs. Only these pages are processed; links are returned without crawling them. Supply pages you are authorized to process.

## `maxItems` (type: `integer`):

Stops new source requests after this many saved distinct page URLs.

## `requestTimeoutSecs` (type: `integer`):

Maximum time per physical HTTP request, including DNS and response.

## `maxRetries` (type: `integer`):

Only network/timeouts and HTTP500/502/503/504 retry. HTTP403/429 never retry.

## `maxPageDurationSecs` (type: `integer`):

Includes robots, crawl-delay, redirects, retries and HTML processing.

## `maxEstimatedCostUsd` (type: `number`):

A conservative local allowance in addition to Apify spending settings. Zero stops source work. The platform startup event, when enabled, remains payable.

## Actor input object example

```json
{
  "urls": [
    "https://creativecommons.org/2026/11/09/commons-stories-part-4/"
  ],
  "maxItems": 100,
  "requestTimeoutSecs": 15,
  "maxRetries": 1,
  "maxPageDurationSecs": 90,
  "maxEstimatedCostUsd": 1
}
```

# Actor output Schema

## `pages` (type: `string`):

No description

## `report` (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": [
        "https://creativecommons.org/2026/11/09/commons-stories-part-4/"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("pellucid_bird/website-markdown-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 = { "urls": ["https://creativecommons.org/2026/11/09/commons-stories-part-4/"] }

# Run the Actor and wait for it to finish
run = client.actor("pellucid_bird/website-markdown-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 '{
  "urls": [
    "https://creativecommons.org/2026/11/09/commons-stories-part-4/"
  ]
}' |
apify call pellucid_bird/website-markdown-scraper --silent --output-dataset

```

## MCP server setup

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