# Article Extractor for LLM / RAG (`ayeeyee/article-extractor-for-llm-rag`) Actor

- **URL**: https://apify.com/ayeeyee/article-extractor-for-llm-rag.md
- **Developed by:** [Virtual Footprint LLC](https://apify.com/ayeeyee) (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 $0.75 / 1,000 article processeds

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.
Since this Actor supports Apify Store discounts, the price gets lower the higher subscription plan you have.

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

## What's an Apify Actor?

Actors are web data automations that power AI and operations. They run on the Apify platform to scrape websites, process data, connect APIs, and automate workflows.
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.

- **AI agents and MCP clients** — the [Apify MCP server](https://docs.apify.com/integrations/mcp.md) at `https://mcp.apify.com` (remote, streamable HTTP, OAuth on first use).
- **Agentic workflows and local Actor development** — [Agent Skills](https://apify.com/.well-known/agent-skills/index.json) with the [Apify CLI](https://docs.apify.com/cli/docs.md): `npm install -g apify-cli`, then `apify login`.
- **JavaScript/TypeScript projects** — the official [JS/TS client](https://docs.apify.com/api/client/js/docs.md): `npm install apify-client`.
- **Python projects** — the official [Python client](https://docs.apify.com/api/client/python/docs.md): `pip install apify-client`.
- **Any other language** — 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

## Article Extractor for LLM / RAG

Turn a list of article URLs into clean, LLM-ready JSON. No browser, no boilerplate -- just the content.

### What it does

Give it a list of article, blog, or news URLs. For each one it fetches the page and extracts:

- **title** -- article headline
- **author** -- byline, when present
- **publishedDate** -- publish date, when present
- **siteName** -- publisher/site name
- **language** -- detected language
- **text** -- full body text, with navigation, ads, comments, and other boilerplate stripped out
- **wordCount** -- word count of the extracted text
- **excerpt** -- first ~400 characters
- **contentHash** -- short hash of the text, useful for dedup/change detection in a RAG pipeline

Built on [trafilatura](https://trafilatura.readthedocs.io/), a widely used content-extraction library, run over a plain HTTP fetch. No headless browser and no proxy needed for the large majority of article/blog/news pages.

### Input

```json
{
  "urls": [
    "https://example.com/some-article",
    "https://example.com/another-article"
  ],
  "maxConcurrency": 5
}
```

- `urls` (required) -- list of article URLs to process.
- `maxConcurrency` (optional, default 5) -- how many URLs to fetch in parallel.

### Output

One dataset item per URL:

```json
{
  "url": "https://en.wikipedia.org/wiki/Retrieval-augmented_generation",
  "status": "success",
  "title": "Retrieval-augmented generation - Wikipedia",
  "author": null,
  "publishedDate": "2023-11-05",
  "siteName": "Wikimedia Foundation, Inc.",
  "text": "Retrieval-augmented generation\nRetrieval-augmented generation (RAG) is a technique...",
  "wordCount": 2070,
  "excerpt": "Retrieval-augmented generation\nRetrieval-augmented generation (RAG) is a technique...",
  "contentHash": "a1b2c3d4e5f6a7b8",
  "httpStatus": 200,
  "extractedAt": "2026-08-21T04:00:00.000000"
}
```

If a URL fails or has no extractable article content, `status` will be `failed` or `no_content_extracted` and `error` will explain why -- you'll always get one dataset item per input URL, so batch runs are easy to reconcile.

### Notes

- This actor does not render JavaScript. Sites that require JS to inject their article body (rare for news/blog content) will come back as `no_content_extracted`.
- Every input URL produces exactly one dataset item, including failures, so success/failure counts always add up to your input count.

# Actor input Schema

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

List of article/blog/news URLs to extract clean content from.

## `maxConcurrency` (type: `integer`):

Maximum number of URLs to fetch in parallel.

## Actor input object example

```json
{
  "urls": [
    "https://en.wikipedia.org/wiki/Retrieval-augmented_generation"
  ],
  "maxConcurrency": 5
}
```

# 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/Retrieval-augmented_generation"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("ayeeyee/article-extractor-for-llm-rag").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/Retrieval-augmented_generation"] }

# Run the Actor and wait for it to finish
run = client.actor("ayeeyee/article-extractor-for-llm-rag").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/Retrieval-augmented_generation"
  ]
}' |
apify call ayeeyee/article-extractor-for-llm-rag --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,ayeeyee/article-extractor-for-llm-rag"
        }
    }
}

```

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/hOh4cfGnejTCe9EEG/builds/AjoOYBh9C7CQMPl9n/openapi.json
