# URL to Markdown – Clean Web Page Text for LLM & RAG (`fayaz-data/url-to-markdown`) Actor

Turn a list of web page URLs into clean Markdown for ChatGPT, Claude, RAG pipelines and vector databases. Keeps headings, lists, tables, code and links; drops menus, ads and footers. Plain HTTP, no browser, respects robots.txt. Free tool: you pay only Apify platform usage.

- **URL**: https://apify.com/fayaz-data/url-to-markdown.md
- **Developed by:** [Fayaz](https://apify.com/fayaz-data) (community)
- **Categories:** AI, Developer tools, Automation
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $1.50 / 1,000 results

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

## URL to Markdown – Clean Web Page Text for LLM & RAG

**Turn a list of web page URLs into clean Markdown, ready for an LLM, a RAG pipeline or a vector database.**

Paste a list of web page URLs and get back **clean Markdown** for each page: headings, lists, tables, code blocks and links kept; menus, cookie bars, ads, scripts and footers removed. Ready to drop into ChatGPT, Claude, a RAG pipeline, a vector database (Pinecone, Weaviate, Qdrant, pgvector) or an LLM fine-tuning set.

It fetches **only the URLs you give it** (no crawling), reads each site's **robots.txt** first, and uses plain HTTP instead of a full browser, so it is fast and cheap.

### Who it is for

AI and RAG developers, people building chatbots on their own docs or blog, content and SEO teams, and no-code builders (Make, Zapier, n8n) who need "URL in, Markdown out".

### Use cases

1. **RAG ingestion**: convert your docs or help-center pages to Markdown and send them to Pinecone, Qdrant, Weaviate or pgvector.
2. **LLM context**: give ChatGPT or Claude the clean text of a few pages instead of raw HTML.
3. **Content archive**: save your blog posts as Markdown with title, author, date and word count.

### Input

| Field | What it does | Default |
|---|---|---|
| Page URLs | Up to 10,000 pages, one per line | required |
| Main content only | Keep only the article or main text; drop menus, sidebars, footers | on |
| Keep images | Keep `![alt](url)` image links | off |
| Respect robots.txt | Skip pages the site does not allow bots to read. Turn off only for your own site | on |
| Timeout per page | Seconds before giving up on a page | 30 |

Example input:

```json
{
  "urls": ["https://en.wikipedia.org/wiki/Markdown", "https://example.com/"],
  "mainContentOnly": true,
  "keepImages": false
}
```

The input the form starts with (this is what the example output below came from):

```json
{
  "urls": [
    "https://en.wikipedia.org/wiki/Markdown",
    "https://example.com/"
  ],
  "mainContentOnly": true,
  "keepImages": false,
  "respectRobotsTxt": true,
  "timeoutSecs": 30
}
```

### Output

`url`, `finalUrl` (after redirects), `statusCode`, `title`, `description`, `language`, `author`, `publishedTime`, `canonicalUrl`, `markdown`, `wordCount`, `fetchedAt`.

Real output from a run with the default input on 22 Nov 2026:

```json
{
  "url": "https://example.com/",
  "finalUrl": "https://example.com/",
  "statusCode": 200,
  "title": "Example Domain",
  "description": null,
  "language": "en",
  "author": null,
  "publishedTime": null,
  "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": 28,
  "fetchedAt": "2026-11-22T04:41:48.505Z"
}
```

Download as JSON, CSV or Excel, or send the results to Google Sheets, Slack, Make, Zapier, n8n or a webhook from the Apify console.

### Price

This tool has **no price of its own**: there is no per-page fee. You pay only the normal Apify platform usage (compute) of your run, billed by Apify to your account.

### FAQ

**Does it crawl a whole site?**
No. It fetches only the URLs you give it. Use a sitemap or our SEO audit tool to get a URL list first.

**Does it run JavaScript?**
No. It uses plain HTTP, which is fast and cheap. Pages that build all their text with JavaScript may come back empty and are listed in `ERRORS`.

**What happens to failed pages?**
Pages blocked by robots.txt, 404s, timeouts and non-HTML files are not saved; they are listed in the key-value store record `ERRORS` with the reason.

**Can it convert PDFs?**
Not this tool. Use our **PDF Text Extractor** (PDF, Word & image to text) for files.

### Limits

1. Pages that need JavaScript to show their text may come back empty.
2. Pages behind a login or paywall are not fetched.
3. Only use it on pages you are allowed to process. It follows robots.txt by default and fetches at most 5 pages at a time.

### Fair use

You choose the URLs. Only use it on pages you are allowed to process (your own sites, or content whose terms allow it). The actor identifies itself as `UrlToMarkdownBot`, follows robots.txt by default and fetches at most 5 pages at a time.

### For the developer

- Run locally: `npm install && apify run --input '{"urls":["https://example.com/"]}'`
- Test: `npm test` (URL cleaning, robots.txt rules, HTML to Markdown)

# Actor input Schema

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

The web pages to turn into Markdown, one per line (up to 10,000). Only these pages are fetched; no links are followed.

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

Keep only the article or main text and drop menus, sidebars, footers and cookie bars. Turn off to convert the whole page.

## `keepImages` (type: `boolean`):

Keep image links as ![alt](url) in the Markdown.

## `respectRobotsTxt` (type: `boolean`):

Skip pages the site's robots.txt does not allow. Turn off only for your own site.

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

Give up on a page after this many seconds.

## Actor input object example

```json
{
  "urls": [
    "https://en.wikipedia.org/wiki/Markdown",
    "https://example.com/"
  ],
  "mainContentOnly": true,
  "keepImages": false,
  "respectRobotsTxt": true,
  "timeoutSecs": 30
}
```

# Actor output Schema

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

All results in the default dataset, shown with the overview view.

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

// Run the Actor and wait for it to finish
const run = await client.actor("fayaz-data/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://example.com/",
    ] }

# Run the Actor and wait for it to finish
run = client.actor("fayaz-data/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://example.com/"
  ]
}' |
apify call fayaz-data/url-to-markdown --silent --output-dataset

```

## MCP server setup

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