# Website to Markdown Scraper - Clean Text & Chunks (`goldstandardweb/website-to-markdown`) Actor

Turn a list of URLs or a small website into clean Markdown for search and knowledge bases: main text only, tables, code and links kept, optional heading-aware chunks. Plain HTTP, robots.txt respected.

- **URL**: https://apify.com/goldstandardweb/website-to-markdown.md
- **Developed by:** [Josh Zoerner](https://apify.com/goldstandardweb) (community)
- **Categories:** Developer tools, SEO tools, Automation
- **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

## Website to Markdown Scraper - Clean Text & Chunks

**Paste a list of URLs, or one start URL to crawl a small site, and get clean Markdown of each page's main text: headings, lists, tables, code blocks and links kept; menus, footers, cookie banners and scripts removed. Optional heading-aware chunks with token counts, ready for a vector database. One flat price per page: 1,000 pages cost $3.50.**

- **Proof:** the sample table below comes from a real run on 16 Nov 2026 (UTC). The 3 example pages took about 2 seconds of run time.
- **Guarantee:** you pay only for pages that were read and have text. Pages that are blocked, missing (404), closed to crawlers by robots.txt, empty, or not web pages (PDFs, images) are still returned with the reason, **free**. Hard limits on pages, depth, results and run time mean a crawl can never run away with your budget.
- **Next step:** click **Try for free**. The example input converts 3 real documentation pages in under a minute.

### Who it's for

- **Developers loading docs into a search index or knowledge base.** Get clean Markdown and ready-made chunks from a list of URLs or a docs site. The price per page is fixed.
- **Teams keeping a knowledge base in sync** with their docs, help center or blog. Schedule a weekly run with **Only new or changed pages**. You pay only for pages whose text changed.
- **Content and SEO teams** who want a site's text, outline (headings) and word counts as Markdown or JSON for audits, migrations or content inventories.
- **Analysts and researchers** who need the readable text of many articles without the page clutter.

### What you get

One row per page:

| Page | Title | Words | Tokens (approx.) | Headings | Markdown (start) |
|---|---|---|---|---|---|
| docs.python.org/3/tutorial/controlflow.html | 4. More Control Flow Tools - Python 3.15.2 documentation | 5,668 | 10,199 | 24 | `# 4. More Control Flow Tools` / As well as the [`while`](https://docs.python.org/3/reference/...) statement just introduced... |
| developer.mozilla.org/en-US/docs/Web/API/Fetch_API/Using_Fetch | Using the Fetch API - Web APIs | MDN | 2,872 | 6,806 | 19 | `# Using the Fetch API` / `## Making a request` / To make a request, call `fetch()`... |
| en.wikipedia.org/wiki/Markdown | Markdown - Wikipedia | 2,796 | 9,071 | 16 | `# Markdown` / infobox as a table: `\| Initial release \| March 9, 2004 ... \|` |

Tokens are estimated as characters / 4. Code blocks keep their language (` ```python3 `, ` ```js `), tables become GitHub-style Markdown tables, and links are absolute addresses, so every chunk still makes sense on its own.

Full example item (real run, 16 Nov 2026, with **Split into chunks** and **Include page links** on):

```json
{
  "url": "https://example.com/",
  "finalUrl": "https://example.com/",
  "status": "ok",
  "httpStatus": 200,
  "title": "Example Domain",
  "description": null,
  "lang": "en",
  "canonicalUrl": null,
  "markdown": "# Example Domain\n\nThis domain is for use in documentation examples without needing permission. This is not a service; avoid relying on it for testing and monitoring purposes.",
  "wordCount": 27,
  "tokensApprox": 44,
  "headings": [{ "level": 1, "text": "Example Domain" }],
  "links": [],
  "chunks": [
    {
      "index": 0,
      "text": "# Example Domain\n\nThis domain is for use in documentation examples without needing permission. This is not a service; avoid relying on it for testing and monitoring purposes.",
      "headingPath": ["Example Domain"],
      "tokensApprox": 44
    }
  ],
  "contentHash": "a764ee35fca6ac90",
  "changeStatus": null,
  "depth": 0,
  "startUrl": "https://example.com/",
  "error": null,
  "charged": true,
  "fetchedAt": "2026-11-16T05:38:19.944Z"
}
```

#### Statuses

| status | Meaning | Charged? |
|---|---|---|
| `ok` | The page was read and converted | Yes |
| `empty` | The page was read but has no readable text in its HTML (often a page that builds its content with JavaScript) | **No** |
| `blocked` | The site refused access or showed a bot check. The Actor reports it and moves on; it never tries to get around blocks | **No** |
| `robots_disallowed` | The site's robots.txt does not allow crawling the page | **No** |
| `http_error` | The page answered with an error, for example 404 Not Found or 500 | **No** |
| `not_html` | The address is a file, not a web page (PDF, image, JSON...) | **No** |
| `too_complex` | The page is too large or too deeply nested to convert within 60 seconds and the run's memory | **No** |
| `unreachable` | The domain does not exist, the server is down or timed out, or the connection dropped (tried twice) | **No** |
| `invalid_url` | The line is not a public web address (for example an internal address or `ftp://`) | **No** |

### How to use it

1. **Paste your pages** into **Web pages or start URLs**, one full link per line. To read a whole documentation site or blog, paste its start link and turn on **Crawl the whole site**.
2. **Optional:** turn on **Split into chunks** and pick the chunk size and overlap in tokens. You can also set limits: pages per start link, link depth, maximum charged pages and a run time limit.
3. **Run it** and download the results as JSON, CSV or Excel, or send them to your search index, vector database or Google Sheets through the API and integrations.
4. **Keep a knowledge base in sync:** turn on **Crawl the whole site** and **Only new or changed pages**, then click **Schedule** and pick weekly. Each run returns (and charges) only pages whose text changed.

Some text could be read as a formula by a spreadsheet. That is text starting with `=`, `+`, `-` or `@`. It gets a leading `'` in titles, descriptions and headings, and a `\` escape in the Markdown. Excel and Google Sheets then show it as plain text.

The pages need no login or API key. You only need your Apify account.

### Pricing

Pay per page: one flat charge for each page that was read and converted.

- **1,000 pages = $3.50** ($0.0035 per page), plus Apify's small standard charge for starting a run. Put many pages in one run rather than one run per page, so you pay that start charge once.
- **The same price for every page**, short or long, with or without chunks. No compute-time surprises.
- **Free:** blocked, missing, robots.txt-protected, empty, too complex and non-HTML pages, and (with **Only new or changed pages**) pages whose text has not changed since the last run.
- **Hard limits:** maximum charged pages, pages per start link, link depth and a run time limit. Set a maximum cost per run in Apify and the Actor stops cleanly when it is reached; pages it did not get to are listed (not charged) so you can run them later.

### Scheduling & integrations

- **Schedules**: re-read your docs or help center weekly. With **Only new or changed pages** on, each run returns (and charges) only pages whose text changed, marked `changeStatus: "new"` or `"changed"`. If you change the output settings (chunks, links, images, main content), every page comes back once more with the new settings.
- **API**: start runs and fetch results with the Apify API or the JavaScript and Python clients. Load `chunks` straight into Pinecone, Qdrant, Weaviate, pgvector or any other vector store.
- **Make, Zapier, n8n**: send new URLs to this Actor and pass the Markdown on to the next step.
- **Google Sheets**: export titles, word counts and Markdown to a sheet.
- **MCP**: any tool that connects to Apify's MCP server can call this Actor to turn a list of URLs into clean Markdown.

### Tested to the Gold Standard

Gold Standard Web built this Actor and tests it with [Gold Standard QA](https://goldstandardweb.com/qa), our three-layer quality process.

- Every change must pass the full test suite before it is saved.
- We plant bugs in the code on purpose, and the tests must catch at least 90% of them.
- A reviewer who did not write the code tries to break it before each release.

[See every check we run](https://goldstandardweb.com/qa).

### FAQ

**Is this legal to use?**
The Actor reads only public pages, the way a visitor would. No login, no forms, no bot-check bypass, no proxies to get around blocks. It names itself honestly (`GoldStandardWeb-Apify/1.0`). It follows each site's robots.txt, including crawl-delay. What you do with the text is your responsibility. Much web content is copyrighted, so check the site's terms before you republish it or use it to train or feed other products.

**How is this different from a full browser crawler?**
This Actor reads the HTML the server sends, without running a browser. That makes it fast and lets it charge one small flat price per page, which suits documentation sites, blogs, help centers, news and reference pages. Pages that only show their text after JavaScript runs come back as `empty` (free), so you can send just those to a browser-based tool.

**How are chunks made?**
Each page's Markdown is split along its headings: a new section starts a new chunk, small neighboring sections are merged, and long sections are split at paragraph, then sentence boundaries. Code blocks are never cut in the middle of a line, and every piece keeps its code fence. Each chunk has its heading path (for example `["4. More Control Flow Tools", "4.2. for Statements"]`) and an approximate token count. Overlap repeats the end of the previous chunk only inside a long section, never across headings. Tokens are counted as about 4 characters, a common estimate for English text. A page gets at most 2,000 chunks; if a very long page needs more, the row's `error` field says so and the full text is still in `markdown` (use a larger chunk size).

**What does "main content only" remove?**
Menus, site headers and footers, sidebars, cookie banners, forms, scripts, styles and "copy" buttons. It keeps the article: headings, paragraphs, lists, tables, code, quotes and links. Turn it off to convert the whole page body instead.

**Which pages does a crawl visit?**
Only pages on the same site as the start link (`www.` or not), and by default only under the start link's folder: start at `https://example.com/docs/intro` and the crawl stays inside `/docs/`. If the start link redirects to another folder on the same site (for example `/docs/` to `/en/docs/`), the crawl also covers the folder it landed in. It follows links up to **Max link depth** and also reads the site's XML sitemap. Files (PDFs, images, archives) and links matching **Skip links containing** are not followed. Each page is read once, even when it is linked with tracking parameters or `#anchors`. A page that is reachable at two addresses (with and without `www.`, or two addresses with the same canonical link) and has the same text is charged once; pages that share a canonical link but have different text (page 2 of a list) are all returned. **Max pages per start link** counts per start link, so two start links on the same site each get their own cap.

**What happens if the run hits my time limit or maximum cost?**
It stops starting new pages, finishes cleanly, and lists the pages it did not read in the log and in the run's key-value store (record `UNPROCESSED`). Those were not charged; run them again. If Apify moves the run to another server mid-run, it continues there and no page is charged twice.

### Limitations

- HTML only, no browser: text that appears only after JavaScript runs is not read (those pages are returned as `empty`, free).
- Sites behind Cloudflare, Akamai or other bot checks come back as `blocked` (free). The Actor does not use proxies or other tricks to get around blocks.
- PDFs, Word files and images are not converted (`not_html`, free).
- Up to 10,000 start links per run, 10,000 pages per start link, and 100,000 charged pages per run.
- Pages over 5 MB are cut at 5 MB. Markdown over 1,000,000 characters is cut there. The row says so.
- A page that takes longer than 60 seconds to convert, or has more HTML elements than the run's memory allows (about 100,000 at the default 512 MB), comes back as `too_complex` (free). Normal articles and docs pages have a few thousand.
- Token counts are estimates (characters / 4), not the exact count of a specific tokenizer.
- Finding the main text works best on articles and docs. Some pages are mostly short link lists, like home pages and category pages. On those it uses the whole page body.

### Input reference

| Field | Type | Default | Description |
|---|---|---|---|
| `startUrls` | array | (required) | Pages to convert, or start links to crawl, one per line (up to 10,000). `[{ "url": "..." }]` is accepted too |
| `crawl` | boolean | `false` | Follow each start link's same-site links and sitemap |
| `maxPagesPerSite` | integer | `50` | Crawl: pages per start link (1-10,000) |
| `maxCrawlDepth` | integer | `2` | Crawl: clicks away from the start link (0-20) |
| `stayWithinPath` | boolean | `true` | Crawl: stay inside the start link's folder |
| `useSitemap` | boolean | `true` | Crawl: also read the site's XML sitemap |
| `excludeUrlPatterns` | array | `[]` | Crawl: skip links containing any of these texts |
| `mainContentOnly` | boolean | `true` | Keep the main text only |
| `chunk` | boolean | `false` | Add heading-aware `chunks` |
| `chunkSize` | integer | `500` | Chunk size in tokens (100-8,000) |
| `chunkOverlap` | integer | `50` | Overlap in tokens (0 to half the chunk size) |
| `includeLinks` | boolean | `false` | Add every link on the page |
| `includeImages` | boolean | `false` | Keep images as Markdown image links |
| `skipUnchanged` | boolean | `false` | Only return (and charge) new or changed pages since the last run (changing the output settings returns every page once more) |
| `historyName` | string | `default` | Separate change history per project (letters, digits, dashes) |
| `maxResults` | integer | `1000` | Stop after this many charged pages (up to 100,000) |
| `maxRunMinutes` | integer | `30` | Hard run time limit (1-600) |

### Output fields

- Page: `url`, `finalUrl`, `status`, `httpStatus`, `canonicalUrl`
- About: `title`, `description`, `lang`
- Text: `markdown`, `wordCount`, `tokensApprox`, `headings`, `links`, `chunks`
- Changes: `contentHash`, `changeStatus`
- Crawl: `depth`, `startUrl`, `fetchedAt`
- Run info: `error`, `charged`

Each address you list gets one row. The one exception is a page that turns out to be the same as another you listed. That means the same address after redirects or canonical link, and the same text. That one is counted in the log, not returned or charged.

### How it works

For each page, the Actor:

1. Reads the site's robots.txt, once per site.
2. Fetches the page over plain HTTP. It follows up to 5 redirects and checks each one again.
3. Finds the main content with Mozilla Readability.
4. Writes Markdown with Turndown, plus rules for code languages, tables and full links.

Each page is converted in a separate worker with a 60-second limit, so one hostile page cannot stall the run. A dropped connection or a 500/502/503/504 answer is tried again once after 3 seconds. At most 2 requests run at the same time per site. Or one at a time, spaced by the site's robots.txt crawl-delay. Up to 10 pages from different sites are read at once. A site's crawl-delay may run past your run time limit. If so, that site's remaining pages are listed as not read (free), and the other sites carry on. Internal and private network addresses are refused. That holds for input and after redirects and DNS lookups.

# Actor input Schema

## `startUrls` (type: `array`):

Pages to convert, one full link per line (https://...). With "Crawl the whole site" on, each link is the starting point of a crawl of that site. Duplicates are removed, so each page is read and charged once. Up to 10,000 per run.

## `crawl` (type: `boolean`):

Off: read only the pages you listed. On: start at each link and follow the site's own links (same site only) plus its sitemap, within the depth and page limits below.

## `maxPagesPerSite` (type: `integer`):

Crawl only: hard cap on pages read for each start link (two start links on the same site get a cap each). 1 to 10,000.

## `maxCrawlDepth` (type: `integer`):

Crawl only: how many clicks away from the start link to go. 0 = the start page only, 1 = plus the pages it links to, and so on. Pages found in the sitemap count as depth 1.

## `stayWithinPath` (type: `boolean`):

Crawl only: with https://example.com/docs/intro as the start link, read only pages under https://example.com/docs/. Turn off to read the whole site.

## `useSitemap` (type: `boolean`):

Crawl only: also queue pages listed in the site's XML sitemap (found through robots.txt or /sitemap.xml), so pages without links to them are found too.

## `excludeUrlPatterns` (type: `array`):

Crawl only: links containing any of these texts are not followed, for example /tag/ or ?page= or /login. Not case-sensitive. Up to 50.

## `mainContentOnly` (type: `boolean`):

On: keep the article or documentation text and drop menus, headers, footers, sidebars and cookie banners. Off: convert the whole page body (navigation, header and footer elements are still removed).

## `chunk` (type: `boolean`):

Add a "chunks" list to each page: pieces of about "Chunk size" tokens that follow the page's headings, ready to load into a search index, knowledge base or vector database.

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

Target size of each chunk in tokens (1 token is counted as about 4 characters). 100 to 8,000. Common choices are 300 to 1,000.

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

Text repeated from the end of the previous chunk when a long section is split, so no sentence loses its context. 0 for none; at most half the chunk size. A new section never repeats text from the previous one.

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

Add a "links" list with every link on the page (absolute addresses, up to 1,000), for example to map a site.

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

Keep images as Markdown image links with their alt text. Off by default because most text pipelines do not use them.

## `skipUnchanged` (type: `boolean`):

Remember each page's content between runs and skip pages whose text has not changed since the last run (skipped pages are not charged). Pages that are returned get changeStatus "new" or "changed". Changing the output settings (chunks, links, images, main content) returns every page once more. Use it with a schedule to keep a knowledge base up to date.

## `historyName` (type: `string`):

Only with "Only new or changed pages": the name of the remembered list, so different projects keep separate histories. Letters, digits and dashes.

## `maxResults` (type: `integer`):

Stop after this many pages you pay for (pages that were read and have text). Failed, blocked, empty and robots.txt-protected pages are returned free and do not count. Up to 100,000.

## `maxRunMinutes` (type: `integer`):

Hard limit for the whole run. When it is reached the run stops starting new pages and finishes cleanly; pages not read are listed in the log and are not charged. 1 to 600.

## Actor input object example

```json
{
  "startUrls": [
    "https://docs.python.org/3/tutorial/controlflow.html",
    "https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API/Using_Fetch",
    "https://en.wikipedia.org/wiki/Markdown"
  ],
  "crawl": false,
  "maxPagesPerSite": 50,
  "maxCrawlDepth": 2,
  "stayWithinPath": true,
  "useSitemap": true,
  "excludeUrlPatterns": [],
  "mainContentOnly": true,
  "chunk": false,
  "chunkSize": 500,
  "chunkOverlap": 50,
  "includeLinks": false,
  "includeImages": false,
  "skipUnchanged": false,
  "historyName": "default",
  "maxResults": 1000,
  "maxRunMinutes": 30
}
```

# Actor output Schema

## `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 = {
    "startUrls": [
        "https://docs.python.org/3/tutorial/controlflow.html",
        "https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API/Using_Fetch",
        "https://en.wikipedia.org/wiki/Markdown"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("goldstandardweb/website-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 = { "startUrls": [
        "https://docs.python.org/3/tutorial/controlflow.html",
        "https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API/Using_Fetch",
        "https://en.wikipedia.org/wiki/Markdown",
    ] }

# Run the Actor and wait for it to finish
run = client.actor("goldstandardweb/website-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 '{
  "startUrls": [
    "https://docs.python.org/3/tutorial/controlflow.html",
    "https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API/Using_Fetch",
    "https://en.wikipedia.org/wiki/Markdown"
  ]
}' |
apify call goldstandardweb/website-to-markdown --silent --output-dataset

```

## MCP server setup

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