# Website to Markdown Crawler (`tacps126/website-markdown`) Actor

Crawl any website or search the web and get each page as clean Markdown for AI, RAG and LLM apps: main content without menus or ads, title, description, language and links. From $1 per 1,000 pages.

- **URL**: https://apify.com/tacps126/website-markdown.md
- **Developed by:** [Tapaswai Choudhary](https://apify.com/tacps126) (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 $0.80 / 1,000 pages

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

## Website to Markdown Crawler

Turn **any website or web search into clean Markdown** for AI, RAG and LLM apps. Give it a site and it reads the pages it links to; give it a question and it reads the top search results. Each page comes back as **Markdown of its main content**, without menus, headers, footers, cookie banners or ads, plus its **title, description, language, author, publish date** and, if you want, every link. Export to JSON, CSV or Excel, load into a vector store, or call it as an API.

**Built for** AI developers feeding knowledge bases and RAG pipelines, agents that need fresh web context, teams moving docs or help centres into a chatbot, and anyone who wants pages as clean text.

### Why this crawler

- **Main content only.** Navigation, sidebars, footers and ads are dropped; headings, lists, tables, code blocks and links are kept.
- **Crawl or search, or both.** Start addresses are crawled on the same site; searches read the top results with their rank and snippet.
- **Stays where you point it.** Starting at `/docs` follows `/docs/...` pages only. Skip links by text (`/tag/`, `?page=`).
- **No duplicates.** The same page reached by two links, a trailing slash or `index.html` is read once.
- **Fast and cheap.** Pages are read five at a time; a 50-page docs site takes seconds.
- **Ready for chunking.** Word count on every row; skip thin pages with a minimum word count.

### How to use it

1. Add **Websites to crawl** (for example a docs site), **Web searches**, or both.
2. Set **Link depth** and **Max pages per website**.
3. Press **Start**. Download results from the **Output** tab, or connect an integration.

```json
{
  "startUrls": ["https://docs.apify.com/academy"],
  "queries": ["how does retrieval augmented generation work"],
  "maxResultsPerQuery": 5,
  "maxPagesPerSite": 50,
  "maxDepth": 2
}
```

### What you get

One row per page:

```json
{
  "url": "https://docs.example.com/guide/getting-started",
  "title": "Getting started | Example Docs",
  "description": "Install the app and run your first project in five minutes.",
  "language": "en",
  "markdown": "# Getting started\n\nInstall the app and run your first project...",
  "wordCount": 2473,
  "depth": 1,
  "startUrl": "https://docs.example.com/guide",
  "statusCode": 200,
  "scrapedAt": "2026-11-15T18:56:22Z"
}
```

Search rows also carry `query`, `rank`, `searchTitle` and `searchSnippet`. Optional fields: `text` (plain text) and `links`.

### Pricing

Pay per page: **$1 per 1,000 pages**, plus a small start fee per run. You pay only for pages delivered. Set a spending limit on the run to cap the cost.

### FAQ

**Does it read pages that need JavaScript?** It reads the page as the server sends it, which covers docs sites, blogs, news, help centres and most company sites. Pages that only draw their text with JavaScript come back thin; set a minimum word count to skip them.

**Can I get the whole page instead of the main content?** Yes, turn on **Whole page**.

**Does it follow links to other sites?** No, crawls stay on the start address's site. Search results can come from any site.

**Can I keep a knowledge base fresh?** Yes. Schedule the run and send the dataset to your vector store or a webhook.

### Support

Questions or a site that does not come out right? Open an issue on the **Issues** tab and include the run link.

# Actor input Schema

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

Website or page addresses. Each is read with the pages it links to on the same site, up to the depth and page limits below. Leave empty to only search.

## `queries` (type: `array`):

Search phrases or questions. The top results are read as pages, each with its search rank, title and snippet. Leave empty to only crawl.

## `maxResultsPerQuery` (type: `integer`):

Search results read as pages for each search.

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

Pages read for each start address, the start page included.

## `maxDepth` (type: `integer`):

How many links away from the start page to go. 0 reads only the start pages.

## `stayUnderStartPath` (type: `boolean`):

Only follow links under the start address's path, for example /docs/ pages when you start at /docs.

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

Links whose address contains any of these texts are not followed (for example /tag/, ?page=, /login).

## `fullPage` (type: `boolean`):

Keep the whole page body. Off: only the main content, without menus, headers, footers and ads.

## `includeText` (type: `boolean`):

Add a plain text version next to the Markdown.

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

Add every link found on the page.

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

Skip pages with fewer words than this (empty or near-empty pages are always skipped).

## `searchLanguage` (type: `string`):

Two-letter language code for web searches.

## `searchCountry` (type: `string`):

Two-letter country code for web searches.

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

Maximum number of pages to return in total.

## `proxyConfiguration` (type: `object`):

Keep the default setting for reliable results.

## `debug` (type: `boolean`):

More detail in the run log.

## Actor input object example

```json
{
  "startUrls": [
    "https://docs.apify.com/academy"
  ],
  "maxResultsPerQuery": 5,
  "maxPagesPerSite": 20,
  "maxDepth": 2,
  "stayUnderStartPath": true,
  "fullPage": false,
  "includeText": false,
  "includeLinks": false,
  "minWords": 0,
  "searchLanguage": "en",
  "searchCountry": "us",
  "maxItems": 200,
  "proxyConfiguration": {
    "useApifyProxy": true
  },
  "debug": false
}
```

# Actor output Schema

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

The produced items (default dataset items).

# 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.apify.com/academy"
    ],
    "proxyConfiguration": {
        "useApifyProxy": true
    }
};

// Run the Actor and wait for it to finish
const run = await client.actor("tacps126/website-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.apify.com/academy"],
    "proxyConfiguration": { "useApifyProxy": True },
}

# Run the Actor and wait for it to finish
run = client.actor("tacps126/website-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.apify.com/academy"
  ],
  "proxyConfiguration": {
    "useApifyProxy": true
  }
}' |
apify call tacps126/website-markdown --silent --output-dataset

```

## MCP server setup

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