# URL to Markdown: Clean Article Text & Main Content (No Browser) (`data-done-right/url-to-markdown`) Actor

Convert web page URLs to clean Markdown: main article text without menus, ads or cookie banners, plus title, author, date, language and word count. Optional LLM/RAG chunks split on headings. Static HTML only, no browser, respects robots.txt. Pay per page.

- **URL**: https://apify.com/data-done-right/url-to-markdown.md
- **Developed by:** [Data Done Right](https://apify.com/data-done-right) (community)
- **Categories:** AI, Automation, 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 $0.80 / 1,000 url converteds

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.
Since this Actor supports Apify Store discounts, the price gets lower the higher subscription plan you have.

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

## URL to Markdown: Clean Article Text & Main Content (No Browser)

This **URL to Markdown** converter turns article, blog, news and documentation pages into clean Markdown: the main text only, without menus, ads, cookie banners and footers, plus title, author, date, language and word count. Paste a list of URLs, get one row per page. Optional chunks split on headings make it ready for LLM prompts, embeddings and RAG pipelines. No API key, no browser.

> **What it does not do.** It reads **static HTML** with one plain HTTP request per URL. It **does not run JavaScript**, so pages that only show their text after scripts run (many single-page apps, some paywalled or lazy-loaded pages) come back `empty` and are not charged. It **respects robots.txt**: a page the site disallows is skipped and not charged. It **does not get around bot protection**: a site that answers 403 gets an error row, no proxies, no CAPTCHA solving, no logins. It does not crawl links, does not convert PDFs or images, and does not search the web. Extraction is heuristic; menus or "\[edit]" labels can occasionally slip through and rare pages lose a section.

**What you get**

- Per URL: `markdown` (main content), `title`, `author`, `publishedDate`, `language`, `siteName`, `description`, `wordCount`, `charCount`, `estimatedTokens`.
- Optional `chunks` for RAG: pieces split on headings, each with its heading path and a token estimate, up to the size you choose.
- Optional `links`: absolute URLs found inside the main content. Only pages that really gave Markdown are charged.

### How to convert a URL to Markdown

1. Paste the page URLs in `urls`, one per line (`en.wikipedia.org/wiki/Markdown` and `https://en.wikipedia.org/wiki/Markdown` both work).
2. Run it. The dataset has one row per URL. `markdown` holds the cleaned text; `status` is `ok` when it worked.
3. Download as JSON, CSV or Excel, or read the rows through the API.

### How to prepare web pages for an LLM or RAG pipeline

Set `chunkMaxTokens` (for example `500`). Each row then has a `chunks` list. A chunk starts at a heading whenever possible, short neighbouring sections are packed together up to the limit, and a section that is longer than the limit is split at paragraph breaks. Every chunk has `index`, `heading`, `headingPath` (for example `["Markdown", "History"]`), `text` and `estimatedTokens`. The token estimate is about 4 characters per token, a rule of thumb that is not any specific model's tokenizer, so leave some headroom below your embedding model's limit. Fenced code blocks are kept whole unless a single block is larger than the limit.

### How to get the main text of an article without menus and ads

Leave `includeLinks` off (the default). The Markdown then contains headings, paragraphs, lists, tables and emphasis, and plain text for links, which is the smallest and cleanest input for a prompt. The page title is in `title`; the Markdown starts with the page's own first heading when that heading is part of the main content.

### How to extract the links inside an article

Turn on `includeLinks`. Links stay inline as `[text](url)` and `links` lists each unique absolute URL with its text. Only links inside the extracted main content are listed, not navigation or footer links.

### Input

| Field | Default | What it does |
|---|---|---|
| `urls` | 3 sample pages | Pages to convert, one per line. Required. |
| `chunkMaxTokens` | `0` (off) | 50 to 8000 adds `chunks` of about this many tokens, split on headings. 0 turns chunking off. |
| `includeLinks` | `false` | Keep `[text](url)` links in the Markdown and add a `links` list. |
| `includeTables` | `true` | Keep HTML tables as Markdown tables. |
| `minWords` | `10` | Fewer words of main text count as `empty` (free). |
| `maxUrls` | `100` | Most URLs processed in a run (max 10,000). Extra URLs are skipped and free. |
| `concurrency` | `5` | Pages fetched at the same time (1 to 20; at most 2 per website). |
| `timeoutSecs` | `30` | Seconds before one request is abandoned. |

Input example:

```json
{
  "urls": ["https://en.wikipedia.org/wiki/Markdown", "https://www.gnu.org/philosophy/free-sw.html", "https://example.com"],
  "chunkMaxTokens": 500,
  "includeLinks": false
}
```

### Output

From a real local run of `https://example.com` with `chunkMaxTokens: 500` and `includeLinks: true`:

```json
{
  "url": "https://example.com",
  "finalUrl": "https://example.com",
  "domain": "example.com",
  "status": "ok",
  "statusCode": 200,
  "error": null,
  "title": "Example Domain",
  "author": null,
  "publishedDate": null,
  "language": "en",
  "siteName": "example.com",
  "description": null,
  "wordCount": 25,
  "charCount": 156,
  "estimatedTokens": 39,
  "markdown": "This domain is for use in documentation examples without needing permission. This is not a service; avoid relying on it for testing and monitoring purposes.",
  "links": [],
  "chunkCount": 1,
  "chunks": [
    {"index": 0, "heading": null, "headingPath": [], "text": "This domain is for use in documentation examples without needing permission. This is not a service; avoid relying on it for testing and monitoring purposes.", "estimatedTokens": 39}
  ],
  "pageTruncated": false,
  "responseTimeMs": 473,
  "fetchedAt": "2026-11-09T14:22:35+00:00"
}
```

`status` is `ok`, `empty` (no main text or fewer than `minWords` words), `robots-disallowed`, `blocked` (HTTP 401/403/451), `http-error`, `not-html`, `parse-error`, `invalid-url` or `failed`. Rows that are not `ok` explain why in `error` and are listed in the `FAILED` record; the `SUMMARY` record counts converted, not converted and charged URLs. `publishedDate` is the date found in the page metadata, which can be the publication or the last-modified date. `language` is the page's `lang` attribute, not a detection from the text. `wordCount` counts words separated by spaces and is not reliable for Chinese, Japanese or Thai.

### Use with the Apify API, MCP, n8n and Make

Python:

```python
from apify_client import ApifyClient

client = ApifyClient("<APIFY_TOKEN>")
run = client.actor("data-done-right/url-to-markdown").call(run_input={
    "urls": ["https://en.wikipedia.org/wiki/Markdown"], "chunkMaxTokens": 500})
for row in client.dataset(run["defaultDatasetId"]).iterate_items():
    if row["status"] == "ok":
        print(row["title"], row["wordCount"], row["chunkCount"])
```

JavaScript:

```js
import { ApifyClient } from 'apify-client';
const client = new ApifyClient({ token: '<APIFY_TOKEN>' });
const run = await client.actor('data-done-right/url-to-markdown').call({ urls: ['https://example.com'] });
const { items } = await client.dataset(run.defaultDatasetId).listItems();
```

In n8n or Make use the Apify node with the actor name and the same JSON. With Apify's MCP server (mcp.apify.com) an AI assistant can call it: "get the Markdown of this article". Only a URL is needed.

### Use cases

- Feed articles and documentation pages into an LLM prompt without the page chrome around them.
- Build a RAG knowledge base: heading-based chunks with a heading path for every piece.
- Export blog or help-centre pages to Markdown for a migration to a new CMS or a docs-as-code repo.
- Archive the text of reference pages with title, author and date for research notes.
- Content audits: word count, date and outgoing links per page for a list of URLs.

### How much does it cost

Pay per event: **$0.001 per URL converted** (`url-converted`, $1 per 1,000). Invalid URLs, duplicates, pages blocked by robots.txt, errors, 403 blocks, non-HTML files and empty pages are free. Plan discounts apply (Silver about 10%, Gold and higher about 20%).

- 1,000 URLs: $1.
- 10,000 URLs: $10.
- 100,000 URLs: $100.

`maxUrls` caps a run, and if you set a maximum spend per run the Actor stops cleanly when it is reached. Apify platform usage is included in this price.

### FAQ

#### Does it run JavaScript or a browser?

No. It makes one plain HTTP request per URL and reads the HTML. That keeps it fast and cheap, but a page whose text is created by scripts in the browser returns `empty` (free). Use a browser-based tool for those pages.

#### Does it respect robots.txt?

Yes. The site's robots.txt is read once per site and checked before every request, including redirect targets, using the user agent `UrlToMarkdownBot`. A disallowed page gets a `robots-disallowed` row and is not charged. If a robots.txt cannot be read because of a server error or a network failure, the site's pages are skipped (as RFC 9309 asks); if the site has no robots.txt, pages are fetched.

#### What happens with sites that block bots?

A site that answers 401, 403 or 451 gets a `blocked` row and is not charged. The Actor does not use proxies, browser impersonation or CAPTCHA solving to get around that.

#### How good is the extraction?

It uses the open-source trafilatura library (Apache-2.0). Extraction is heuristic. It works best on articles, blog posts, news and documentation pages. Landing pages, product grids and forums are less predictable. Check a sample of your own pages first.

#### Can it convert PDFs, images or whole websites?

No. It converts one HTML page per URL. For PDFs see "Extract Text from PDF: OCR, PDF to Text & Markdown"; to list the links of a site use a link or sitemap tool.

#### Is it safe to give internal addresses?

Links to private, loopback and cloud-metadata addresses are refused, including after redirects, and cost nothing. Pages larger than 2 MB are cut at 2 MB (`pageTruncated` is `true`).

### Related tools

- **Extract Text from PDF: OCR, PDF to Text & Markdown** for documents instead of web pages.
- **Link Extractor: Extract All Links, Internal & External, Bulk** to collect the URLs to convert.
- **Sitemap Parser & Extractor: Sitemap to CSV, URLs & New Pages** to get a site's page list before converting it.

# Actor input Schema

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

Pages to convert, one per line. A domain without https:// also works. Example: https://en.wikipedia.org/wiki/Markdown. Best for articles, blog posts, documentation and news pages.

## `chunkMaxTokens` (type: `integer`):

0 = no chunking (default). Any other value from 50 to 8000 adds a `chunks` list to each row: pieces split on headings, each at most about this many tokens (estimated as 4 characters per token). Example: 500.

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

Keep links inside the Markdown as [text](url) and add a `links` list with absolute URLs. Default: off, which gives the cleanest text for LLMs.

## `includeTables` (type: `boolean`):

Keep HTML tables as Markdown tables. Turn it off to drop tables from the text. Default: on.

## `minWords` (type: `integer`):

Pages whose main text has fewer words than this count as empty: they are returned with status empty and are not charged. Default 10.

## `maxUrls` (type: `integer`):

Most URLs processed in this run. URLs beyond this are skipped and not charged. Example: 100.

## `concurrency` (type: `integer`):

How many pages are fetched at the same time (at most 2 per website). Lower it for sites that throttle fast requests. Default 5.

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

Give up on one request after this many seconds. Default 30.

## Actor input object example

```json
{
  "urls": [
    "https://en.wikipedia.org/wiki/Markdown",
    "https://www.gnu.org/philosophy/free-sw.html",
    "https://example.com"
  ],
  "chunkMaxTokens": 0,
  "includeLinks": false,
  "includeTables": true,
  "minWords": 10,
  "maxUrls": 100,
  "concurrency": 5,
  "timeoutSecs": 30
}
```

# Actor output Schema

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

One row per URL with the Markdown, title, author, date, language, word count and optional chunks and links, as JSON, CSV, Excel and more.

## `records` (type: `string`):

Key-value store records: the run summary and the list of URLs that were not converted, with reasons.

# 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://en.wikipedia.org/wiki/Markdown",
        "https://www.gnu.org/philosophy/free-sw.html",
        "https://example.com"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("data-done-right/url-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": [
        "https://en.wikipedia.org/wiki/Markdown",
        "https://www.gnu.org/philosophy/free-sw.html",
        "https://example.com",
    ] }

# Run the Actor and wait for it to finish
run = client.actor("data-done-right/url-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": [
    "https://en.wikipedia.org/wiki/Markdown",
    "https://www.gnu.org/philosophy/free-sw.html",
    "https://example.com"
  ]
}' |
apify call data-done-right/url-to-markdown --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,data-done-right/url-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/IEoawNbWAtq1qO3ab/builds/DRx9fOCBRo1vfgsxr/openapi.json
