# Article Content Extractor (`codingfrontend/article-content-extractor`) Actor

Extract clean article content, metadata and structured information from any web page. Returns title, description, author, publish date, plain content, word count, images, and more.

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

## Pricing

from $4.99 / 1,000 results

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

## Article Content Extractor

Extract clean article content, metadata, images, and structured data from any web page URL. Provides title, description, author, publish date, plain text content, word count, reading time, images, links, and JSON-LD structured data.

### Features

- Extracts article body using Readability-like algorithm (tries `<article>`, `[itemprop="articleBody"]`, `.post-content`, `main`, etc.)
- Parses all meta tags: Open Graph, Twitter Cards, standard HTML meta
- Extracts JSON-LD Schema.org structured data (`Article`, `NewsArticle`, `BlogPosting`, etc.)
- Detects author, publish date, modified date, section, tags, and language
- Collects image list with dimensions (up to 50 images)
- Optionally gathers internal & external links
- Calculates word count and estimated reading time (200 WPM)
- Works with news sites, blogs, Wikipedia, Medium, and most static/SSR pages

### Input

| Field | Type | Default | Description |
|-------|------|---------|-------------|
| `urls` | array | required | Article URLs to extract (one per item) |
| `includeImages` | boolean | `true` | Include list of images found in the article |
| `includeLinks` | boolean | `false` | Include internal and external hyperlinks |
| `includeHtml` | boolean | `false` | Include cleaned article HTML in addition to plain text |
| `extractSchema` | boolean | `true` | Parse JSON-LD structured data embedded in the page |
| `proxyConfiguration` | object | — | Proxy settings (residential recommended for paywalled sites) |

#### Example Input

```json
{
  "urls": [
    "https://en.wikipedia.org/wiki/Artificial_intelligence",
    "https://www.bbc.com/news"
  ],
  "includeImages": true,
  "includeLinks": true,
  "includeHtml": false,
  "extractSchema": true
}
````

### Output

Each URL produces one dataset item:

```json
{
  "position": 1,
  "url": "https://en.wikipedia.org/wiki/Artificial_intelligence",
  "title": "Artificial intelligence - Wikipedia",
  "description": "Artificial intelligence (AI) is the intelligence of machines...",
  "author": null,
  "publishDate": null,
  "modifiedDate": null,
  "section": null,
  "tags": ["technology", "science"],
  "language": "en",
  "siteName": null,
  "canonical": "https://en.wikipedia.org/wiki/Artificial_intelligence",
  "domain": "en.wikipedia.org",
  "content": "From Wikipedia, the free encyclopedia...",
  "contentHtml": null,
  "wordCount": 30000,
  "readingTimeMinutes": 150,
  "ogImage": null,
  "images": [
    { "src": "https://upload.wikimedia.org/...", "alt": "AI illustration", "width": 350, "height": 230 }
  ],
  "internalLinks": [{ "text": "Machine learning", "href": "https://en.wikipedia.org/wiki/Machine_learning" }],
  "externalLinks": [{ "text": "Nature paper", "href": "https://www.nature.com/..." }],
  "schemaData": { "@type": "Article", "name": "Artificial intelligence" },
  "favicon": "https://en.wikipedia.org/favicon.ico",
  "scrapedAt": "2025-01-01T00:00:00.000Z"
}
```

### Dataset Views

| View | Fields |
|------|--------|
| **Overview** | position, title, author, publishDate, domain, language, wordCount, readingTimeMinutes, url |
| **Content** | title, description, author, publishDate, modifiedDate, section, tags, content, wordCount, url |
| **Media** | title, url, images, internalLinks, externalLinks |

### Known Limitations

- **Paywalled / login-required sites**: Actor extracts whatever is publicly visible. Pages behind auth walls may return empty content.
- **Heavy JavaScript SPAs**: Content rendered by client-side JavaScript (React, Vue) may not be fully extracted. The actor waits up to 15 seconds for content to appear before extracting.
- **Author field on Wikipedia**: Wikipedia pages list the authority control section as the "author", since there is no standard author meta tag. This is a limitation of relying solely on meta tags.
- **Cloudflare / Bot-protected sites**: Sites protected by Cloudflare Managed Challenge, DataDome, or PerimeterX will return empty or error results. Use residential proxies to improve success rate. See the [anti-bot bypassing guide](../.github/instructions/anti-bot-bypassing.instructions.md).

### Proxy

Residential proxies are recommended for news sites and paywalled content:

```json
{
  "proxyConfiguration": {
    "useApifyProxy": true,
    "apifyProxyGroups": ["RESIDENTIAL"]
  }
}
```

# Actor input Schema

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

List of article/webpage URLs to extract content from.

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

Include a list of image URLs found in the article.

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

Include internal and external links found in the article.

## `includeHtml` (type: `boolean`):

Include the cleaned article HTML (in addition to plain text).

## `extractSchema` (type: `boolean`):

Extract JSON-LD structured data (Schema.org Article, NewsArticle, BlogPosting, etc.).

## `proxyConfiguration` (type: `object`):

Proxy settings for accessing websites. Residential proxies recommended for blocked sites.

## Actor input object example

```json
{
  "urls": [
    "https://en.wikipedia.org/wiki/Artificial_intelligence"
  ],
  "includeImages": true,
  "includeLinks": false,
  "includeHtml": false,
  "extractSchema": true,
  "proxyConfiguration": {
    "useApifyProxy": true
  }
}
```

# 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/Artificial_intelligence"
    ],
    "proxyConfiguration": {
        "useApifyProxy": true
    }
};

// Run the Actor and wait for it to finish
const run = await client.actor("codingfrontend/article-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://en.wikipedia.org/wiki/Artificial_intelligence"],
    "proxyConfiguration": { "useApifyProxy": True },
}

# Run the Actor and wait for it to finish
run = client.actor("codingfrontend/article-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://en.wikipedia.org/wiki/Artificial_intelligence"
  ],
  "proxyConfiguration": {
    "useApifyProxy": true
  }
}' |
apify call codingfrontend/article-content-extractor --silent --output-dataset

```

## MCP server setup

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

```

## OpenAPI specification

```json
{
    "openapi": "3.0.1",
    "info": {
        "title": "Article Content Extractor",
        "description": "Extract clean article content, metadata and structured information from any web page. Returns title, description, author, publish date, plain content, word count, images, and more.",
        "version": "1.0",
        "x-build-id": "OpJgeN5py1HgCsdSw"
    },
    "servers": [
        {
            "url": "https://api.apify.com/v2"
        }
    ],
    "paths": {
        "/acts/codingfrontend~article-content-extractor/run-sync-get-dataset-items": {
            "post": {
                "operationId": "run-sync-get-dataset-items-codingfrontend-article-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/codingfrontend~article-content-extractor/runs": {
            "post": {
                "operationId": "runs-sync-codingfrontend-article-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/codingfrontend~article-content-extractor/run-sync": {
            "post": {
                "operationId": "run-sync-codingfrontend-article-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",
                        "type": "array",
                        "description": "List of article/webpage URLs to extract content from.",
                        "items": {
                            "type": "string"
                        }
                    },
                    "includeImages": {
                        "title": "Include Images",
                        "type": "boolean",
                        "description": "Include a list of image URLs found in the article.",
                        "default": true
                    },
                    "includeLinks": {
                        "title": "Include Links",
                        "type": "boolean",
                        "description": "Include internal and external links found in the article.",
                        "default": false
                    },
                    "includeHtml": {
                        "title": "Include Raw HTML",
                        "type": "boolean",
                        "description": "Include the cleaned article HTML (in addition to plain text).",
                        "default": false
                    },
                    "extractSchema": {
                        "title": "Extract Schema.org Data",
                        "type": "boolean",
                        "description": "Extract JSON-LD structured data (Schema.org Article, NewsArticle, BlogPosting, etc.).",
                        "default": true
                    },
                    "proxyConfiguration": {
                        "title": "Proxy Configuration",
                        "type": "object",
                        "description": "Proxy settings for accessing websites. Residential proxies recommended for blocked sites."
                    }
                }
            },
            "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
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}
```
