# Website Markdown Crawler: Site to Markdown (`althorlabs/website-markdown-crawler`) Actor

Crawl authorized websites into page-by-page Markdown and text. Includes titles, links, HTTP status and clear crawl limits. Follows same-origin HTTPS links, respects robots.txt and returns structured page errors.

- **URL**: https://apify.com/althorlabs/website-markdown-crawler.md
- **Developed by:** [Althor Labs](https://apify.com/althorlabs) (community)
- **Categories:** 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

$2.00 / 1,000 successful pages

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 Markdown Crawler

Crawl one website you own or are authorized to access and receive page-by-page
Markdown and text with titles, canonical URLs, status, discovered links, and
hashes. Output is written to the default dataset, with limits and audit counts
in the `OUTPUT` record.

### Use

Provide one HTTPS root URL, confirm your authorization and source-terms
responsibility, and choose page and depth caps. The Actor checks `robots.txt`
before crawling. It follows same-origin links in stable breadth-first order and
uses a deterministic URL queue.

The prefilled example crawls up to three pages from the Althor Labs-owned
public site. It uses no customer credentials. The example is a product smoke
input, not evidence of third-party permission or page coverage.

### Output

Each attempted page row includes the page URL and depth, title, canonical URL,
HTTP status, actual fetch time, complete Markdown and plain text, SHA-256 hash,
discovered same-origin links, and a typed error on failure. A page denied by
robots also receives a typed skip row. Candidates omitted before a request,
such as depth, path, queue, and page-cap skips, appear in audit counts rather
than as dataset rows. The `OUTPUT` record reports robots status, request and
byte counts, pages crawled, skips, errors, active limits, and the stop reason.

### Source and access limits

- Use only a site you own or have permission to crawl. Check its terms for your
  intended collection and use.
- The Actor respects `robots.txt`, stays on the exact HTTPS origin, and rejects
  redirects. Public DNS answers are checked and the connection is pinned to a
  validated address.
- It does not authenticate, use cookies, submit forms, run JavaScript, bypass
  challenges, solve CAPTCHAs, evade blocks, or use proxies.
- A `401`, `403`, `429`, login wall, or detected challenge stops the crawl.
- Maximum 500 page requests and depth 10. Defaults are three pages and depth 2.
  Safe pagination query strings are retained; credential-like query fields are
  rejected. Do not pass private values in query strings.
  Limits are 1 MB per page, 100 MB total, and 900 seconds per run with a 180
  second default. Requests are sequential and spaced by at least one second or
  the longer robots crawl delay up to 30 seconds. Greater delays stop the run.
- Static HTML and XHTML only. JavaScript-rendered content, PDFs, and redirect
  destinations are not supported.

Each successfully crawled page costs $0.002, identified by a page row with
`error_code: null`. Typed error rows and skipped pages are free and remain
represented in dataset output or `OUTPUT` audit counts. There is no Actor-start
fee; standard Apify platform usage is included in the event price. Default
runs remain capped at three pages and depth two; the configured maximum is
500 pages and depth 10.
The product does not grant redistribution rights for source content.

### n8n workflow

The [Website Crawler to Vector Store workflow JSON](https://raw.githubusercontent.com/althorlabs/n8n-workflows/main/website-crawler-to-vector-store.json)
connects this Actor to Google Gemini embeddings and n8n's Simple Vector Store.
See the [template setup notes](https://github.com/althorlabs/n8n-workflows/blob/main/website-crawler-to-vector-store-README.md)
before importing. Configure Apify and Google Gemini credentials in n8n; crawled
page text is sent to Gemini for embedding. The Simple Vector Store is in-memory,
shared within the n8n instance, and cleared on execution or restart, so use
this workflow for demos rather than persistent storage. This workflow JSON is
not listed in the n8n template library.

### FAQ

**Does it guarantee that every site page is found?** No. The crawl is bounded
by the page, depth, byte, queue, robots, and time limits. Results include the
counts and stop reason.

**Does it crawl JavaScript apps or log in?** No. It parses static HTML/XHTML
and stops at authentication or access controls.

**Can I use it on any website?** Only when you are authorized and the source
terms allow your intended use. The Actor enforces robots and technical limits;
it does not decide legal rights to crawl or redistribute content.

### Example input

```json
{
  "startUrl": "https://althorlabs.com/",
  "authorizationConfirmed": true,
  "maxPages": 3,
  "maxDepth": 2,
  "maxRuntimeSeconds": 180
}
```

Response bodies use identity encoding; compressed responses are rejected. The
run byte budget includes partial failed downloads. One final read buffer of
at most 8 KiB may exceed the budget before fetching stops. Empty pages and
parser failures produce typed error rows.

# Actor input Schema

## `startUrl` (type: `string`):

HTTPS URL on a public hostname. Safe pagination queries are retained. Credential-like query parameters, IP addresses, credentials in the authority, and nonstandard ports are rejected. URL limit 2,048 characters and query limit 1,024 characters, with at most 50 fields.

## `authorizationConfirmed` (type: `boolean`):

Confirm that you own or have permission to crawl this site and that your intended collection and use comply with its terms.

## `maxPages` (type: `integer`):

Maximum number of page requests in this run. The hard limit is 500.

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

The start page is depth 0. The hard limit is 10.

## `maxRuntimeSeconds` (type: `integer`):

Maximum wall-clock runtime. Defaults to 180 seconds; hard limit is 900 seconds.

## `includePathPrefixes` (type: `string`):

Optional newline-separated absolute path prefixes. When set, only matching pages are crawled. Maximum 50 lines.

## `excludePathPrefixes` (type: `string`):

Optional newline-separated absolute path prefixes to skip. Maximum 50 lines.

## Actor input object example

```json
{
  "startUrl": "https://althorlabs.com/",
  "authorizationConfirmed": true,
  "maxPages": 3,
  "maxDepth": 2,
  "maxRuntimeSeconds": 180,
  "includePathPrefixes": "",
  "excludePathPrefixes": ""
}
```

# Actor output Schema

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

Full Markdown and text for each crawled page, with metadata and typed skips or errors.

## `summary` (type: `string`):

Run status, limits, request and byte counts, and errors.

# 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 = {
    "startUrl": "https://althorlabs.com/",
    "authorizationConfirmed": true,
    "maxPages": 3,
    "maxDepth": 2,
    "maxRuntimeSeconds": 180,
    "includePathPrefixes": "",
    "excludePathPrefixes": ""
};

// Run the Actor and wait for it to finish
const run = await client.actor("althorlabs/website-markdown-crawler").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 = {
    "startUrl": "https://althorlabs.com/",
    "authorizationConfirmed": True,
    "maxPages": 3,
    "maxDepth": 2,
    "maxRuntimeSeconds": 180,
    "includePathPrefixes": "",
    "excludePathPrefixes": "",
}

# Run the Actor and wait for it to finish
run = client.actor("althorlabs/website-markdown-crawler").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 '{
  "startUrl": "https://althorlabs.com/",
  "authorizationConfirmed": true,
  "maxPages": 3,
  "maxDepth": 2,
  "maxRuntimeSeconds": 180,
  "includePathPrefixes": "",
  "excludePathPrefixes": ""
}' |
apify call althorlabs/website-markdown-crawler --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,althorlabs/website-markdown-crawler"
        }
    }
}
```

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/8tEQEgYig9diVJT8Z/builds/D0Z7GUeEdmV2K8jT2/openapi.json
