# Web Page Extractor: Markdown, Text & HTML (`althorlabs/web-page-extractor`) Actor

Extract Markdown, plain text or HTML from authorized HTTPS pages. Get titles, canonical URLs, links and per-page failure details. Static HTML with robots.txt checks, bounded downloads and no redirects or JavaScript rendering.

- **URL**: https://apify.com/althorlabs/web-page-extractor.md
- **Developed by:** [Althor Labs](https://apify.com/althorlabs) (community)
- **Categories:** Developer tools, Automation
- **Security:** 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

## Web Page Extractor: HTTPS pages to Markdown, text or HTML

Extract readable page content from a batch of public HTTPS pages that you own
or are authorized to collect. Get one dataset record per URL with the title,
canonical URL, outgoing links, HTTP status, and the selected Markdown, plain
text or HTML fragment representation. A typed failure record explains each page
that could not be extracted.

This Actor fetches static HTML. It does not run JavaScript, sign in, follow
redirects, solve CAPTCHA challenges or evade site blocks. It checks each site's
`robots.txt` before requesting a page and refuses disallowed paths.

### Input

Provide 1 to 20 HTTPS URLs and confirm that you own or are authorized to collect
each page and that its current site terms permit automated access and use of the
content. Do not submit personal profiles, contact lists, regulated personal
data, authenticated pages or URLs containing credentials. The Actor does not
accept cookies, custom headers or proxies.

Choose a content format and extraction scope:

- **Markdown**, **text**, or **HTML** for the selected page content. HTML is an
  untrusted fragment; it is not a sanitizer.
- **Full body** is the default and preserves multi-section documentation,
  service pages, code and tables while removing scripts, styles, templates and
  interactive form controls.
- **Main content** uses Readability's article-focused extraction. It can omit
  navigation and secondary sections.

HTML output is the extracted body or main-content fragment, not the original
document DOM. Links are collected from the source HTML, up to 100 per page.

### Examples

This input uses the Actor's actual prefill values for the Althor Labs public
site. It also writes the schema defaults explicitly so it can be pasted as a
complete input object:

```json
{
  "urls": ["https://althorlabs.com/"],
  "authorizedUse": true,
  "outputFormat": "markdown",
  "extractionMode": "full_body"
}
```

The `authorizedUse` confirmation is for this owner-authorized example. Set it
to `true` only when you are authorized to collect every submitted page and the
site terms permit that use.

An HTTP URL fails before the Actor makes a page request:

```json
{
  "schema_version": "1",
  "input_index": 0,
  "url": "http://example.com/[invalid URL redacted]",
  "status": "failure",
  "rendering_mode": "static_html",
  "extraction_mode": "full_body",
  "output_format": "markdown",
  "http_status": null,
  "title": null,
  "canonical_url": null,
  "links": [],
  "links_truncated": false,
  "content": null,
  "content_bytes": null,
  "failure": {
    "code": "invalid_url",
    "message": "Only absolute HTTPS URLs are supported."
  }
}
```

### Limits and behavior

- Maximum 20 pages per run.
- Maximum 1 MiB response per page and 10 MiB total response bytes including
  robots files.
- Maximum 15 seconds per request and 120 seconds for the whole run.
- Maximum 8 MiB serialized result per page. Oversized pages return a typed
  failure instead of truncated content.
- HTTPS port 443 only. Private or special-use IPs, URL credentials and all
  redirects are refused.
- `robots.txt` errors fail closed. A published `404` or `410` has no rules.
- Requests are sequential and identify this Actor with its User-Agent.

### Data and rights

Use this Actor only for pages you own or are authorized to collect. You are
responsible for checking site terms, rate limits, and rights to retain or
redistribute extracted content. The Actor stores output in your run dataset and
does not publish it. Incidental personal information in a page is not removed
automatically.

### Output

Each dataset item represents one input URL. `status` is `success` or `failure`;
`failure.code` contains a stable reason such as `robots_disallowed`,
`redirect_refused`, `response_too_large` or `request_timeout`. `rendering_mode`
is always `static_html`.

### Successful result shape (synthetic)

```json
{
  "schema_version": "1",
  "input_index": 0,
  "url": "https://example.com/",
  "status": "success",
  "rendering_mode": "static_html",
  "extraction_mode": "full_body",
  "output_format": "markdown",
  "http_status": 200,
  "title": "Example page",
  "canonical_url": "https://example.com/",
  "links": ["https://example.com/services/"],
  "links_truncated": false,
  "content": "Example content",
  "content_bytes": 15,
  "failure": null
}
```

### Pricing

Each successfully extracted page costs $0.002. Typed failure rows remain in
the dataset and are free. There is no Actor-start fee; standard Apify platform
usage is included in the event price.

### n8n workflow

The [Web Page Extractor to Vector Store workflow JSON](https://raw.githubusercontent.com/althorlabs/n8n-workflows/main/web-page-extractor-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/web-page-extractor-to-vector-store-README.md)
before importing. Configure Apify and Google Gemini credentials in n8n; 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.

# Actor input Schema

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

One to 20 public HTTPS pages on sites you own or are authorized to collect. Redirects are refused. Each response is limited to 1 MiB; total downloaded content including robots.txt is limited to 10 MiB.

## `authorizedUse` (type: `boolean`):

Confirm that you own or are authorized to collect every page, that site terms allow automated access and content use, and that the pages do not target private individuals or contact lists.

## `outputFormat` (type: `string`):

Choose one representation of extracted page content. HTML is an untrusted fragment and is not a sanitizer.

## `extractionMode` (type: `string`):

Full body keeps multi-section documentation, service pages, code and tables. Main content applies Readability's article-focused extraction.

## Actor input object example

```json
{
  "urls": [
    "https://althorlabs.com/"
  ],
  "authorizedUse": true,
  "outputFormat": "markdown",
  "extractionMode": "full_body"
}
```

# Actor output Schema

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

One dataset item per submitted page. Each item contains the selected representation or a typed failure.

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

Counts, elapsed time and downloaded response bytes for this run.

# 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://althorlabs.com/"
    ],
    "authorizedUse": true
};

// Run the Actor and wait for it to finish
const run = await client.actor("althorlabs/web-page-extractor").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://althorlabs.com/"],
    "authorizedUse": True,
}

# Run the Actor and wait for it to finish
run = client.actor("althorlabs/web-page-extractor").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://althorlabs.com/"
  ],
  "authorizedUse": true
}' |
apify call althorlabs/web-page-extractor --silent --output-dataset

```

## MCP server setup

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

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/YSWZLwk9mEghsxORu/builds/S7IaqaHPNocz3XwLb/openapi.json
