# Wikipedia Scraper - Articles, Summaries & Data (`benthepythondev/wikipedia-scraper`) Actor

Search Wikipedia by keyword (or look up exact titles) for structured article data: title, short description, intro extract in plain text, full URL, thumbnail, categories, language-links count and last-edit time. Any language. Fast and reliable via the public MediaWiki API.

- **URL**: https://apify.com/benthepythondev/wikipedia-scraper.md
- **Developed by:** [Ben](https://apify.com/benthepythondev) (community)
- **Categories:** AI, News, Other
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $1.20 / 1,000 results

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

## 📖 Wikipedia Scraper — Articles, Summaries & Metadata

Search **Wikipedia** by keyword — or look up exact article titles — and get clean, structured data for every result: the title, the short description, the intro extract as plain text, the full article URL, a thumbnail image, the categories, how many language editions the article exists in, the last-edit timestamp and the article size. Works in **any Wikipedia language edition**, from English to German, Spanish, French, Japanese and beyond.

The actor is powered by the public **MediaWiki API**, so it is fast and reliable with no browser, no login and no API key. Export to JSON/CSV/Excel, run on a schedule, call via API, or connect to Make, Zapier or n8n.

### 🔎 What is the Wikipedia Scraper?

Wikipedia is the world's largest encyclopedia and one of the most valuable sources of clean, general-knowledge text — which is exactly why it powers so many knowledge bases, search features and AI systems. But copying summaries by hand, or wrangling the raw MediaWiki API yourself, is slow and fiddly.

This actor makes it effortless. Give it topics or keywords (e.g. `artificial intelligence`, `quantum computing`) and it returns the top matching articles as structured rows — or pass a list of exact titles to pull specific pages. Every row includes a ready-to-use plain-text intro extract (no wiki markup, no HTML), a short one-line description, the article's categories and a thumbnail, so it drops straight into a RAG pipeline, a content database or an enrichment workflow. Choose any language edition to build multilingual datasets.

#### What data does it extract?

- **Title** of the article
- **Page ID** — the stable MediaWiki page identifier
- **Description** — the short one-line summary
- **Extract** — the intro section as clean plain text (no markup)
- **URL** — the full article link
- **Thumbnail** — a representative image URL
- **Language** — the Wikipedia edition the article is from
- **Language-links count** — how many language editions the article exists in
- **Categories** — the article's category labels
- **Last edited** — timestamp of the most recent edit
- **Length (bytes)** — the article's size, a rough proxy for depth
- **Query** — the search term (or `lookup`) that surfaced the row

### ⬇️ Input

Run it two ways — search by keyword, or look up exact titles. You can combine both in one run.

| Field | Type | Description |
|-------|------|-------------|
| `searchTerms` | array | Keywords/topics to search, e.g. `artificial intelligence`. One or many. |
| `titles` | array | Optional: exact article titles to pull, e.g. `Alan Turing`. |
| `language` | string | Wikipedia language edition code, e.g. `en`, `de`, `es`. Default `en`. |
| `maxPerTerm` | integer | Max articles to return per search term. Default `10`, up to `50`. |

#### Example input

```json
{
  "searchTerms": ["artificial intelligence", "quantum computing"],
  "language": "en",
  "maxPerTerm": 10
}
```

### ⬆️ Output

Each article is one clean row (view as a **table**, or export **JSON / CSV / Excel**):

```json
{
  "title": "Artificial intelligence",
  "pageid": 1164,
  "description": "Intelligence of machines",
  "extract": "Artificial intelligence (AI) is the capability of computational systems to perform tasks typically associated with human intelligence, such as learning, reasoning, problem-solving, perception, and decision-making...",
  "url": "https://en.wikipedia.org/wiki/Artificial_intelligence",
  "thumbnail": "https://upload.wikimedia.org/wikipedia/commons/thumb/.../400px.jpg",
  "language": "en",
  "langlinks_count": 176,
  "categories": ["Artificial intelligence", "Cybernetics", "Computational neuroscience"],
  "last_edited": "2026-06-20T11:32:10Z",
  "length_bytes": 291845,
  "query": "artificial intelligence"
}
```

### 💡 Use cases

- 🧠 **Knowledge bases** — pull clean summaries, descriptions and categories for thousands of topics to populate an internal wiki or reference store.
- 🔎 **RAG / LLM pipelines** — feed plain-text intro extracts into retrieval and grounding systems for accurate, citeable answers.
- 📊 **Entity enrichment** — attach a description, thumbnail and category set to people, places, companies or products in your dataset.
- 🌐 **Multilingual research** — scrape the same topics across language editions to compare coverage and build cross-lingual corpora.

### ❓ FAQ

**How do I scrape Wikipedia articles?** Enter one or more `searchTerms` (or exact `titles`), pick a `language`, set `maxPerTerm`, and Run. You get structured rows with the summary, extract, URL, thumbnail and categories.

**Do I need an API key or login?** No. It uses the public MediaWiki API — just provide keywords or titles.

**Which languages are supported?** Any Wikipedia edition — set `language` to the edition code (e.g. `en`, `de`, `es`, `fr`, `ja`).

**Can I look up exact pages?** Yes — pass the exact article titles in `titles` and the actor pulls those specific pages.

**Is the extract plain text or HTML?** Clean plain text of the intro section — no wiki markup and no HTML, so it is ready for indexing, embeddings or display.

**Can I get the full article body?** This returns the intro extract plus rich metadata, which is ideal for summaries, enrichment and RAG. For most pipelines the intro plus categories is exactly what you want.

**What does the language-links count tell me?** How many language editions the article exists in — a quick signal of how globally significant or well-covered a topic is.

**Can I run it on a schedule or via API?** Yes — schedule recurring runs on Apify, call it via the API/SDK, or connect it to Make, Zapier or n8n.

**How does pricing work?** Pay per article returned — no subscription, no fixed monthly fee.

**Is it legal?** It uses the public MediaWiki API. Wikipedia text is licensed under Creative Commons (CC BY-SA) — attribute it accordingly and follow Wikimedia's terms.

### 🔗 You might also like

- **[Academic Papers Scraper](https://apify.com/benthepythondev/crossref-papers-scraper)** — 150M+ scholarly works via Crossref.
- **[Books Scraper (Open Library)](https://apify.com/benthepythondev/open-library-books-scraper)** — books, authors & ISBNs.
- **[Wikidata Scraper](https://apify.com/benthepythondev/wikidata-scraper)** — structured facts & entities.
- **[Google News Scraper](https://apify.com/benthepythondev/google-news-scraper)** — headlines by keyword and country.

***

**Keywords:** wikipedia scraper, mediawiki api, wikipedia summary, article extract, knowledge base, rag pipeline, wikipedia data, encyclopedia data, content enrichment, wikipedia api, plain text extract, multilingual wikipedia, topic summaries, wiki data, wikipedia articles, entity enrichment, wikipedia summaries, llm training data, wikipedia dataset, article metadata

### Support and feedback

If this Actor saves time in your workflow, please leave a short Apify Store review. Reviews help other users evaluate the tool and help prioritize maintenance. If a source changes or a field stops populating, open an Actor issue with the run ID, public input, and expected field. Never include passwords, private cookies, or confidential data.

# Actor input Schema

## `searchTerms` (type: `array`):

Keywords/topics to search Wikipedia for, e.g. 'artificial intelligence'.

## `titles` (type: `array`):

Optional: look up exact article titles, e.g. 'Alan Turing'.

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

Wikipedia language edition code, e.g. 'en', 'de', 'es'.

## `maxPerTerm` (type: `integer`):

Maximum articles to return per search term.

## Actor input object example

```json
{
  "searchTerms": [
    "artificial intelligence"
  ],
  "titles": [],
  "language": "en",
  "maxPerTerm": 10
}
```

# 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 = {
    "searchTerms": [
        "artificial intelligence"
    ],
    "language": "en",
    "maxPerTerm": 10
};

// Run the Actor and wait for it to finish
const run = await client.actor("benthepythondev/wikipedia-scraper").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 = {
    "searchTerms": ["artificial intelligence"],
    "language": "en",
    "maxPerTerm": 10,
}

# Run the Actor and wait for it to finish
run = client.actor("benthepythondev/wikipedia-scraper").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 '{
  "searchTerms": [
    "artificial intelligence"
  ],
  "language": "en",
  "maxPerTerm": 10
}' |
apify call benthepythondev/wikipedia-scraper --silent --output-dataset

```

## MCP server setup

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

```

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/acts/sZXWX26WdJb4cg9nQ/builds/LFYaXhq4Z4bPZm738/openapi.json
