# Website Content Extractor (`skilled_glee/website-content-extractor`) Actor

Web page URLs in, clean readable content out. Strips navigation, ads, and boilerplate. Returns title, description, clean text, word count, language. Deterministic, no AI, no browser.

- **URL**: https://apify.com/skilled_glee/website-content-extractor.md
- **Developed by:** [EchoEmpire Machine Foundry (EchoEmpire LLC)](https://apify.com/skilled_glee) (community)
- **Security:** Limited permissions
- **Stats:** 3 total users, 2 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

$2.65 / 1,000 page extracteds

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 Content Extractor

**Web page URLs in, clean readable content out.**

### What it does

Extracts readable paragraph text from web pages. It removes script/style/nav/header/footer-type boilerplate, prefers the first `<main>` or `<article>` region, and keeps `<p>` paragraphs of at least 4 words. Returns structured JSON with the page title, meta description (falls back to `og:description` / `twitter:description`), clean text, word count, and the language declared in `<html lang>` (or `og:locale`). Pages whose text is not in `<p>` paragraphs can yield no readable content; those are reported as errors (see below).

Deterministic HTML parsing. No AI models. No browser automation. Fast and cheap.

### Input

```json
{
  "pageUrls": [
    "https://example.com/article-1",
    "https://example.com/article-2"
  ]
}
```

### Output

```json
{
  "input": "https://example.com/article-1",
  "url": "https://example.com/article-1",
  "finalUrl": "https://example.com/article-1",
  "title": "Article Title",
  "description": "Meta description text",
  "text": "Clean article text without boilerplate...",
  "wordCount": 1247,
  "truncated": false,
  "language": "en",
  "status": "ok",
  "actorVersion": "0.1",
  "contractId": "WCE-CONTRACT-2026-10-05"
}
```

Successful records also carry page metadata fields (`canonicalUrl`, `openGraph`, `twitterCard`, `meta`, `jsonLd`, `jsonLdTypes`, `h1`). `text` is cut at `maxChars` (default 20,000, range 1,000–100,000) and `truncated` says whether it was. `description` is `""` (empty string) when the page has no meta, `og:description`, or `twitter:description` tag — common on Wikipedia and many other pages.

`status` is `"ok"` or `"error"`. An error record always has `input`, `url`, and `error`. A page that was fetched but produced 0 words of readable text is an error (`"no readable content extracted (0 words)"`), not `"ok"`. The key-value store record `run-summary` holds `requested`, `succeeded`, `failed`, and `billable_units`.

### Use cases

- Content aggregation pipelines
- Research data collection
- RAG preprocessing (clean text for embeddings)
- Web monitoring and change detection
- Article archiving

### Pricing

**$0.002646 per page extracted** ($2.65 per 1,000 pages)

You are charged one `page-extracted` event only for `status: "ok"` records (readable content with at least one word). Error records (404 or other HTTP errors, blocked fetches, invalid URLs, no readable content) are not billed.

### Limitations

- Static HTML only; JavaScript-rendered content is not supported
- Does not read or apply robots.txt; only submit URLs you are permitted to fetch
- No proxy or anti-bot bypass; blocked sites return error records
- Reads at most the first 2 MB of each page
- Paywalled content is not bypassed
- Non-HTML content (PDFs, images) returns an error

### Failure behavior

One failed URL never kills the batch. Each page is processed independently; successful extractions are returned with explicit error records for failures.

### API usage

```bash
curl -X POST "https://api.apify.com/v2/acts/YOUR_ACTOR_ID/runs?token=YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"pageUrls": ["https://example.com"]}'
```

# Actor input Schema

## `pageUrls` (type: `array`):

Web page URLs to extract readable content from.

## `maxChars` (type: `integer`):

Maximum content characters per page.

## Actor input object example

```json
{
  "pageUrls": [
    "https://docs.python.org/3/whatsnew/3.13.html"
  ],
  "maxChars": 20000
}
```

# Actor output Schema

## `input` (type: `string`):

No description

## `url` (type: `string`):

No description

## `finalUrl` (type: `string`):

No description

## `title` (type: `string`):

No description

## `description` (type: `string`):

No description

## `text` (type: `string`):

No description

## `wordCount` (type: `string`):

No description

## `truncated` (type: `string`):

No description

## `language` (type: `string`):

No description

## `status` (type: `string`):

No description

## `error` (type: `string`):

No description

## `actorVersion` (type: `string`):

No description

## `contractId` (type: `string`):

No description

# 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 = {
    "pageUrls": [
        "https://docs.python.org/3/whatsnew/3.13.html"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("skilled_glee/website-content-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 = { "pageUrls": ["https://docs.python.org/3/whatsnew/3.13.html"] }

# Run the Actor and wait for it to finish
run = client.actor("skilled_glee/website-content-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 '{
  "pageUrls": [
    "https://docs.python.org/3/whatsnew/3.13.html"
  ]
}' |
apify call skilled_glee/website-content-extractor --silent --output-dataset

```

## MCP server setup

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