# Bulk Article Extractor: Clean Text & Markdown for LLMs (`isnard/article-extractor`) Actor

Turn article URLs into clean Markdown with author, date and language, split into RAG chunks. $0.70 per 1,000, failed pages are free.

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

## Pricing

from $0.70 / 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

## Bulk Article Extractor: Clean Text & Markdown for LLMs

Turn article URLs into clean Markdown with author, date and language, split into RAG chunks. $0.70 per 1,000, failed pages are free.

Give it a list of article or page URLs. For each one you get:

- the main content as plain text, Markdown, or both, without menus, ads, sidebars, cookie banners and footers
- metadata: title, author, publication date, site name, description, main image, the language the page declares
- the language detected from the text (ISO 639-1 code)
- word count and an approximate token count
- optionally, the content split into overlapping chunks ready for a vector database (RAG)

Only the URLs you give are fetched. Links on the pages are not followed, so you always know what you pay for.

### Input

```json
{
    "urls": [
        "https://en.wikipedia.org/wiki/Web_scraping",
        "https://www.bbc.com/mundo/articles/cwvgr021p725o",
        "https://docs.python.org/3/tutorial/controlflow.html"
    ],
    "outputFormat": "both",
    "includeLinks": false,
    "includeImages": false,
    "chunking": true,
    "chunkSize": 500,
    "chunkOverlap": 50,
    "detectLanguage": true,
    "respectRobots": true,
    "timeoutSecs": 20
}
```

- `urls` (required): pages to extract. A URL without scheme gets `https://`. Duplicates are fetched once, invalid lines are skipped with a warning.
- `outputFormat` (default `both`): `text`, `markdown` or `both`. Markdown keeps headings, lists, tables, code blocks, bold and italics.
- `includeLinks`, `includeImages` (default off): keep links and images of the article in the Markdown. The plain text never has markup.
- `chunking` (default off): add a `chunks` array. Chunks are made from the Markdown when `outputFormat` is `markdown`, otherwise from the plain text.
- `chunkSize` (default 500) and `chunkOverlap` (default 50): in approximate tokens, counted as 4 characters per token. Chunks break at line ends where possible, then at sentence ends, then at spaces. Each chunk starts with the last `chunkOverlap` tokens of the previous one.
- `detectLanguage` (default on): fill `detectedLanguage`.
- `respectRobots` (default on): see below.
- `timeoutSecs` (default 20): limit for each request.

### Output

One dataset item per URL. A successful one, shortened:

```json
{
    "input": "https://www.bbc.com/mundo/articles/cwvgr021p725o",
    "url": "https://www.bbc.com/mundo/articles/cwvgr021p725o",
    "finalUrl": "https://www.bbc.com/mundo/articles/cwvgr021p725o",
    "status": "ok",
    "httpStatus": 200,
    "fetchedAt": "2026-10-30T04:26:26+00:00",
    "error": null,
    "title": "\"No hay palabras para describir tanto dolor\": Urda ...",
    "author": "Lorena Motos",
    "date": "2026-10-29",
    "sitename": "BBC News Mundo",
    "description": "...",
    "language": "es",
    "detectedLanguage": "es",
    "image": "https://ichef.bbci.co.uk/...",
    "extractor": "trafilatura",
    "text": "...",
    "markdown": "...",
    "wordCount": 1712,
    "approxTokens": 2491,
    "paywallFlag": false,
    "chunks": [{ "index": 0, "text": "...", "approxTokens": 498 }]
}
```

`status` tells you what happened:

| status | meaning | charged |
|---|---|---|
| `ok` | content extracted | yes |
| `blocked` | the site answered 401, 402, 403, 405, 407, 429 or 451, or showed a bot check page (Cloudflare and similar) | no |
| `paywalled` | the page marks itself as paid content (schema.org `isAccessibleForFree: false`) and fewer than 150 words were readable. The teaser text is still returned. | no |
| `robots_disallowed` | robots.txt does not allow this URL, the page was not requested | no |
| `no_content` | fewer than 25 words of main content, for example a login page or a menu | no |
| `unsupported` | not an HTML page (PDF, image, JSON) | no |
| `error` | DNS failure, timeout, TLS error, 404, 5xx. The reason is in `error`. | no |

A failing URL never stops the run.

### How pages are requested

- One GET per URL, redirects followed, 5 MB limit per page. Plus one request for `/robots.txt` per host when `respectRobots` is on.
- At most 10 URLs at a time overall and 2 at a time per host, so a list from one site does not hammer it.
- No proxies, no browser, no JavaScript. Pages that only render their text with JavaScript come back as `no_content`.
- User-Agent: `Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/130.0 Safari/537.36 (compatible; BulkArticleExtractor/1.0; +https://apify.com/isnard/article-extractor)`. It looks like a browser to avoid naive filters, and says who it is.

### robots.txt

With `respectRobots` on, the Actor reads `/robots.txt` of each host once and follows RFC 9309 for the user-agent `BulkArticleExtractor`: the group that names it if there is one, otherwise the `*` group, longest matching rule wins. A 4xx answer means no restrictions. A 5xx or 429 answer means "do not crawl", so all URLs of that host are reported as `robots_disallowed`. If robots.txt does not answer at all, the page request goes ahead and reports the real problem.

### How extraction works

1. [trafilatura](https://github.com/adbar/trafilatura) finds the main content and the metadata.
2. If trafilatura finds no text, [readability-lxml](https://github.com/buriy/python-readability) picks the main block and trafilatura converts it. `extractor` says which one was used.
3. [py3langid](https://github.com/adbar/py3langid) detects the language of the first 5,000 characters.

Known limits: the author field is sometimes wrong or empty (we drop values longer than 8 words, which are usually a block of text, not a name). Dates on documentation pages are often the last update, not the publication. Token counts are approximate: real counts depend on the model and are usually higher for Spanish than for English.

### Licenses

- trafilatura: Apache-2.0 (since version 1.8.0, before it was GPL-3.0). The Actor requires 2.x.
- readability-lxml: Apache-2.0
- py3langid: BSD-3-Clause
- lxml: BSD-3-Clause

You are responsible for how you use the extracted content. Respect copyright and the terms of the sites you extract from.

### Pricing

Pay per event: `article-extracted`, once per URL with status `ok`. Everything else is free.

### FAQ

**What is charged?**
Only URLs with status `ok`. Blocked, paywalled, robots-disallowed, empty and failed pages are free.

**Does it run JavaScript?**
No. Pages that only show their text after JavaScript runs come back as `no_content`.

**Does it follow links?**
No. Only the URLs you give are fetched, so you always know what you pay for.

**How accurate is the token count?**
It is an estimate of 4 characters per token. Real counts depend on the model and are usually higher for Spanish.

### Related tools

- [RSS & Atom Feed Change Detector](https://apify.com/isnard/rss-feed-change-detector): find new articles to extract.
- [PDF to Text, Markdown & Tables (CSV)](https://apify.com/isnard/pdf-text-tables-extractor): extract text and tables from PDFs.
- [Website Screenshot API (Full Page, Mobile, No Cookie Banners)](https://apify.com/isnard/website-screenshot): keep a screenshot of each page.

# Actor input Schema

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

Pages to extract, one per line. Only these URLs are fetched, links on them are not followed. A URL without scheme gets https://. Duplicates are fetched once.

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

Plain text, Markdown (headings, lists, tables, bold and italics kept) or both.

## `includeLinks` (type: `boolean`):

Keep hyperlinks inside the article as Markdown links. Affects the Markdown output.

## `includeImages` (type: `boolean`):

Keep images inside the article as Markdown images. Affects the Markdown output.

## `chunking` (type: `boolean`):

Also return the content split into chunks, at paragraph and sentence boundaries where possible. Chunks are made from the Markdown when the output format is Markdown, otherwise from the plain text.

## `chunkSize` (type: `integer`):

Maximum chunk size in approximate tokens, counted as 4 characters per token. Real token counts depend on the model and the language.

## `chunkOverlap` (type: `integer`):

How much of the end of each chunk is repeated at the start of the next one.

## `detectLanguage` (type: `boolean`):

Detect the language of the extracted text (ISO 639-1 code in detectedLanguage). The language the page declares is always returned in language.

## `respectRobots` (type: `boolean`):

Skip URLs that the robots.txt of the site disallows for the BulkArticleExtractor user-agent (or for \* when it is not named). Skipped URLs are reported and not charged.

## `timeoutSecs` (type: `integer`):

Maximum time for each request.

## Actor input object example

```json
{
  "urls": [
    "https://en.wikipedia.org/wiki/Web_scraping",
    "https://docs.python.org/3/tutorial/introduction.html"
  ],
  "outputFormat": "both",
  "includeLinks": false,
  "includeImages": false,
  "chunking": false,
  "chunkSize": 500,
  "chunkOverlap": 50,
  "detectLanguage": true,
  "respectRobots": true,
  "timeoutSecs": 20
}
```

# Actor output Schema

## `results` (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 = {
    "urls": [
        "https://en.wikipedia.org/wiki/Web_scraping",
        "https://docs.python.org/3/tutorial/introduction.html"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("isnard/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://docs.python.org/3/tutorial/introduction.html",
    ] }

# Run the Actor and wait for it to finish
run = client.actor("isnard/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://docs.python.org/3/tutorial/introduction.html"
  ]
}' |
apify call isnard/article-extractor --silent --output-dataset

```

## MCP server setup

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