# Wikipedia Scraper - Article Text, Summaries & Infobox Data (`wood-between-studio/wikipedia-article-extractor`) Actor

Search Wikipedia in any language or fetch articles by title or URL: clean text or summary, infobox fields, description, categories, sections, thumbnail, Wikidata ID, coordinates, last edit, page views. Official MediaWiki API, CC BY-SA attribution included. $0.50 per 1,000 articles.

- **URL**: https://apify.com/wood-between-studio/wikipedia-article-extractor.md
- **Developed by:** [Wood Between Studio](https://apify.com/wood-between-studio) (community)
- **Categories:** AI, Developer tools, Education
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

$0.50 / 1,000 article returneds

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.

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 Scraper: Article Text, Summaries, Infobox Data and Page Views

**Search Wikipedia in any language or fetch articles by title or URL,** and get clean rows with the plain-text summary or full article, infobox fields (born, founded, population, headquarters...), short description, section headings, categories, Wikidata ID, thumbnail, coordinates, last edit time and optional 30-day page views.

### Why use it?

- **RAG and AI datasets:** clean plain text with license attribution on every row.
- **Entity enrichment:** add descriptions, Wikidata IDs and infobox facts to companies, people, places.
- **Content and SEO research:** page views and categories for topics.
- **Any language edition:** en, de, fr, es, ja, pt, it, nl, pl and 300 more.
- **Official MediaWiki API** with Wikimedia's API etiquette (identifying User-Agent, serial requests, maxlag).
- **Cheap and fair:** **$0.50 per 1,000 articles**, no start fee. Missing titles are free.

### Input

| Field | Default | Notes |
|---|---|---|
| `searchTerms` | | Full-text Wikipedia searches |
| `titles` | | Titles or wikipedia.org URLs (URL language wins) |
| `language` | `en` | Language edition code |
| `content` | `summary` | `full` article text, or `none` for metadata only |
| `includeInfobox` | `true` | Infobox fields as key/value |
| `includePageViews` | `false` | Views over the last 30 days |
| `maxResultsPerSearch` | `20` | up to 500 |

```json
{ "searchTerms": ["large language model"], "titles": ["https://en.wikipedia.org/wiki/Ada_Lovelace", "Tokyo"], "content": "summary", "includePageViews": true }
```

### Output

```json
{ "search": "title", "title": "Tokyo", "pageId": 30057, "description": "Capital and most populous city of Japan", "text": "Tokyo, officially the Tokyo Metropolis, is the capital...",
  "wordCount": 616, "infobox": { "_template": "Infobox settlement", "official_name": "Tokyo Metropolis", "subdivision_name": "Japan" }, "categories": ["Capital cities in Asia", "Megacities"],
  "wikidataId": "Q1490", "coordinates": { "lat": 35.6897, "lon": 139.6922 }, "lastEdited": "2026-11-17T19:49:00Z", "pageViews30d": 125089,
  "url": "https://en.wikipedia.org/wiki/Tokyo", "license": "CC BY-SA 4.0", "attribution": "Text from Wikipedia article \"Tokyo\" (...), CC BY-SA 4.0", "status": "ok" }
```

### Pricing

Pay per event: **$0.0005 per article** returned ($0.50 per 1,000). No start fee.

### Notes

Wikipedia text is licensed CC BY-SA 4.0: if you republish it, keep the attribution. Infobox parsing is best-effort (templates vary by language). Built by Wood Between Studio. Questions? Open an issue on the Issues tab.

# Actor input Schema

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

Full-text Wikipedia searches, one per line.

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

e.g. "Ada Lovelace" or https://en.wikipedia.org/wiki/Ada_Lovelace (URL language overrides the setting below).

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

Language edition code: en, de, fr, es, ja, pt, it, nl, pl...

## `content` (type: `string`):

How much article text to return.

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

Parse the article infobox (born, founded, population, CEO...) into key/value fields.

## `includePageViews` (type: `boolean`):

Adds total views over the last 30 days from the Wikimedia Pageviews API.

## `maxResultsPerSearch` (type: `integer`):

Up to 500 per search term.

## Actor input object example

```json
{
  "searchTerms": [
    "large language model"
  ],
  "language": "en",
  "content": "summary",
  "includeInfobox": true,
  "includePageViews": false,
  "maxResultsPerSearch": 20
}
```

# Actor output Schema

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

No description

## `summary` (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": [
        "large language model"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("wood-between-studio/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 = { "searchTerms": ["large language model"] }

# Run the Actor and wait for it to finish
run = client.actor("wood-between-studio/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 '{
  "searchTerms": [
    "large language model"
  ]
}' |
apify call wood-between-studio/wikipedia-article-extractor --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,wood-between-studio/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/VBYqLRICLCXRfd1g3/builds/2EEru2GOF1wQMkffj/openapi.json
