# web-content-extractor (`morph_coder/web-content-extractor`) Actor

HTTP-first web scraper without proxy by default. Returns clean article text, SEO metadata, and headings. Apify Proxy and Playwright used only as fallback. No-code friendly JSON output for Make, n8n, and Zapier

- **URL**: https://apify.com/morph\_coder/web-content-extractor.md
- **Developed by:** [Morph Coder](https://apify.com/morph_coder) (community)
- **Categories:** Automation, SEO tools, Lead generation
- **Stats:** 4 total users, 3 monthly users, 99.0% runs succeeded, 0 bookmarks
- **User rating**: 5.00 out of 5 stars

## Pricing

from $2.00 / 1,000 record scrapeds

This Actor is paid per event and usage. You are charged both the fixed price for specific events and for Apify platform usage.

Learn more: https://docs.apify.com/platform/actors/running/actors-in-store#pay-per-event

## What's an Apify Actor?

Actors are a software tools running on the Apify platform, for all kinds of web data extraction and automation use cases.
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.
Actors are written with capital "A".

## 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.
The best way to integrate Actors is as follows.

In JavaScript/TypeScript projects, use official [JavaScript/TypeScript client](https://docs.apify.com/api/client/js.md):

```bash
npm install apify-client
```

In Python projects, use official [Python client library](https://docs.apify.com/api/client/python.md):

```bash
pip install apify-client
```

In shell scripts, use [Apify CLI](https://docs.apify.com/cli/docs.md):

````bash
# MacOS / Linux
curl -fsSL https://apify.com/install-cli.sh | bash
# Windows
irm https://apify.com/install-cli.ps1 | iex
```bash

In AI frameworks, you might use the [Apify MCP server](https://docs.apify.com/platform/integrations/mcp.md).

If your project is in a different language, use the [REST API](https://docs.apify.com/api/v2.md).

For usage examples, see the [API](#api) section below.

For more details, see Apify documentation as [Markdown index](https://docs.apify.com/llms.txt) and [Markdown full-text](https://docs.apify.com/llms-full.txt).


# README

## Web Content Extractor

Apify Actor for **no-code friendly** web content extraction. Fetches pages **without proxy by default** (cheap HTTP), uses Apify Proxy and Playwright **only as fallback**.

### Features

- **HTTP-first** — direct Cheerio fetch without proxy (no proxy cost on most pages)
- **4-step fallback** — Cheerio → Cheerio+Proxy → Playwright → Playwright+Proxy
- **Clean content** — Mozilla Readability removes nav, banners, and noise
- **SEO metadata** — title, meta description, OG tags, canonical, all headings (h1–h6)
- **No-code output** — flat JSON fields for Make, n8n, Zapier
- **Social URL blocking** — Facebook, YouTube, etc. return `blocked_social` without scraping

### Input

| Field | Default | Description |
|-------|---------|-------------|
| `urls` | — | **Required.** List of page URLs |
| `outputFormat` | `json` | `json` \| `text` \| `markdown` |
| `useProxyFallback` | `true` | Retry with Apify Proxy on HTTP errors / blocks |
| `usePlaywrightFallback` | `true` | Retry thin/JS pages with headless Chrome |
| `minContentLength` | `200` | Min text length before Playwright fallback |
| `country` | `US` | Proxy country (fallback steps only) |
| `proxyType` | `RESIDENTIAL` | `RESIDENTIAL` or `DATACENTER` |
| `batchSize` | `50` | URLs per processing wave |
| `maxUrls` | `1000` | Hard cap per run |
| `extractExternalLinks` | `false` | One URL per external domain |

#### Example input

```json
{
  "urls": [
    "https://example.com/article",
    "https://blog.example.org/post"
  ],
  "outputFormat": "json"
}
````

### Output

One dataset item per URL.

#### Success example (`outputFormat: json`)

```json
{
  "url": "https://example.com/article",
  "success": true,
  "status": "success_static",
  "method": "cheerio",
  "usedProxy": false,
  "title": "Article title",
  "metaDescription": "SEO description from meta tag",
  "ogTitle": "Article title",
  "ogDescription": "SEO description",
  "canonical": "https://example.com/article",
  "headings": [
    { "level": 1, "text": "Main heading" },
    { "level": 2, "text": "Section" }
  ],
  "fullText": "Clean plain text of the article...",
  "content": "Clean plain text of the article...",
  "markdown": "# Main heading\n\nClean plain text...",
  "wordCount": 842,
  "httpStatus": 200,
  "fetchedAt": "2026-06-24T12:00:00.000Z",
  "billable": true
}
```

#### `outputFormat` behavior

| Format | `content` field | Other fields |
|--------|-----------------|--------------|
| `json` | Plain text (`fullText`) | All SEO fields + `markdown` |
| `text` | Plain text | `title`, `success` only (SEO fields null) |
| `markdown` | Markdown | All SEO fields |

#### Status values

| Status | Meaning |
|--------|---------|
| `success_static` | Cheerio HTTP fetch succeeded |
| `success_rendered` | Playwright rendering succeeded |
| `blocked_social` | Social URL — not scraped |
| `failed_fetch` | HTTP or network error |
| `failed_dynamic` | Content too short / not extractable |
| `failed_timeout` | Request timed out |

### Fallback chain

```
URLs → Cheerio (no proxy)
     → [403/block/timeout] → Cheerio (Apify Proxy)
     → [thin content]      → Playwright (no proxy)
     → [still failing]     → Playwright (Apify Proxy)
```

Proxy is initialized **lazily** — only when a fallback step needs it.

### No-code integration

#### Make (Integromat)

1. Add **Apify** module → **Run Actor** → `web-content-extractor`
2. Pass `urls` array
3. Map output fields directly:
   - `content` → text field in Google Docs / Notion
   - `metaDescription` → SEO field
   - `headings` → iterator for outline generation
4. Filter: `success` = `true`

#### n8n

1. **Apify** node → Run Actor
2. Use **JSON** output — no markdown parsing needed
3. Expression: `{{ $json.content }}`, `{{ $json.metaDescription }}`
4. **IF** node: `{{ $json.success }}` equals `true`

#### Zapier

1. **Apify** action → Run Actor
2. Filter Zap: only continue if `success` is `true`
3. Map `content` and `title` to next step (e.g. OpenAI, Airtable)

### Local development

```bash
npm install
npm run build
npm run dev
```

Set input via Apify CLI or `storage/key_value_stores/default/INPUT.json`:

```json
{
  "urls": ["https://example.com"]
}
```

### Docker

Built on `apify/actor-node-playwright-chrome` for Playwright fallback support.

```bash
apify push
```

### Billing

Pay-per-event: one `scraped-url` charge per successfully extracted URL. Proxy and Playwright fallback steps do not add extra charges.

# Actor input Schema

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

List of direct page URLs. Social network URLs are returned as blocked\_social without scraping.

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

json: plain text content + SEO fields (best for Make/n8n). text: minimal fields. markdown: markdown content + SEO fields.

## `useProxyFallback` (type: `boolean`):

When the direct HTTP request fails (403, block page, timeout), retry with Apify Proxy before Playwright.

## `country` (type: `string`):

Two-letter country code for Apify proxy geolocation — used only on proxy fallback steps (e.g. US, DE, UA).

## `proxyType` (type: `string`):

Apify proxy group — used only on proxy fallback steps.

## `usePlaywrightFallback` (type: `boolean`):

Retry thin or JS-rendered pages with headless Chrome.

## `minContentLength` (type: `integer`):

Extracted text shorter than this triggers Playwright fallback (if enabled).

## `batchSize` (type: `integer`):

Number of URLs processed per wave (memory control).

## `maxUrls` (type: `integer`):

Hard cap on URLs accepted per run.

## `extractExternalLinks` (type: `boolean`):

One sample URL per external domain, filtered for brand/leak checks. Off by default.

## `maxExternalLinks` (type: `integer`):

Cap on unique outbound domains when extractExternalLinks is true.

## Actor input object example

```json
{
  "urls": [
    "https://example.com"
  ],
  "outputFormat": "json",
  "useProxyFallback": true,
  "country": "US",
  "proxyType": "RESIDENTIAL",
  "usePlaywrightFallback": true,
  "minContentLength": 200,
  "batchSize": 50,
  "maxUrls": 1000,
  "extractExternalLinks": false,
  "maxExternalLinks": 100
}
```

# Actor output Schema

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

Dataset with content and SEO fields per URL.

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

// Run the Actor and wait for it to finish
const run = await client.actor("morph_coder/web-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 = {
    "urls": ["https://example.com"],
    "country": "US",
}

# Run the Actor and wait for it to finish
run = client.actor("morph_coder/web-content-extractor").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print("💾 Check your data here: https://console.apify.com/storage/datasets/" + run["defaultDatasetId"])
for item in client.dataset(run["defaultDatasetId"]).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://example.com"
  ],
  "country": "US"
}' |
apify call morph_coder/web-content-extractor --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "command": "npx",
            "args": [
                "mcp-remote",
                "https://mcp.apify.com/?tools=morph_coder/web-content-extractor",
                "--header",
                "Authorization: Bearer <YOUR_API_TOKEN>"
            ]
        }
    }
}

```

## OpenAPI specification

```json
{
    "openapi": "3.0.1",
    "info": {
        "title": "web-content-extractor",
        "description": "HTTP-first web scraper without proxy by default. Returns clean article text, SEO metadata, and headings. Apify Proxy and Playwright used only as fallback. No-code friendly JSON output for Make, n8n, and Zapier",
        "version": "0.0",
        "x-build-id": "MCGdWc3kehvoghrSn"
    },
    "servers": [
        {
            "url": "https://api.apify.com/v2"
        }
    ],
    "paths": {
        "/acts/morph_coder~web-content-extractor/run-sync-get-dataset-items": {
            "post": {
                "operationId": "run-sync-get-dataset-items-morph_coder-web-content-extractor",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor, waits for its completion, and returns Actor's dataset items in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK"
                    }
                }
            }
        },
        "/acts/morph_coder~web-content-extractor/runs": {
            "post": {
                "operationId": "runs-sync-morph_coder-web-content-extractor",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor and returns information about the initiated run in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/runsResponseSchema"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/acts/morph_coder~web-content-extractor/run-sync": {
            "post": {
                "operationId": "run-sync-morph_coder-web-content-extractor",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor, waits for completion, and returns the OUTPUT from Key-value store in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK"
                    }
                }
            }
        }
    },
    "components": {
        "schemas": {
            "inputSchema": {
                "type": "object",
                "required": [
                    "urls"
                ],
                "properties": {
                    "urls": {
                        "title": "URLs to scrape",
                        "type": "array",
                        "description": "List of direct page URLs. Social network URLs are returned as blocked_social without scraping.",
                        "items": {
                            "type": "string"
                        }
                    },
                    "outputFormat": {
                        "title": "Output format",
                        "enum": [
                            "json",
                            "text",
                            "markdown"
                        ],
                        "type": "string",
                        "description": "json: plain text content + SEO fields (best for Make/n8n). text: minimal fields. markdown: markdown content + SEO fields.",
                        "default": "json"
                    },
                    "useProxyFallback": {
                        "title": "Use proxy fallback",
                        "type": "boolean",
                        "description": "When the direct HTTP request fails (403, block page, timeout), retry with Apify Proxy before Playwright.",
                        "default": true
                    },
                    "country": {
                        "title": "Proxy country (ISO code)",
                        "type": "string",
                        "description": "Two-letter country code for Apify proxy geolocation — used only on proxy fallback steps (e.g. US, DE, UA).",
                        "default": "US"
                    },
                    "proxyType": {
                        "title": "Proxy type",
                        "enum": [
                            "RESIDENTIAL",
                            "DATACENTER"
                        ],
                        "type": "string",
                        "description": "Apify proxy group — used only on proxy fallback steps.",
                        "default": "RESIDENTIAL"
                    },
                    "usePlaywrightFallback": {
                        "title": "Use Playwright fallback",
                        "type": "boolean",
                        "description": "Retry thin or JS-rendered pages with headless Chrome.",
                        "default": true
                    },
                    "minContentLength": {
                        "title": "Minimum content length",
                        "minimum": 50,
                        "type": "integer",
                        "description": "Extracted text shorter than this triggers Playwright fallback (if enabled).",
                        "default": 200
                    },
                    "batchSize": {
                        "title": "Internal batch size",
                        "minimum": 10,
                        "maximum": 100,
                        "type": "integer",
                        "description": "Number of URLs processed per wave (memory control).",
                        "default": 50
                    },
                    "maxUrls": {
                        "title": "Maximum URLs",
                        "minimum": 1,
                        "maximum": 1000,
                        "type": "integer",
                        "description": "Hard cap on URLs accepted per run.",
                        "default": 1000
                    },
                    "extractExternalLinks": {
                        "title": "Extract external links",
                        "type": "boolean",
                        "description": "One sample URL per external domain, filtered for brand/leak checks. Off by default.",
                        "default": false
                    },
                    "maxExternalLinks": {
                        "title": "Max external domains per page",
                        "minimum": 1,
                        "maximum": 500,
                        "type": "integer",
                        "description": "Cap on unique outbound domains when extractExternalLinks is true.",
                        "default": 100
                    }
                }
            },
            "runsResponseSchema": {
                "type": "object",
                "properties": {
                    "data": {
                        "type": "object",
                        "properties": {
                            "id": {
                                "type": "string"
                            },
                            "actId": {
                                "type": "string"
                            },
                            "userId": {
                                "type": "string"
                            },
                            "startedAt": {
                                "type": "string",
                                "format": "date-time",
                                "example": "2025-01-08T00:00:00.000Z"
                            },
                            "finishedAt": {
                                "type": "string",
                                "format": "date-time",
                                "example": "2025-01-08T00:00:00.000Z"
                            },
                            "status": {
                                "type": "string",
                                "example": "READY"
                            },
                            "meta": {
                                "type": "object",
                                "properties": {
                                    "origin": {
                                        "type": "string",
                                        "example": "API"
                                    },
                                    "userAgent": {
                                        "type": "string"
                                    }
                                }
                            },
                            "stats": {
                                "type": "object",
                                "properties": {
                                    "inputBodyLen": {
                                        "type": "integer",
                                        "example": 2000
                                    },
                                    "rebootCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "restartCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "resurrectCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "computeUnits": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            },
                            "options": {
                                "type": "object",
                                "properties": {
                                    "build": {
                                        "type": "string",
                                        "example": "latest"
                                    },
                                    "timeoutSecs": {
                                        "type": "integer",
                                        "example": 300
                                    },
                                    "memoryMbytes": {
                                        "type": "integer",
                                        "example": 1024
                                    },
                                    "diskMbytes": {
                                        "type": "integer",
                                        "example": 2048
                                    }
                                }
                            },
                            "buildId": {
                                "type": "string"
                            },
                            "defaultKeyValueStoreId": {
                                "type": "string"
                            },
                            "defaultDatasetId": {
                                "type": "string"
                            },
                            "defaultRequestQueueId": {
                                "type": "string"
                            },
                            "buildNumber": {
                                "type": "string",
                                "example": "1.0.0"
                            },
                            "containerUrl": {
                                "type": "string"
                            },
                            "usage": {
                                "type": "object",
                                "properties": {
                                    "ACTOR_COMPUTE_UNITS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_WRITES": {
                                        "type": "integer",
                                        "example": 1
                                    },
                                    "KEY_VALUE_STORE_LISTS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_INTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_EXTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_SERPS": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            },
                            "usageTotalUsd": {
                                "type": "number",
                                "example": 0.00005
                            },
                            "usageUsd": {
                                "type": "object",
                                "properties": {
                                    "ACTOR_COMPUTE_UNITS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_WRITES": {
                                        "type": "number",
                                        "example": 0.00005
                                    },
                                    "KEY_VALUE_STORE_LISTS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_INTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_EXTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_SERPS": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}
```
