# Wikipedia Scraper: Articles, Full Text, Wikidata & Pageviews (`actor-forge/wikipedia-scraper`) Actor

Wikipedia articles in any language via the official MediaWiki API: intro or full plain text, short description, Wikidata ID, coordinates, image, categories, last edit and 30-day pageviews. Titles, URLs or search. CC BY-SA attribution included. $0.60 per 1,000 articles.

- **URL**: https://apify.com/actor-forge/wikipedia-scraper.md
- **Developed by:** [ActorForge](https://apify.com/actor-forge) (community)
- **Categories:** Developer tools, News
- **Features:** Limited permissions
- **Stats:** 3 total users, 2 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $0.60 / 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 Scraper: Articles, Full Text, Wikidata & Pageviews

Wikipedia articles in any language via the official MediaWiki API: intro or full plain text, short description, Wikidata ID, coordinates, image, categories, last edit and 30-day pageviews. Titles, URLs or search. CC BY-SA attribution included. $0.60 per 1,000 articles.

**Wikipedia data through Wikipedia's own API, in any language.** Give it **article titles, Wikipedia URLs or search terms** and get one clean row per article: **title, link, short description, the intro as plain text** (or the **full article text** with word count), **Wikidata ID**, **coordinates** for places, lead image, **categories**, last edit time and revision, page size, a disambiguation flag, the redirect it came from, and optionally **pageviews over the last 30 days**. Every row carries the **CC BY-SA 4.0 licence and a ready-made attribution line**. Use it for **knowledge bases and RAG/LLM datasets**, entity enrichment and linking (via Wikidata IDs), SEO and content research, popularity tracking with pageviews, and education projects. **$0.60 per 1,000 articles**, with no compute bill on top; problems return a free status row instead of failing.

### What data does it return?

Every run outputs clean, schema-validated rows like these:

| title | description | wikidataId | wordCount | pageviews30d |
| --- | --- | --- | --- | --- |
| Paris | Capital and largest city of France | Q90 | 13869 | 166695 |
| Eiffel Tower |  | Q243 | 7518 | 134481 |
| Web scraping |  |  | 3134 | 69761 |

### How much does it cost?

Transparent pay-per-event pricing — you only pay for what you get, and the
actor **always respects your run budget**: set a maximum total charge and it
stops cleanly at the cap instead of overrunning.

| Event | Price | Charged | Worked example |
| --- | --- | --- | --- |
| `article` | $0.0006 | per article row | 1,000 articles = $0.60 (full text and pageviews included when turned on) |
| `apify-actor-start` | $0.00005 | per run per GB of memory (platform start fee) | One run at 256 MB = $0.00005 |

### Input options

| Field | Type | Required | Default | Description |
| --- | --- | --- | --- | --- |
| `articles` | array | no | — | Article titles (Paris, Web scraping) or Wikipedia URLs in any language (https://fr.wikipedia.org/wiki/Tour_Eiffel). Redirects are followed. |
| `searchTerms` | array | no | — | Optional: full-text search terms; the matching articles are returned in Wikipedia's relevance order. |
| `maxResultsPerSearch` | integer | no | `10` | How many articles to take from each search. |
| `language` | string | no | `"en"` | Wikipedia language code for titles and search: en, de, fr, es, it, ja, zh, ru, pt, ar, simple... (URLs keep their own language). |
| `includeFullText` | boolean | no | `false` | Add the whole article as plain text, with word count (one extra request per article). Otherwise you get the intro section. |
| `includeCategories` | boolean | no | `true` | Add the visible categories of each article. |
| `includePageviews` | boolean | no | `false` | Add the number of human pageviews over the last 30 days (Wikimedia pageviews API, one extra request per article). |
| `skipDisambiguation` | boolean | no | `false` | Leave out "may refer to" pages. |
| `maxItems` | integer | no | `500` | Upper limit on articles for the whole run. |

### Limits & honest notes

- **Attribution and licence:** Wikipedia text is available under the Creative Commons Attribution-ShareAlike 4.0 licence (CC BY-SA 4.0). If you republish it, credit Wikipedia and link the article (each row has an `attribution` line and the `url`), and share adaptations under the same licence. Images have their own licences on Wikimedia Commons. This actor is not affiliated with, endorsed by or sponsored by the Wikimedia Foundation.
- **Responsible use:** it uses only the official MediaWiki Action API and the Wikimedia pageviews API, following Wikimedia's API etiquette: an identifying user agent with a contact URL (ActorForge-Wikipedia), one request at a time with at least 0.5 s between requests, batches of 20 titles, and maxlag=5 (it pauses when Wikimedia's servers are busy). There is no page scraping, no login and no proxies.
- Biographies of living people are returned as Wikipedia publishes them; follow data-protection law if you combine them with other personal data.
- If Wikimedia refuses a request or rate-limits the run, the run stops, keeps the articles already delivered and adds a free status row. Respects your run budget: set a maximum total charge and the run stops cleanly at the cap. Missing articles return a free status row.

### Related ActorForge actors

- [Website to Markdown](https://apify.com/actor-forge/website-to-markdown) — clean text from any other site
- [Google Trends](https://apify.com/actor-forge/google-trends) — search interest next to Wikipedia pageviews

### Changelog

- **2026-10-23** — Initial release: titles, URLs and search in any language; intro or full text, description, Wikidata ID, coordinates, image, categories, last edit, redirects, disambiguation flag, 30-day pageviews, CC BY-SA attribution; free status rows.

***

*Built and maintained by **ActorForge**. Reliability first: every actor in the
portfolio is monitored by an automated nightly self-test, and breakages are
typically fixed the same day.*

# Actor input Schema

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

Article titles (Paris, Web scraping) or Wikipedia URLs in any language (https://fr.wikipedia.org/wiki/Tour_Eiffel). Redirects are followed.

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

Optional: full-text search terms; the matching articles are returned in Wikipedia's relevance order.

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

How many articles to take from each search.

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

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

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

Add the whole article as plain text, with word count (one extra request per article). Otherwise you get the intro section.

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

Add the visible categories of each article.

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

Add the number of human pageviews over the last 30 days (Wikimedia pageviews API, one extra request per article).

## `skipDisambiguation` (type: `boolean`):

Leave out "may refer to" pages.

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

Upper limit on articles for the whole run.

## Actor input object example

```json
{
  "articles": [
    "Web scraping",
    "Paris"
  ],
  "maxResultsPerSearch": 10,
  "language": "en",
  "includeFullText": false,
  "includeCategories": true,
  "includePageviews": false,
  "skipDisambiguation": false,
  "maxItems": 500
}
```

# Actor output Schema

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

One row per article: title, link, description, intro or full text, Wikidata ID, coordinates, image, categories, last edit, pageviews and attribution.

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

Rows delivered, requests made, whether the source refused a request, and billing.

# 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": [
        "Web scraping",
        "Paris"
    ]
};

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

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

```

## MCP server setup

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