# Wikipedia Article Extractor: Markdown & Infobox (`hydrocore/wikipedia-article-extractor`) Actor

Turn Wikipedia articles into clean, LLM-ready rows: full text as Markdown, infobox facts as fields, Wikidata ID, lead summary, sections, categories, coordinates, image and 30-day pageviews. Titles, URLs or a search, in any language. Built for RAG and AI agents.

- **URL**: https://apify.com/hydrocore/wikipedia-article-extractor.md
- **Developed by:** [Hydrocore Data](https://apify.com/hydrocore) (community)
- **Categories:** AI, Developer tools, Automation
- **Features:** 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 articles

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/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

## Wikipedia Article Extractor: Markdown & Infobox

Give it Wikipedia titles, URLs or a search query and get one clean row per article: the full text as Markdown (no references or navigation clutter), the infobox as key/value fields, the Wikidata ID, a two-paragraph summary, section headings, categories, coordinates, the lead image and human pageviews for the last 30 days. Works in every Wikipedia language. Made for RAG pipelines, knowledge graphs and AI agents that need grounded, citable facts.

### ✅ What you get

- Title, short description, lead summary, Wikidata ID, URL, language
- Infobox type and fields (company, person, place, product...)
- Full article as Markdown, word count, section headings
- Categories, coordinates, lead image
- Pageviews in the last 30 days, last edit time, revision ID, page size
- Free status rows for missing pages and disambiguation pages

### 🏆 Why this Actor

- **Infobox as data:** "founded", "headquarters", "keyPeople", "revenue", "population"... as camelCase keys with plain-text values, references stripped. Most Wikipedia scrapers give only text.
- **LLM-ready Markdown:** real `#` headings, one paragraph per block, references / see also / external links removed, an optional character cap and a `markdownTruncated` flag.
- **Join-ready IDs:** `wikidataId`, `pageId` and `revisionId` on every row, so you can link to Wikidata and cite the exact revision.
- **Popularity signal:** `pageviews30d` from the official Wikimedia pageviews API, to rank entities or spot trending topics.
- **Fair billing:** not-found, disambiguation and duplicate inputs are free status rows; you pay only for real articles.

### 💡 Use cases

**Apify Store use cases:** Feed AI agents & RAG · Market research · Enrich company profiles

- RAG and chatbots: load clean Markdown with a citable revision ID
- AI agents (ChatGPT, Claude, Cursor, n8n): "get the founders, headquarters and Wikidata ID of these 50 companies"
- Knowledge graphs: join on Wikidata IDs, enrich entities with infobox facts
- Market and trend research: rank companies, products or people by Wikipedia pageviews
- Localization: the same article in de, fr, ja... by pasting the URL of each language

### 🚀 How to use

1. Paste titles or Wikipedia URLs into **Articles**, or type a **search** query.
2. Pick the language for titles (default en) and the options you need.
3. Run, then open **Overview**, **Infobox facts** or **Text for AI / RAG**, or export.

### ⚙️ Input

| Field | What it does |
|---|---|
| `articles` | Titles or URLs. Default example: Anthropic, Large language model, Web scraping (ignored when you leave it unchanged and run a search). |
| `searchQuery / maxSearchResults` | Optional full-text search; top N hits are added (default 10). |
| `language` | Language code for titles and search (default en). |
| `includeMarkdown` | Full article Markdown (default on; off = lead only). |
| `maxCharacters` | Markdown cap, default 20,000 (0 = no limit). |
| `includeInfobox` | Infobox fields (default on). |
| `includePageviews` | 30-day pageviews (default on). |
| `skipDisambiguation` | Skip disambiguation pages (default on, free row). |
| `includeNotFound` | Free status rows for inputs without an article (default on). |

Example input:

```json
{
  "searchQuery": "vector database",
  "maxSearchResults": 5,
  "includeMarkdown": true,
  "maxCharacters": 8000
}
```

### ⬆️ Output

One row per article. Every row has the same 30 keys in the same order; missing values are `null`. Inputs that gave no article appear as free rows with a `status` other than ok. The example is a real row from a test run, with `summary`, `markdown` and `categories` shortened.

Overview fields:

| Field | Type | Example | Description |
|---|---|---|---|
| `title` | string | "Anthropic" | Article title after redirects. null on status rows. |
| `description` | string | "American artificial intelligence company" | Wikidata/Wikipedia short description. |
| `wikidataId` | string | "Q116758847" | Wikidata item (Q...), handy for joining other data. |
| `pageviews30d` | integer | 245533 | Human pageviews over the last 30 full days. null when pageviews are off or unavailable. |
| `wordCount` | integer | 4174 | Words in the Markdown (before any cut). |
| `infoboxType` | string | "company" | Kind of infobox (company, person, settlement...), from its CSS class. null if none or not labeled. |
| `lastEditedAt` | string | "2026-11-10T15:29:07Z" | Timestamp of the latest revision (ISO 8601 UTC). |
| `url` | string | "https://en.wikipedia.org/wiki/Anthropic" | Article URL. |
| `status` | string | "ok" | ok, not found, invalid title, disambiguation page (skipped) or error: ... Only ok rows are charged. |

All 30 fields (in order): `recordType`, `title`, `description`, `summary`, `wikidataId`, `url`, `language`, `infoboxType`, `infobox`, `infoboxFieldCount`, `pageviews30d`, `lastEditedAt`, `wordCount`, `sectionCount`, `sections`, `categories`, `categoryCount`, `latitude`, `longitude`, `imageUrl`, `isDisambiguation`, `redirectedFrom`, `markdown`, `markdownTruncated`, `pageId`, `revisionId`, `lengthBytes`, `inputValue`, `status`, `scrapedAt`.

Real row from a test run of the current build:

```json
{
  "recordType": "article",
  "title": "Anthropic",
  "description": "American artificial intelligence company",
  "summary": "Anthropic, PBC (stylized as ANTHROP\\C) is an American artificial intelligence (AI) public benefit corporation headquartered in San Francisco, California. Its flagship product is Claude, a series of proprietary large language models (LLMs). In January 2021, with the goal of promoting AI safety, Anthr…",
  "wikidataId": "Q116758847",
  "url": "https://en.wikipedia.org/wiki/Anthropic",
  "language": "en",
  "infoboxType": "company",
  "infobox": {
    "type": "Public benefit corporation; Private",
    "industry": "Artificial intelligence",
    "founded": "January 26, 2021 (5 years ago))",
    "founders": "Dario Amodei; Daniela Amodei; Jared Kaplan; Jack Clark; Chris Olah; Ben Mann; Sam McCandlish; Tom Brown",
    "headquarters": "San Francisco, California, U.S.",
    "keyPeople": "Dario Amodei (CEO); Daniela Amodei (President); Ami Vora (CPO); Mariano-Florentino Cuéllar (Chief Global Affairs Officer)",
    "products": "Claude; Claude Code; Claude Duet; Bun",
    "revenue": "US$ 4.6 billion (2025)",
    "netIncome": "$-42 billion (2025)",
    "totalAssets": "147,358,000,000 United States dollar (2026)",
    "numberOfEmployees": "5,300 (September 2026)",
    "website": "www.anthropic.com"
  },
  "infoboxFieldCount": 12,
  "pageviews30d": 245533,
  "lastEditedAt": "2026-11-10T15:29:07Z",
  "wordCount": 4174,
  "sectionCount": 7,
  "sections": [
    "History",
    "Business structure",
    "Product",
    "Finances",
    "Projects",
    "Research",
    "Legal issues"
  ],
  "categories": [
    "2021 establishments in California",
    "Anthropic",
    "Artificial intelligence companies",
    "Artificial intelligence industry in the United States"
  ],
  "categoryCount": 9,
  "latitude": null,
  "longitude": null,
  "imageUrl": "https://upload.wikimedia.org/wikipedia/commons/c/c3/Slack_offices%2C_Howard_Street%2C_San_Francisco_%28viewed_from_the_south-west%2C_January_2020%29.jpg?utm_source=en.wikipedia.org&utm_campaign=api&utm_content=original",
  "isDisambiguation": false,
  "redirectedFrom": null,
  "markdown": "# Anthropic\n\nAnthropic, PBC (stylized as ANTHROP\\C) is an American artificial intelligence (AI) public benefit corporation headquartered in San Francisco, California. Its flagship product is Claude, a series of proprietary large language models (LLMs). In January 2021, with the goal of promoting AI …",
  "markdownTruncated": true,
  "pageId": 6206236,
  "revisionId": 1384876870,
  "lengthBytes": 117607,
  "inputValue": "Anthropic",
  "status": "ok",
  "scrapedAt": "2026-11-10T21:23:10.526Z"
}
```

Views: **Overview**, **Infobox facts**, **Text for AI / RAG**, **Detailed (all fields)**. Export as JSON, CSV, Excel, XML or HTML from the Storage tab or the API (`/datasets/{id}/items?format=csv&view=overview`). The run summary (`OUTPUT` record in the key-value store) counts articles requested, saved, not found, disambiguation pages skipped, duplicates and invalid inputs, plus any search error.

### 💰 Pricing

Competitive pricing, pay per result: **$0.001 per article** on the Free plan, less on higher plans, plus the $0.0005 Actor start. 1,000 articles cost about $1 on Free. Not-found, invalid, disambiguation, duplicate and error rows are free.

| Event | What it is | Free | Bronze | Silver | Gold+ |
|---|---|---|---|---|---|
| Article | One Wikipedia article saved with its Markdown, infobox, Wikidata ID and pageviews. Not-found, disambiguation, duplicate and error rows are free. | $0.001 | $0.0009 | $0.0008 | $0.0007 |
| Actor start | Once per run (Apify standard start event, per GB of memory; the default 256 MB = one fee) | $0.0005 | $0.0005 | $0.0005 | $0.0005 |

### 🔁 Integrations

Works with the Apify API, MCP (AI agents), Make, n8n, Zapier, Google Sheets and webhooks. Field names are stable camelCase, so mappings do not break between runs.

### ❓ FAQ

**Where does the data come from?**

From the official MediaWiki Action API of each Wikipedia language and the Wikimedia pageviews API. No scraping of HTML pages and no login.

**Can I use the text commercially?**

Wikipedia text is licensed CC BY-SA 4.0: you can reuse it, including commercially, if you credit Wikipedia (link the article `url`) and share adaptations under the same license. Images have their own licenses on Wikimedia Commons.

**Why is the infobox empty for some articles?**

Not every article has an infobox, and some language editions use infobox layouts without the standard label/data classes (for example many German articles). The text, summary and other fields still work.

**What is removed from the Markdown?**

References, notes, citations, sources, bibliography, footnotes, see also, further reading and external links sections. Tables, image captions and math formulas are not included because the plain-text extract leaves them out.

**How are redirects and duplicates handled?**

Redirects are followed (`redirectedFrom` shows the title you gave). If two inputs lead to the same page, it is saved and charged once.

**What about disambiguation pages?**

By default they are skipped and saved as a free status row, so a vague title like "Mercury" does not cost anything. Turn skipping off to save them as normal articles.

**How do pageviews work?**

Sum of daily human (user agent) pageviews for the last 30 complete days, all platforms, from the Wikimedia REST API. Bots and spiders are excluded.

**Which languages are supported?**

Every Wikipedia language code (en, de, fr, es, it, pt, ja, zh, ru, ko, ar, hi...). Titles and search use the Language input; URLs keep their own language.

**How long are articles?**

Long articles can be 10,000+ words. The default 20,000-character cap keeps rows small for AI tools; set 0 for the full text. `wordCount` is counted before the cut.

**How fast is it?**

About 4 articles at a time, usually under a second each, so 1,000 articles take a few minutes at 256 MB.

### Ready-made examples

- [AI company Wikipedia pages as Markdown](https://apify.com/hydrocore/wikipedia-article-extractor/examples/ai-company-wikipedia-pages-as-markdown)

### 🛟 Support

Found a problem or need a field? Open an issue on the Issues tab; we read every issue.

### Changelog

- 1.0 (2026-11-10): first release.

# Actor input Schema

## `articles` (type: `array`):

Article titles (Anthropic) or Wikipedia URLs (https://de.wikipedia.org/wiki/Berlin), one per line. URLs keep their own language. Redirects are followed; the same page given twice is saved once. The example list is ignored if you leave it unchanged and run a search.

## `searchQuery` (type: `string`):

Optional full-text search (e.g. vector database). The top results are added to the articles above.

## `maxSearchResults` (type: `integer`):

How many search hits to extract. Default 10.

## `language` (type: `string`):

Wikipedia language code for titles and search: en, de, fr, es, ja, zh, pt, it, ru, ko... (default en). URLs use their own language.

## `includeMarkdown` (type: `boolean`):

Save the whole article text as Markdown (headings kept; references, see also and external links removed). Off = lead section only.

## `maxCharacters` (type: `integer`):

Cut the Markdown after this many characters (0 = no limit). markdownTruncated tells you when it was cut. Default 20,000 (about 3,000 words).

## `includeInfobox` (type: `boolean`):

Read the infobox (the fact box on the right) into key/value fields: founded, headquarters, key people, population...

## `includePageviews` (type: `boolean`):

Add human pageviews for the last 30 days from the Wikimedia pageviews API.

## `skipDisambiguation` (type: `boolean`):

Disambiguation pages (e.g. Mercury) are not charged and appear only as free status rows.

## `includeNotFound` (type: `boolean`):

Add a free row (status = not found / disambiguation / error) for each input that did not give an article.

## Actor input object example

```json
{
  "articles": [
    "Anthropic",
    "Large language model",
    "https://en.wikipedia.org/wiki/Web_scraping"
  ],
  "maxSearchResults": 10,
  "language": "en",
  "includeMarkdown": true,
  "maxCharacters": 20000,
  "includeInfobox": true,
  "includePageviews": true,
  "skipDisambiguation": true,
  "includeNotFound": true
}
```

# Actor output Schema

## `overview` (type: `string`):

Title, description, Wikidata ID, pageviews, size and link.

## `facts` (type: `string`):

Infobox fields per article.

## `text` (type: `string`):

Summary and full Markdown.

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

Every field for each row.

## `summary` (type: `string`):

Run summary: articles requested, saved, not found, disambiguation pages skipped, duplicates, invalid inputs and search errors.

# 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 = {
    "articles": [
        "Anthropic",
        "Large language model",
        "https://en.wikipedia.org/wiki/Web_scraping"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("hydrocore/wikipedia-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 = { "articles": [
        "Anthropic",
        "Large language model",
        "https://en.wikipedia.org/wiki/Web_scraping",
    ] }

# Run the Actor and wait for it to finish
run = client.actor("hydrocore/wikipedia-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 '{
  "articles": [
    "Anthropic",
    "Large language model",
    "https://en.wikipedia.org/wiki/Web_scraping"
  ]
}' |
apify call hydrocore/wikipedia-article-extractor --silent --output-dataset

```

## MCP server setup

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