# Wikipedia Article Scraper (`gochujang/wikipedia-article-scraper`) Actor

Scrape Wikipedia articles via public MediaWiki API — no proxy, no auth. Modes: summary (extract + thumbnail), full\_text, search, random, category. Supports 250+ language editions.

- **URL**: https://apify.com/gochujang/wikipedia-article-scraper.md
- **Developed by:** [Hojun Lee](https://apify.com/gochujang) (community)
- **Categories:** Automation, AI
- **Stats:** 2 total users, 1 monthly users, 100.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 Article Scraper

Scrape Wikipedia articles at scale using the public MediaWiki API and REST API — **no proxy, no API key, no auth required**. Supports 250+ language editions.

### Features

| Mode | What it does |
|------|-------------|
| `summary` | Short extract + thumbnail image for one or more article titles |
| `full_text` | Complete article plain text (all sections) |
| `search` | Search by keyword and return a list of matching articles |
| `random` | Fetch N random articles |
| `category` | List all articles in a Wikipedia category |

### Input

| Field | Type | Default | Description |
|-------|------|---------|-------------|
| `mode` | string | `summary` | Scraping mode: `summary`, `full_text`, `search`, `random`, `category` |
| `titles` | string\[] | `[]` | Article titles for `summary` / `full_text` modes |
| `searchQuery` | string | `""` | Search keyword (`search` mode) |
| `category` | string | `""` | Category name without `Category:` prefix (`category` mode) |
| `language` | string | `en` | Wikipedia language code (`en`, `ko`, `ja`, `de`, `fr`, `es`, …) |
| `maxItems` | integer | `10` | Maximum articles to return (1–500) |
| `includeImages` | boolean | `true` | Include thumbnail image URL |

#### Example inputs

**Fetch article summaries**

```json
{
  "mode": "summary",
  "titles": ["Artificial intelligence", "Python (programming language)"],
  "language": "en"
}
```

**Get full article text**

```json
{
  "mode": "full_text",
  "titles": ["Quantum computing"],
  "language": "en"
}
```

**Keyword search**

```json
{
  "mode": "search",
  "searchQuery": "neural network deep learning",
  "maxItems": 20
}
```

**Random articles**

```json
{
  "mode": "random",
  "maxItems": 5,
  "language": "ko"
}
```

**Category members**

```json
{
  "mode": "category",
  "category": "Machine_learning",
  "maxItems": 50
}
```

### Output

Each item in the dataset:

```json
{
  "title": "Artificial intelligence",
  "url": "https://en.wikipedia.org/wiki/Artificial_intelligence",
  "language": "en",
  "summary": "Artificial intelligence (AI) is intelligence demonstrated by machines…",
  "text": "…full article text…",
  "thumbnail": "https://upload.wikimedia.org/wikipedia/commons/thumb/…",
  "categories": ["Artificial intelligence", "Computer science"],
  "last_modified": "2026-09-01T00:00:00Z"
}
```

> `text` is populated only in `full_text` mode. `thumbnail` is omitted when `includeImages` is `false`.

### Pricing (Pay-Per-Event)

| Event | Price |
|-------|-------|
| Actor start | $0.005 |
| Per article scraped | $0.003 |

Scraping 100 articles costs ~**$0.305** (start + 100 × $0.003).

### Supported Languages

Any Wikipedia language edition: `en`, `ko`, `ja`, `zh`, `de`, `fr`, `es`, `pt`, `it`, `ru`, `ar`, `hi`, `nl`, `pl`, `sv`, `vi`, and 240+ more. Pass the two-letter (or longer) ISO language code as `language`.

### Notes

- Uses Wikipedia's [REST API](https://en.wikipedia.org/api/rest_v1/) for summaries and the [MediaWiki Action API](https://www.mediawiki.org/wiki/API:Main_page) for full text, search, random, and category queries.
- No scraping of HTML pages — API responses only.
- Respects Wikipedia's [Terms of Use](https://foundation.wikimedia.org/wiki/Policy:Terms_of_Use).
- Rate-limited naturally by Wikipedia's API (no aggressive throttling needed).

# Actor input Schema

## `mode` (type: `string`):

Scraping mode: summary (short extract + image), full\_text (complete article text), search (keyword search), random (N random articles), category (articles in a category).

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

Wikipedia article titles to fetch (used in summary and full\_text modes). Example: \["Artificial intelligence", "Python (programming language)"]

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

Keyword or phrase to search (used in search mode).

## `category` (type: `string`):

Wikipedia category name without the 'Category:' prefix (used in category mode). Example: Machine\_learning

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

Wikipedia language edition code. Examples: en (English), ko (Korean), ja (Japanese), de (German), fr (French), es (Spanish), zh (Chinese), pt (Portuguese), it (Italian), ru (Russian).

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

Maximum number of articles to scrape.

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

Include thumbnail image URL in output (when available).

## Actor input object example

```json
{
  "mode": "summary",
  "titles": [
    "Artificial intelligence",
    "Python (programming language)"
  ],
  "searchQuery": "machine learning",
  "category": "Machine_learning",
  "language": "en",
  "maxItems": 10,
  "includeImages": true
}
```

# Actor output Schema

## `dataset` (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 = {
    "mode": "summary",
    "titles": [
        "Artificial intelligence",
        "Python (programming language)"
    ],
    "searchQuery": "machine learning",
    "category": "Machine_learning",
    "language": "en"
};

// Run the Actor and wait for it to finish
const run = await client.actor("gochujang/wikipedia-article-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 = {
    "mode": "summary",
    "titles": [
        "Artificial intelligence",
        "Python (programming language)",
    ],
    "searchQuery": "machine learning",
    "category": "Machine_learning",
    "language": "en",
}

# Run the Actor and wait for it to finish
run = client.actor("gochujang/wikipedia-article-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 '{
  "mode": "summary",
  "titles": [
    "Artificial intelligence",
    "Python (programming language)"
  ],
  "searchQuery": "machine learning",
  "category": "Machine_learning",
  "language": "en"
}' |
apify call gochujang/wikipedia-article-scraper --silent --output-dataset

```

## MCP server setup

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