# Wikipedia Article Extractor – Bulk Summaries, Text & Wikidata (`gazidev/wikipedia-extractor`) Actor

Bulk Wikipedia articles by title, URL or search, any language: summary or full plain text, sections, categories, Wikidata ID, coordinates and lead image. Official Wikimedia APIs only, CC BY-SA attribution on every row. $0.50 per 1,000 summaries.

- **URL**: https://apify.com/gazidev/wikipedia-extractor.md
- **Developed by:** [Cemal Atakli](https://apify.com/gazidev) (community)
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $0.50 / 1,000 wikipedia article (summary)s

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 Article Extractor – Bulk Summaries, Full Text & Wikidata IDs

Give it **Wikipedia titles, article URLs or search queries** in any language and get one clean JSON row per article: the **summary** (intro) or the **full plain text** or **sections**, plus the short description, **categories**, **Wikidata ID**, **coordinates**, lead **image URL**, page length, last edit date and, optionally, **30-day pageviews**.

The data comes only from Wikipedia's **official APIs** (the MediaWiki Action API and the Wikimedia pageviews REST API). No HTML pages are crawled. Every row carries the **CC BY-SA 4.0 license, the article URL and an attribution line**, so you can reuse the text correctly.

**$0.50 per 1,000 summaries**, $1 per 1,000 full articles. Titles that do not exist are free.

### What you can use it for

- **LLM / RAG knowledge bases:** clean plain text or section chunks (heading + text) of thousands of articles, with source URL and license per chunk.
- **Entity enrichment:** match company, place or person names to their Wikipedia article and **Wikidata QID**, short description and coordinates.
- **SEO and content research:** intros, categories and pageviews of the articles behind a keyword (`searchQueries`).
- **Data science:** category lists, article length, last edit date and popularity for a set of topics, in 300+ languages.

### Input

| Field | Default | Notes |
|---|---|---|
| `titles` | prefill: Web scraping, Python (programming language), Paris | Article titles. Redirects are followed (`USA` → `United States`). |
| `urls` | – | Article URLs of any language edition (`https://de.wikipedia.org/wiki/Berlin`, mobile `en.m.` URLs too). Only parsed, never fetched. |
| `searchQueries` | – | Wikipedia full-text search; the top `maxResultsPerQuery` (default 10) results are extracted. |
| `language` | `en` | Language edition for titles and searches: `de`, `fr`, `es`, `ja`, `tr`, `simple` … |
| `content` | `summary` | `summary` (intro), `fullText` (whole article, plain text) or `sections` (list of heading, level, text). |
| `includeCategories` | `true` | Visible categories (hidden maintenance categories are left out). |
| `includePageviews` | `false` | Human pageviews of the last 30 full days (free, one extra API call per article). |
| `maxItems` | 1,000 | Cap on titles/URLs/search results processed. |

```json
{
  "titles": ["Web scraping", "Python (programming language)"],
  "urls": ["https://de.wikipedia.org/wiki/Berlin"],
  "searchQueries": ["large language model"],
  "maxResultsPerQuery": 5,
  "content": "summary",
  "includePageviews": true
}
```

### Output (one row per article)

```json
{
  "input": "Paris",
  "inputType": "title",
  "redirectedFrom": null,
  "title": "Paris",
  "pageId": 22989,
  "url": "https://en.wikipedia.org/wiki/Paris",
  "language": "en",
  "shortDescription": "Capital and largest city of France",
  "summary": "Paris is the capital and largest city of France, with an estimated city population of 2.04 million …",
  "categories": ["Capital cities in Europe", "Cities in France", "Megacities", "…"],
  "wikidataId": "Q90",
  "wikidataUrl": "https://www.wikidata.org/wiki/Q90",
  "coordinates": {"lat": 48.8567, "lon": 2.3522},
  "imageUrl": "https://upload.wikimedia.org/wikipedia/commons/4/4b/La_Tour_Eiffel_vue_de_la_Tour_Saint-Jacques%2C_Paris_ao%C3%BBt_2014_%282%29.jpg",
  "isDisambiguation": false,
  "length": 231208,
  "lastEdited": "2026-11-12T23:00:18Z",
  "revisionId": 1385351351,
  "license": "CC BY-SA 4.0",
  "licenseUrl": "https://creativecommons.org/licenses/by-sa/4.0/",
  "attribution": "\"Paris\" from Wikipedia (en), by Wikipedia contributors, CC BY-SA 4.0",
  "historyUrl": "https://en.wikipedia.org/w/index.php?curid=22989&action=history",
  "notFound": false,
  "error": null
}
```

- `content: "fullText"` adds `text` (the whole article as plain text, headings on their own lines) and `sectionCount`.
- `content: "sections"` adds `sections`: `[{"heading": null, "level": 1, "text": "<intro>"}, {"heading": "History", "level": 2, "text": "…"}, …]`.
- Search results also have `searchQuery` and `searchRank`. With pageviews on: `pageviews30d`.
- Titles that do not exist, invalid titles and non-Wikipedia URLs get a free row with `notFound: true` and an `error`.
- The run summary (key-value store `OUTPUT`) has counts, API requests and whether the run stopped at your max charge.

### Pricing (pay per event)

| Event | Price | When |
|---|---|---|
| `article` | **$0.0005** | Each article returned with `content: summary` |
| `article-fulltext` | **$0.001** | Each article returned with `content: fullText` or `sections` |
| Actor start | $0.00005 | Once per run |

Not charged: titles not found, invalid titles or URLs, duplicates (same article reached twice, e.g. via a redirect), failed requests, pageviews. The run stops cleanly when your **maximum total charge** is reached.

| Actor | Price per 1,000 articles |
|---|---|
| **This Actor** | **$0.50** (summary) / **$1.00** (full text) |
| automation-lab/wikipedia-scraper | $1.15 + $0.001 per run |
| Other Wikipedia actors in the Store | about $1.00 |

(Store prices checked on 21 Nov 2026.)

### Speed and limits (honest)

- Wikimedia asks API clients to send **one request at a time and fewer than 5 per second**. This Actor follows that and uses `maxlag`, so it backs off when Wikipedia's servers are busy.
- **Summaries are batched 20 per API call**: about 1,000 summaries in 30–60 seconds.
- **Full text and sections need one API call per article** (an API rule): about 3–4 articles per second, so 1,000 full articles take roughly 5 minutes. Pageviews add one call per article.
- Text is TextExtracts plain text: no tables, infoboxes, references or image captions. Math formulas and some templates may be missing.
- `language` must be an existing Wikipedia language code; an unknown one gives free error rows.

### License and attribution (please read)

Wikipedia text is licensed under **[CC BY-SA 4.0](https://creativecommons.org/licenses/by-sa/4.0/)**. You may use it commercially, but you must **credit Wikipedia contributors, link the source** (`url` or `historyUrl`) and share adapted text under the same license. Each row has `license`, `licenseUrl`, `attribution` and `url` for that. Images at `imageUrl` have their own licenses on Wikimedia Commons. This Actor is not affiliated with or endorsed by the Wikimedia Foundation; Wikipedia is a trademark of the Wikimedia Foundation.

### How is this different from our other listings?

- [Article Extractor](https://apify.com/gazidev/article-extractor) and [Website to Markdown](https://apify.com/gazidev/website-to-markdown) read any web page's HTML; this Actor reads Wikipedia **through its API only** and adds structured fields (Wikidata ID, categories, coordinates, pageviews, license) that page scrapers do not give.
- [News MCP Server](https://apify.com/gazidev/news-mcp-server) gives AI agents Wikipedia *current events* and news; this Actor is a bulk article extractor for datasets.
- [Academic Paper Search](https://apify.com/gazidev/academic-paper-search) covers scholarly papers (Crossref) instead of encyclopedia articles.

### Use with AI agents (Apify MCP)

Add this Actor to Claude, Cursor or any MCP client through the [Apify MCP server](https://mcp.apify.com) (`gazidev/wikipedia-extractor`). An agent can ask for `{"titles": ["Marie Curie"], "content": "sections"}` and get licensed, attributed text chunks ready for retrieval, or `{"searchQueries": ["solid-state battery"], "maxResultsPerQuery": 5}` for a quick topic briefing.

### FAQ

**Does it scrape wikipedia.org pages?** No. It only calls `<lang>.wikipedia.org/w/api.php` (MediaWiki Action API) and `wikimedia.org/api/rest_v1` (pageviews), with an identifying User-Agent, as Wikimedia's API etiquette asks.

**Can I get the infobox?** Not in this version. Use the `wikidataId` with Wikidata for structured facts.

**Disambiguation pages?** They are returned like articles with `isDisambiguation: true` (and charged). Use a precise title to avoid them.

**Other wikis (Wiktionary, Wikivoyage)?** Not yet: Wikipedia language editions only.

# Actor input Schema

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

Wikipedia article titles, one per line (case of the first letter and underscores do not matter; redirects are followed). Wikipedia URLs pasted here also work. If titles, URLs and search queries are all empty, three example articles are fetched.

## `urls` (type: `array`):

Article URLs from any language edition, e.g. https://de.wikipedia.org/wiki/Berlin or https://en.m.wikipedia.org/wiki/Paris. The language is taken from the URL. URLs are only parsed, never crawled: the data comes from the API.

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

Full-text Wikipedia searches (in the language below). The top results of each query are extracted.

## `maxResultsPerQuery` (type: `integer`):

How many top search results to extract per query.

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

Wikipedia language code for titles and search queries: en, de, fr, es, ja, ru, it, pt, zh, ar, tr, simple … (URLs use their own language).

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

Summary = the intro (lead) section, fastest (20 articles per API call). Full text = the whole article as plain text. Sections = the whole article split into headings with their text. Full text and sections cost more and need one API call per article.

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

Visible (non-hidden) categories of each article.

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

Human pageviews of the last 30 full days from the Wikimedia pageviews API. Free, but one extra API call per article (slower).

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

Cap on the number of titles/URLs/search results processed in this run.

## Actor input object example

```json
{
  "titles": [
    "Web scraping",
    "Python (programming language)",
    "Paris"
  ],
  "maxResultsPerQuery": 10,
  "language": "en",
  "content": "summary",
  "includeCategories": true,
  "includePageviews": false,
  "maxItems": 1000
}
```

# Actor output Schema

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

No description

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

No description

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

No description

## `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 = {
    "titles": [
        "Web scraping",
        "Python (programming language)",
        "Paris"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("gazidev/wikipedia-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 = { "titles": [
        "Web scraping",
        "Python (programming language)",
        "Paris",
    ] }

# Run the Actor and wait for it to finish
run = client.actor("gazidev/wikipedia-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 '{
  "titles": [
    "Web scraping",
    "Python (programming language)",
    "Paris"
  ]
}' |
apify call gazidev/wikipedia-extractor --silent --output-dataset

```

## MCP server setup

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