# Wikipedia Article Extractor: Summary, Full Text, Sections (`klyve1/wikipedia-article-extractor`) Actor

Get Wikipedia articles in any language with the official Wikimedia API: summary, full plain text, sections, categories, coordinates, Wikidata id, image and page views. Search by keyword or title. For RAG and research.

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

## Pricing

from $1.00 / 1,000 articles

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: Summary, Full Text, Sections

Get Wikipedia articles in any of the 300+ languages through the official Wikimedia API: short description, summary, full plain text, text split by sections, categories, Wikidata id, coordinates, main image, number of other language versions and, optionally, page views over the last 30 days. Fetch articles by title or URL, or search Wikipedia by keyword.

### What people use it for

- **RAG and LLM knowledge bases**: clean plain text already split into sections, ready to chunk and embed, with the source URL and license on every row.
- **Entity enrichment**: add a description, summary, image, coordinates and Wikidata id to a list of companies, places, people or products.
- **Research and education**: collect the articles on a topic in several languages for analysis or comparison.
- **SEO and content work**: measure interest with page views and find related categories.

### Example output

```json
{
  "title": "Tour Eiffel",
  "language": "fr",
  "pageId": 1359783,
  "url": "https://fr.wikipedia.org/wiki/Tour_Eiffel",
  "shortDescription": "tour de fer puddlé de 330 mètres à Paris, France",
  "summary": "La tour Eiffel est une tour autoportante de fer puddlé de 330 m de hauteur (avec antennes) située à Paris...",
  "text": "La tour Eiffel est une tour autoportante de fer puddlé de 330 m de hauteur...",
  "textLength": 86948,
  "sections": [
    { "title": "Présentation générale", "level": 1, "text": "Contestée par certains à l'origine puis plébiscitée par le public..." },
    { "title": "Données techniques", "level": 2, "text": "Voici les principales dimensions de la tour Eiffel..." }
  ],
  "categories": ["Architecture du XIXe siècle en Île-de-France", "Architecture métallique en France", "Champ-de-Mars (Paris)"],
  "wikidataId": "Q243",
  "isDisambiguation": false,
  "coordinates": { "lat": 48.858296, "lon": 2.294479 },
  "imageUrl": "https://upload.wikimedia.org/wikipedia/commons/a/a8/Tour_Eiffel_Wikimedia_Commons.jpg",
  "otherLanguages": 175,
  "lastModified": "2026-11-17T19:46:25Z",
  "redirectedFrom": null,
  "license": "CC BY-SA 4.0 (Wikipedia contributors)",
  "fetchedAt": "2026-11-18T17:58:48.282Z"
}
```

### Input

| Field | What it does |
|---|---|
| Article titles or URLs | `Paris`, `fr:Tour Eiffel` or `https://de.wikipedia.org/wiki/Berlin`. Redirects are followed. |
| Search query | Search Wikipedia and fetch the best matches. |
| Default language | Language code for titles without prefix and for the search (en, fr, de...). |
| Max articles | Number of search results to fetch. |
| Include full text | Full article, or only the introduction (faster). |
| Include sections | Split the text into titled sections. |
| Max characters of text | Cut long texts. |
| Include page views | Human page views over the last 30 days. |

### Pricing

Pay per result: **$0.001 per article saved** ($1 per 1,000 articles). Titles that do not exist are free.

### Good to know

- Uses only the official MediaWiki and Wikimedia REST APIs with an identifying user agent, as Wikimedia asks. No page scraping.
- Wikipedia text is licensed CC BY-SA 4.0: if you republish it, credit Wikipedia and its contributors and keep the same license. The `url` and `license` fields make that easy.
- Tables, infobox values and references are not part of the plain text.

# Actor input Schema

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

Articles to fetch, one per line: a title (Paris), a title with a language prefix (fr:Tour Eiffel) or a full Wikipedia URL. Redirects are followed.

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

Optional. Search Wikipedia for these words (in the default language) and fetch the best matching articles, up to Max articles.

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

Wikipedia language code used for titles without prefix and for the search, for example en, fr, de, es, ja.

## `maxResults` (type: `integer`):

Maximum number of articles returned by the search (titles you list are always fetched).

## `includeFullText` (type: `boolean`):

Add the full plain text of the article. When off, only the introduction is returned (faster).

## `includeSections` (type: `boolean`):

Also split the full text into sections with their title and level, handy for chunking in RAG pipelines.

## `maxTextChars` (type: `integer`):

Cut the full text and each section to this many characters. 0 means no limit.

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

Add the number of human page views over the last 30 days (one extra request per article).

## Actor input object example

```json
{
  "titles": [
    "Large language model",
    "fr:Tour Eiffel"
  ],
  "language": "en",
  "maxResults": 10,
  "includeFullText": true,
  "includeSections": true,
  "maxTextChars": 0,
  "includePageviews": false
}
```

# Actor output Schema

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

All rows produced by the run.

# 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": [
        "Large language model",
        "fr:Tour Eiffel"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("klyve1/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 = { "titles": [
        "Large language model",
        "fr:Tour Eiffel",
    ] }

# Run the Actor and wait for it to finish
run = client.actor("klyve1/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 '{
  "titles": [
    "Large language model",
    "fr:Tour Eiffel"
  ]
}' |
apify call klyve1/wikipedia-article-extractor --silent --output-dataset

```

## MCP server setup

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