# Articles from Wikipedia: Text, Summaries and Wikidata IDs (`forgeloop/wikipedia-articles`) Actor

Get Wikipedia articles in any language from titles, URLs or a search: summary or full plain text split into sections, Wikidata ID, short description, categories, thumbnail, last edit and monthly pageviews. Official Wikimedia APIs, attribution included. Pay per article.

- **URL**: https://apify.com/forgeloop/wikipedia-articles.md
- **Developed by:** [Markus Heiß](https://apify.com/forgeloop) (community)
- **Categories:** AI, Developer tools
- **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

## Articles from Wikipedia: Text, Summaries and Wikidata IDs

Get Wikipedia articles in any language as clean data. Give titles, Wikipedia links or a search query and get back one row per article: the summary, the full plain text or the text split into sections, the Wikidata ID, the short description, categories, the thumbnail, the last edit and, if you want, monthly pageviews. Every row carries the CC BY-SA 4.0 license and a link to the page history for attribution.

Built for RAG pipelines and LLM knowledge bases, entity enrichment and research. The Actor reads only the official Wikimedia APIs and follows the Wikimedia API etiquette.

Not affiliated with the Wikimedia Foundation. All article text comes from [Wikipedia](https://www.wikipedia.org) and its contributors.

### What it does

- **Titles or links in any language:** `Albert Einstein`, `https://de.wikipedia.org/wiki/Graz`, mobile links, `index.php?title=` links and `?curid=` page IDs. A link sets the language itself, titles use the language field.
- **Search:** a full text search in one Wikipedia. The best matches are fetched as articles, ranked, up to Max articles.
- **Three content levels:** the lead section as summary, the full article as plain text with headings on their own lines, or the full article as a list of sections with title, level and text. Empty sections such as References are dropped.
- **Entity data:** Wikidata item ID (like `Q937`), short description, visible categories without hidden maintenance categories, thumbnail URL, page ID, revision ID and last edit time.
- **Disambiguation and redirects:** disambiguation pages are flagged. Redirects are followed by default (`UK` gives `United Kingdom`), the original title stays in `redirectedFrom`.
- **Monthly pageviews:** human pageviews for the last 1 to 24 full months from the Wikimedia pageviews API, as an object month to count.
- **Attribution included:** license, license URL and a link to the page history on every row.
- **Gentle with Wikipedia:** up to 20 titles per API request, one request at a time, `maxlag=5`, a User-Agent with a contact URL, backoff on HTTP 429 and 5xx, and it waits as long as Retry-After asks.

### Use cases

- **RAG and LLM knowledge bases:** load articles split into sections as chunks with title, level and source URL, ready for embeddings.
- **Entity enrichment:** add Wikidata IDs, short descriptions and thumbnails to a list of companies, places or people, then join other data sets on the Wikidata ID.
- **Research:** collect the articles of a search or a topic list in several languages, with word counts, categories and edit dates.
- **Content briefs:** get the summary, structure and pageview trend of the articles about a topic before you write about it.

### Input

| Field | Description | Default |
|---|---|---|
| Titles or Wikipedia URLs | `Albert Einstein`, `https://de.wikipedia.org/wiki/Graz`, `https://en.wikipedia.org/w/index.php?curid=736` | |
| Search query | Full text search in the Wikipedia of the language below | |
| Language | Wikipedia language code for titles and the search: `en`, `de`, `fr`, `ja`, `simple` ... | `en` |
| Content | `summary`, `text` (full plain text) or `sections` | `summary` |
| Include categories | Visible categories of each article | on |
| Include Wikidata ID | Wikidata item ID of each article | on |
| Monthly pageviews (months) | 0 (off) to 24 full months | 0 |
| Follow redirects | Return the target article of a redirect | on |
| Max articles | 1 to 5,000 | 50 |

Example, three articles in two languages as sections for a RAG index:

```json
{
  "articles": [
    "Retrieval-augmented generation",
    "https://de.wikipedia.org/wiki/Graz",
    "https://ja.wikipedia.org/wiki/東京都"
  ],
  "content": "sections"
}
```

Example, the 20 best French articles for a search, with summary and 12 months of pageviews:

```json
{
  "searchQuery": "énergie solaire",
  "language": "fr",
  "pageviewsMonths": 12,
  "maxArticles": 20
}
```

### Output

One dataset item per article (shortened):

```json
{
  "input": "Albert Einstein",
  "title": "Albert Einstein",
  "language": "en",
  "pageId": 736,
  "url": "https://en.wikipedia.org/wiki/Albert_Einstein",
  "wikidataId": "Q937",
  "description": "German-born theoretical physicist (1879–1955)",
  "summary": "Albert Einstein (14 March 1879 – 18 April 1955) was a German-born theoretical physicist best known for developing the theory of relativity...",
  "text": null,
  "sections": [
    { "title": "Albert Einstein", "level": 1, "text": "Albert Einstein (14 March 1879 – 18 April 1955) was a German-born theoretical physicist..." },
    { "title": "Life and career", "level": 2, "text": "" },
    { "title": "Childhood, youth and education", "level": 3, "text": "Einstein was born in Ulm as a subject to the Kingdom of Württemberg..." }
  ],
  "wordCount": 14199,
  "pageLengthBytes": 240577,
  "categories": ["1879 births", "1955 deaths", "Nobel laureates in Physics"],
  "lastEditedAt": "2026-11-17T17:32:00Z",
  "revisionId": 1386275911,
  "thumbnailUrl": "https://thumb.wikimedia.org/wikipedia/commons/thumb/2/28/Albert_Einstein_Head_cleaned.jpg/960px-Albert_Einstein_Head_cleaned.jpg",
  "pageviews": { "2026-08": 304441, "2026-09": 293266, "2026-10": 296284 },
  "isDisambiguation": false,
  "isRedirect": false,
  "redirectedFrom": null,
  "searchRank": null,
  "license": "CC BY-SA 4.0, text from Wikipedia contributors",
  "licenseUrl": "https://creativecommons.org/licenses/by-sa/4.0/",
  "attributionUrl": "https://en.wikipedia.org/w/index.php?title=Albert_Einstein&action=history",
  "error": null
}
```

- `summary` is the lead section as plain text. It is always included.
- `text` is filled with Content `text`, `sections` with Content `sections`. The other one is `null`. In `sections`, the lead has the article title and level 1, `==` headings are level 2, `===` level 3 and so on. A heading without own text stays in the list when subsections with text follow.
- `wordCount` counts the words of the delivered text: the full text or the sections with Content `text` or `sections`, the summary otherwise. It also works for Chinese, Japanese and Thai.
- `pageLengthBytes` is the size of the wiki source of the page, a rough measure of the article length that does not depend on the content option.
- `description` is the short description that Wikipedia shows under the title in search and on mobile. Not every article has one.
- `categories` holds the visible categories without the namespace prefix. `null` when the option is off.
- `pageviews` counts human views (no bots) per calendar month. Months without data are 0. `null` when the option is off.
- `searchRank` is the position in the search results, `null` for titles and links.
- `isRedirect` is `true` only when Follow redirects is off and the title is a redirect page.
- A title that does not exist, an invalid title or a link that is not a Wikipedia article returns a free item with `error` set, for example `Page not found on en.wikipedia.org.`

Export the dataset as JSON, CSV or Excel, or read it through the Apify API.

### Pricing

Pay per article: 0.001 USD per delivered article, so 1.00 USD per 1,000 articles. The price is the same for summary, full text and sections. Missing pages, invalid lines and errors are free. Set Max articles or the maximum charge in Apify to cap the cost of a run.

Each run also has a start fee of 0.00005 USD per GB of memory, which Apify shows as Actor Start.

### Limits

- Summaries come in batches of 20 articles per request. The full text and the pageviews take one extra request per article each, so runs with Content `text` or `sections` and with pageviews take longer. Expect about 1,000 articles with full text in 10 minutes.
- The plain text comes from the Wikipedia TextExtracts API. Tables, infoboxes, image captions, math formulas and references are mostly left out. Lists become plain lines.
- The search uses the Wikipedia search engine and returns at most 10,000 results per query.
- Duplicates are removed: the same title twice, or two inputs that lead to the same article (for example a redirect and its target), give one row.
- Language variants (for example Chinese `zh-tw` links) return the article in the default script of that Wikipedia.
- When Wikipedia stays unavailable after retries, the run stops with a free error item. Rows delivered so far stay in the dataset.

### Data source, permitted use and legal

- **Data source:** [Wikipedia](https://www.wikipedia.org), read through the official [MediaWiki Action API](https://www.mediawiki.org/wiki/API:Main_page) and the [Wikimedia pageviews API](https://doc.wikimedia.org/generated-data-platform/aqs/analytics-api/). All credit for the articles goes to the Wikipedia contributors. This Actor is not affiliated with or endorsed by the Wikimedia Foundation.
- **License of the text:** Wikipedia text is licensed under [CC BY-SA 4.0](https://creativecommons.org/licenses/by-sa/4.0/). When you reuse it, you must give attribution (credit the Wikipedia contributors and link the article or its history, as in `attributionUrl`) and share your adapted text under the same license. Images behind `thumbnailUrl` can have their own licenses on Wikimedia Commons. The [Wikimedia Terms of Use](https://foundation.wikimedia.org/wiki/Policy:Terms_of_Use) apply.
- **Snapshot:** Results show the articles at the time of the run. We do not guarantee that they are complete, current or correct.
- **For business use:** This Actor is offered to businesses only, not to consumers.
- **Your responsibility:** You choose the articles and decide what happens with the results. If your input or the results contain personal data, you are the controller and need your own legal basis. Articles about living people contain personal data.
- **No circumvention:** The Actor uses public, unauthenticated endpoints only. It does not bypass rate limits, blocks or access restrictions.
- **Request volume:** One request at a time with a short pause, up to 20 titles per request, `maxlag=5`, a User-Agent with a contact URL, exponential backoff on HTTP 429 and 5xx, Retry-After honoured, and it stops when Wikipedia stays unavailable. Do not use it to put excessive load on Wikimedia servers. For a full copy of Wikipedia, use the [Wikimedia dumps](https://dumps.wikimedia.org) instead.
- **Provider:** forgeloop, Markus Heiss, Austria. [Imprint](https://devhem.github.io/forgeloop-legal/imprint.html), [Privacy Notice](https://devhem.github.io/forgeloop-legal/privacy.html), [Terms of Use](https://devhem.github.io/forgeloop-legal/terms.html).

### Questions and issues

Open an issue on the Actor page.

# Actor input Schema

## `articles` (type: `array`):

Article titles like "Albert Einstein", or links like "https://de.wikipedia.org/wiki/Graz". A link sets the language itself, titles use the language below. Mobile links, index.php links and ?curid= page IDs work too. Duplicates are removed.

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

Optional. Full text search in the Wikipedia of the language below. The best matches are fetched as articles, up to Max articles. Works together with titles: titles come first.

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

Wikipedia language code for titles and the search, like en, de, fr, es, ja, zh or simple. Links always use the language of the link.

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

summary: the lead section as plain text. text: the full article as plain text, headings on their own line. sections: the full article as a list of sections with title, level and text. The summary is always included.

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

Add the visible categories of each article, without hidden maintenance categories.

## `includeWikidataId` (type: `boolean`):

Add the Wikidata item ID (like Q937) of each article, useful to link entities across languages and data sets.

## `pageviewsMonths` (type: `integer`):

Add the human pageviews of each article for the last N full months, 1 to 24. 0 means off. Costs one extra request per article, so runs take longer.

## `followRedirects` (type: `boolean`):

Return the target article when a title is a redirect, for example UK gives United Kingdom. The original title is kept in redirectedFrom.

## `maxArticles` (type: `integer`):

Stop after this many articles. Every article is one charged result, so this also caps the cost.

## Actor input object example

```json
{
  "articles": [
    "Albert Einstein",
    "https://de.wikipedia.org/wiki/Graz",
    "Retrieval-augmented generation"
  ],
  "language": "en",
  "content": "summary",
  "includeCategories": true,
  "includeWikidataId": true,
  "pageviewsMonths": 0,
  "followRedirects": true,
  "maxArticles": 50
}
```

# Actor output Schema

## `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 = {
    "articles": [
        "Albert Einstein",
        "https://de.wikipedia.org/wiki/Graz",
        "Retrieval-augmented generation"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("forgeloop/wikipedia-articles").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 = { "articles": [
        "Albert Einstein",
        "https://de.wikipedia.org/wiki/Graz",
        "Retrieval-augmented generation",
    ] }

# Run the Actor and wait for it to finish
run = client.actor("forgeloop/wikipedia-articles").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 '{
  "articles": [
    "Albert Einstein",
    "https://de.wikipedia.org/wiki/Graz",
    "Retrieval-augmented generation"
  ]
}' |
apify call forgeloop/wikipedia-articles --silent --output-dataset

```

## MCP server setup

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

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/h1It2RXFObyIleBPS/builds/7mIycjCGJASobmvzF/openapi.json
