# Wikipedia Scraper — Article Content & Metadata | $0.50/1K (`parsing_machine/wikipedia-scraper`) Actor

Scrape Wikipedia articles, summaries, full-text extracts, categories, and metadata via the official MediaWiki REST and Action APIs. Supports title lookup, full-text search, multi-language, and bulk input. No proxy, no auth. Pay per article.

- **URL**: https://apify.com/parsing\_machine/wikipedia-scraper.md
- **Developed by:** [Iakov Iudin](https://apify.com/parsing_machine) (community)
- **Categories:** Education, MCP servers, AI
- **Stats:** 1 total users, 0 monthly users, 0.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

Pay per usage

This Actor is paid per platform usage. The Actor is free to use, and you only pay for the Apify platform usage, which gets cheaper the higher subscription plan you have.

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

## 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 — Article Content, Search & Metadata | from $0.50/1K

**Built for RAG pipelines, LLM context builders, and knowledge-graph teams** who need structured Wikipedia data without brittle HTML parsing. Powered by the official MediaWiki REST and Action APIs — no proxy, no auth, zero COGS.

Scrape Wikipedia articles, summaries, full-text extracts, categories, and metadata via the **official MediaWiki REST and Action APIs**. No proxy. No auth. Multi-language. Pay per article.

***

### Features

- **Title lookup** — fetch any Wikipedia article by exact or near-exact title
- **Full-text search** — find articles by keyword; each result enriched with REST v1 summary
- **Intro or full text** — `fullText` toggle controls extract depth (intro paragraph vs. entire article)
- **Categories** — optional list of Wikipedia categories per article (up to 20)
- **Multi-language** — any Wikipedia language edition (`language: "en"`, `"de"`, `"fr"`, `"ja"`, etc.)
- **Rich metadata** — Wikidata Q-ID (`wikibase_item`), thumbnail URL, article byte length, last modified date
- **parse\_confidence** — every record includes a quality score (1.0 = all fields present); zero silent failures
- **$0 infrastructure cost** — official APIs, no proxy, no auth tokens

***

### Use cases

- Content research pipelines (LLM context, RAG datasets)
- Academic and news monitoring
- Knowledge graph enrichment (Wikidata cross-reference via `wikibase_item`)
- Education tools and topic discovery
- Multilingual dataset building

***

### Input

| Parameter | Type | Default | Description |
|---|---|---|---|
| `titles` | array | `["Python (programming language)", "Machine learning"]` | Article titles to fetch directly |
| `searchQueries` | array | `[]` | Full-text search terms; each enriched with REST summary |
| `language` | string | `"en"` | Wikipedia language code (en, de, fr, es, zh, ja, ru, …) |
| `maxItems` | integer | `50` | Total article cap (0 = unlimited) |
| `maxSearchResults` | integer | `10` | Results per search query (max 50) |
| `fullText` | boolean | `false` | Fetch full article text (can be large) |
| `includeCategories` | boolean | `false` | Include categories list (adds one API call per article) |

***

### Output schema

Each dataset row contains:

| Field | Description |
|---|---|
| `page_id` | MediaWiki integer page ID |
| `title` | Canonical article title |
| `summary` | Intro paragraph (always populated) |
| `extract` | Full text if `fullText=true`, else same as summary |
| `url` | Desktop canonical article URL |
| `lang` | Wikipedia language code |
| `description` | Short Wikidata description (e.g. "German-born theoretical physicist") |
| `wikibase_item` | Wikidata Q-ID (e.g. "Q937") for cross-dataset enrichment |
| `last_modified` | ISO 8601 UTC of most recent edit |
| `length` | Article size in bytes |
| `thumbnail_url` | Lead image URL (when available) |
| `categories` | List of category names (prefix "Category:" stripped) |
| `query` | Title or search term that produced this record |
| `source` | `"title_lookup"` or `"search"` |
| `scraped_at` | ISO 8601 UTC for this run |
| `parse_confidence` | 0.0–1.0 quality score; 1.0 = all fields present |
| `warnings` | Machine-readable list of missing/degraded field codes |

***

### Pricing

Pay-per-result (PPE): **from $0.50 per 1,000 articles**. No monthly subscription.

| Volume | Cost |
|--------|------|
| 100 articles | ~$0.05 |
| 1,000 articles | ~$0.50 |
| 10,000 articles | ~$5.00 |

Infrastructure cost to you: **$0** — no proxy, no external API keys.

***

### FAQ

**Do I need a proxy or API key?**
No. The actor uses the official public MediaWiki APIs — no authentication, no proxy required.

**What output formats are available?**
JSON (default), CSV, and Excel — downloadable from the Apify dataset UI or via the REST API.

**Can I schedule this to run automatically?**
Yes. Use Apify's built-in scheduler to run on a cron schedule (hourly, daily, weekly) and push fresh data to your pipeline via webhooks.

**What happens if an article title is not found or returns empty?**
The actor logs a warning and skips the record — no crash, no silent empty row. Failed titles are listed in the `OUTPUT` key at the end of the run.

***

### API details

Built on two official, stable, zero-cost Wikipedia APIs:

- **MediaWiki REST v1** — `https://<lang>.wikipedia.org/api/rest_v1/page/summary/<title>`\
  Provides: intro extract, thumbnail, description, wikibase\_item, timestamp, canonical URL.

- **MediaWiki Action API** — `https://<lang>.wikipedia.org/w/api.php`\
  Provides: full-text extract, article length, categories, last revision.

Both APIs are public, documented, and maintained by the Wikimedia Foundation. No API key required.\
This actor complies with [Wikimedia API usage policy](https://www.mediawiki.org/wiki/API:Etiquette) by sending a descriptive User-Agent.

***

### Integrations

Built for RAG pipelines and LLM context builders pulling structured article text and metadata at scale — the JSON/dataset output drops into the tools you already run, no glue code:

- **n8n / Make / Zapier** — trigger a run or pipe every new dataset item into 500+ apps (Google Sheets, Airtable, Slack, HubSpot, your database) with no code: [n8n](https://docs.apify.com/platform/integrations/n8n), [Make](https://docs.apify.com/platform/integrations/make), [Zapier](https://docs.apify.com/platform/integrations/zapier).
- **Webhooks** — fire your own endpoint the moment a run finishes, to push results straight into your pipeline ([docs](https://docs.apify.com/platform/integrations/webhooks)).
- **MCP server** — expose this actor as a tool to Claude, Cursor, or any [MCP client](https://mcp.apify.com) so an AI agent can pull this data mid-conversation ([guide](https://blog.apify.com/how-to-use-mcp/)).
- **API & SDKs** — fetch the dataset as JSON, CSV, or Excel through the Apify REST API or the Python / JS SDKs.

See all [Apify integrations](https://apify.com/integrations).

### Not affiliated with Wikipedia or the Wikimedia Foundation.

Data is sourced from public Wikipedia APIs under the [Creative Commons Attribution-ShareAlike License](https://creativecommons.org/licenses/by-sa/4.0/).

***

### Use with AI agents (MCP)

This actor is available as an MCP tool for Claude, GPT-4, and other AI agents that support the Model Context Protocol:

```
https://mcp.apify.com/?tools=bovi/wikipedia-scraper
```

Agents can call `wikipedia-scraper` to retrieve article content, summaries, and structured metadata on demand — ideal for RAG pipelines and knowledge enrichment tasks.

***

### vs. competitors

| | **This actor** | Typical Wikipedia scraper |
|---|---|---|
| Data source | Official MediaWiki REST + Action APIs | HTML scraping |
| Multi-language | ✓ (any edition) | Usually EN only |
| Full-text extract | ✓ (`fullText` toggle) | Rarely |
| `parse_confidence` | ✓ | No |
| Proxy needed | No | Often required |
| Price | from $0.50/1K | $3–10/1K |

# Actor input Schema

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

Wikipedia article titles to fetch directly (e.g. "Python (programming language)", "Albert Einstein"). Exact or near-exact matches. Use canonical title form as shown in the Wikipedia URL.

## `searchQueries` (type: `array`):

Full-text search terms. Each query finds the top matching Wikipedia articles. Combines with titles — both are processed.

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

Wikipedia language edition to query. Use a valid language code: en (English), de (German), fr (French), es (Spanish), zh (Chinese), ja (Japanese), ru (Russian), etc. Default: en.

## `maxItems` (type: `integer`):

Maximum total articles to return across all titles and search queries. 0 = no limit. Default 50.

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

Maximum articles returned per search query. 0 = API default (10). Default 10.

## `fullText` (type: `boolean`):

If true, fetch the full plain-text article extract (can be large for long articles). If false, returns only the intro/summary paragraph. Default false to keep costs low.

## `includeCategories` (type: `boolean`):

Fetch Wikipedia categories for each article (up to 20). Adds one extra API call per article. Default false.

## Actor input object example

```json
{
  "titles": [
    "Python (programming language)",
    "Machine learning"
  ],
  "searchQueries": [],
  "language": "en",
  "maxItems": 50,
  "maxSearchResults": 10
}
```

# Actor output Schema

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

Dataset containing Wikipedia Scraper records (title, description, summary, categories, lang, last\_modified, length, query, url, thumbnail\_url, parse\_confidence).

# 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 = {
    "titles": [
        "Python (programming language)",
        "Machine learning"
    ],
    "searchQueries": [],
    "language": "en",
    "maxItems": 50,
    "maxSearchResults": 10,
    "fullText": false,
    "includeCategories": false
};

// Run the Actor and wait for it to finish
const run = await client.actor("parsing_machine/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 = {
    "titles": [
        "Python (programming language)",
        "Machine learning",
    ],
    "searchQueries": [],
    "language": "en",
    "maxItems": 50,
    "maxSearchResults": 10,
    "fullText": False,
    "includeCategories": False,
}

# Run the Actor and wait for it to finish
run = client.actor("parsing_machine/wikipedia-scraper").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 '{
  "titles": [
    "Python (programming language)",
    "Machine learning"
  ],
  "searchQueries": [],
  "language": "en",
  "maxItems": 50,
  "maxSearchResults": 10,
  "fullText": false,
  "includeCategories": false
}' |
apify call parsing_machine/wikipedia-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,parsing_machine/wikipedia-scraper"
        }
    }
}

```

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/G4oFduFHPbtsWY2Ma/builds/KBb8TsCu2B44FZ8aR/openapi.json
