# Article & Web Page to Markdown Extractor (`keyman98/article-extractor`) Actor

Convert any article or web page URL into clean Markdown or plain text, stripped of menus, ads and boilerplate, plus title, author, date and language metadata.

- **URL**: https://apify.com/keyman98/article-extractor.md
- **Developed by:** [KeyMan98](https://apify.com/keyman98) (community)
- **Categories:** AI, Developer tools
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $2.00 / 1,000 article 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

## Article Text Extractor — Clean Text & Metadata from Any URL

Turn any article, blog post, or news page URL into clean, readable text (or Markdown) plus metadata — title, author, publish date, site name, language — with the navigation, ads, and boilerplate stripped away. Plain HTTP requests only, no browser: fast even on long lists of URLs.

### What it does

For each URL, this Actor sends a normal HTTP GET request (the same request any browser would send), then runs the page through a content-extraction engine that identifies the actual article body and separates it from menus, sidebars, ads, and other boilerplate. You get the article's clean text (or Markdown) and its declared metadata as one dataset row.

### What you get (output fields)

One dataset row per URL:

- `url` — the URL that was requested.
- `finalUrl` — URL after following redirects (`null` on error).
- `title` — article title.
- `author` — article author, when declared.
- `publishedDate` — publish date as declared by the page.
- `siteName` — name of the publishing site, when declared.
- `language` — detected/declared language code of the article.
- `description` — short description/excerpt, when declared (e.g. meta description).
- `text` — extracted article body, in the format you chose (plain text or Markdown). `null` on error.
- `wordCount` — word count of the extracted text. `null` on error.
- `error` — set only if the page could not be fetched or no article text could be found; `null` on success.

### If a page cannot be read

A URL that is completely unreachable (DNS failure, connection refused, timeout), that returns an HTTP error status (404, 500, ...), or that has no extractable article text (e.g. a homepage, a login page, a page that is mostly navigation) becomes a row with `error` set. The rest of your list keeps running, the run does not fail, and you are **not charged** for that URL.

### How to use

1. **URLs** — paste the article/blog/news page URLs you want extracted.
2. **Output format** — `text` for plain text (default) or `markdown` to keep headings, bold/italic, and links.
3. **Include comments** — when enabled, reader comments below the article (if the page has them) are appended to the extracted text. Off by default, for a clean article-only result.
4. **Run the Actor.** Each URL becomes one dataset row.

### Input example (JSON)

```json
{
  "urls": ["https://en.wikipedia.org/wiki/Web_scraping", "https://www.python.org/doc/essays/blurb/"],
  "outputFormat": "text",
  "includeComments": false
}
```

### Output example (JSON)

```json
{
  "url": "https://en.wikipedia.org/wiki/Web_scraping",
  "finalUrl": "https://en.wikipedia.org/wiki/Web_scraping",
  "title": "Web scraping - Wikipedia",
  "author": null,
  "publishedDate": "2005-09-17",
  "siteName": "Wikimedia Foundation, Inc.",
  "language": null,
  "description": null,
  "text": "Web scraping\nWeb scraping, web harvesting, or web data extraction is data scraping used for extracting data from websites...",
  "wordCount": 3841,
  "error": null
}
```

### Pricing

Pay only for pages actually extracted — nothing charged for pages that could not be fetched or had no article text. Pricing model: **pay-per-event**.

| Event | When it's charged | Price |
| --- | --- | --- |
| `article-extracted` | a page was fetched and its article text successfully extracted | 0.002 USD |

Not charged for errors: unreachable URLs, HTTP error pages, and pages with no extractable article text never trigger `article-extracted`.

### Limitations

- HTTP-only: it does not run a browser, so pages that need JavaScript to render their content will yield little or no text.
- Extraction is heuristic: pages that are not article-shaped (homepages, search results, login walls) will often return an `error` row rather than a false positive.
- `publishedDate` reflects whatever date the page itself declares; not every page declares one.
- No login, no CAPTCHA solving, no bypass of any site protection.
- Internal/private/loopback addresses and non-http(s) URLs (e.g. `file://`) are refused before any request is made.

### FAQ

#### Does this use a headless browser like Playwright/Puppeteer?

No, by design — it uses plain HTTP requests only, which keeps runs fast and cheap. Pages that only render their article via client-side JavaScript are not supported.

#### Am I charged if a page has no article text?

No. You are only charged for pages where article text was actually found and extracted.

#### Can I get Markdown instead of plain text?

Yes, set "Output format" to `markdown` to keep headings, bold/italic, and links.

#### What happens with duplicate URLs?

They are de-duplicated before the run starts; each URL is fetched once.

#### Can this get past paywalls or login-protected pages?

No. This Actor makes a plain, unauthenticated HTTP request — it does not log in, solve a paywall, or bypass any access control.

#### Does it render JavaScript-heavy pages?

No. Only the initial HTML response is read; pages that build their article content client-side with JavaScript (single-page apps) can come back with a short or empty `text`.

#### Can I use this through the Apify API or an MCP server?

Yes. Like any Apify Actor, you can run it and read results through the standard Apify API, or through the Apify MCP server if you use Claude, Cursor, or another MCP-enabled client.

### Export

Results can be downloaded from the Apify dataset as JSON, CSV, or Excel, or accessed via the Apify API.

# Actor input Schema

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

Public article page URLs.

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

Format of the extracted article body.

## `includeComments` (type: `boolean`):

Also try to extract reader comments below the article, when the page has them.

## Actor input object example

```json
{
  "urls": [
    "https://en.wikipedia.org/wiki/Web_scraping",
    "https://www.python.org/doc/essays/blurb/"
  ],
  "outputFormat": "text",
  "includeComments": false
}
```

# Actor output Schema

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

All results in the default dataset (JSON, CSV, Excel).

# 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://en.wikipedia.org/wiki/Web_scraping",
        "https://www.python.org/doc/essays/blurb/"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("keyman98/article-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://en.wikipedia.org/wiki/Web_scraping",
        "https://www.python.org/doc/essays/blurb/",
    ] }

# Run the Actor and wait for it to finish
run = client.actor("keyman98/article-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://en.wikipedia.org/wiki/Web_scraping",
    "https://www.python.org/doc/essays/blurb/"
  ]
}' |
apify call keyman98/article-extractor --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,keyman98/article-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/mWCORBNkahJ2vQg53/builds/8XSgYc0vvZISduTkb/openapi.json
