# Wikipedia Scraper (`gogumaa/wikipedia-scraper`) Actor

Wikipedia articles by search or title in any language: summary, optional full plain text, thumbnail, coordinates, Wikidata ID and 30-day pageviews. Official Wikimedia APIs, no login, no browser.

- **URL**: https://apify.com/gogumaa/wikipedia-scraper.md
- **Developed by:** [gogumaa](https://apify.com/gogumaa) (community)
- **Categories:** Education, News, Other
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

$2.00 / 1,000 page scrapeds

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

**Wikipedia scraper for articles as clean JSON, no login or API key.** Search Wikipedia in any language or pass article titles / URLs, and get the summary, optional full plain text, thumbnail, coordinates, Wikidata ID and 30-day pageviews per page. It uses the official Wikimedia APIs, so runs are fast and you pay per result.

### What you can do with it

- **Knowledge-base / RAG ingestion** — `includeFullText: true` returns the whole article as plain text, ready to chunk and embed.
- **Entity enrichment** — look up company, person or place names and join on `wikidata_id`, `description` and `coordinates`.
- **Trend and attention tracking** — `pageviews_30d` shows how much interest a topic gets; schedule it to watch topics rise and fall.
- **Topic discovery** — `search` mode turns a keyword into up to hundreds of related articles with summaries.
- **Automation** — Schedule it on Apify and pipe results to Google Sheets, Slack, n8n or Make via the Apify integration.
- **Multilingual coverage checks** — run the same `titles` with different `language` codes to see which language editions have an article and how much traffic each gets.

### Output example

```json
{
  "type": "page",
  "language": "en",
  "title": "Rust (programming language)",
  "pageid": 29414838,
  "url": "https://en.wikipedia.org/wiki/Rust_(programming_language)",
  "description": "General-purpose programming language",
  "extract": "Rust is a general-purpose programming language emphasizing performance, type safety, and concurrency …",
  "thumbnail": "https://upload.wikimedia.org/wikipedia/commons/thumb/…/Rust_programming_language_black_logo.svg.png",
  "last_modified": "2026-10-28T09:14:02Z",
  "coordinates": null,
  "wikidata_id": "Q575650",
  "pageviews_30d": 152340
}
```

`full_text` is added when `includeFullText` is on. `coordinates` is `{ "lat": 48.85, "lon": 2.35 }` for places.

### Input

| Field | Description |
|---|---|
| `language` | Wikipedia language code (`en`, `de`, `ja` …). Default `en`. |
| `mode` | `search` (default) or `pages` |
| `query` | Mode `search`. Full-text search; results in relevance order, paged as far as `maxItems` needs. |
| `titles` | Mode `pages`. Article titles or full Wikipedia URLs (a URL's language overrides `language`). Redirects are followed. |
| `includeFullText` | Add `full_text` (plain text). Default off. |
| `includePageviews` | Add `pageviews_30d` (last 30 days, all platforms, humans and bots). Default on. |
| `maxItems` | Stop after N pages. Default 100. |

### Pricing

Pay per item: one event per page record. Nothing is charged for pages that are not found.

### Notes

- Unknown titles produce a warning in the log and no row.
- Pages with no pageview data (very new or unviewed) get `pageviews_30d: 0`.
- Search hits that are disambiguation pages are returned as-is (`description: "Topics referred to by the same term"`).

### FAQ

#### Do I need an API key or account?

No. Wikimedia's APIs are open but require an identifying User-Agent; the Actor sends one for you. Wikimedia asks clients to keep request rates reasonable, and the Actor fetches sequentially to stay polite.

#### How much does it cost?

$0.002 per result and nothing else: with pay-per-event pricing you are not billed for Apify compute. 100 results cost $0.20, and the Apify free plan's $5 monthly credit covers about 2,500 results. Rows that are never produced are never charged.

#### How do I get the data into Google Sheets / my app?

Every run writes to an Apify dataset you can download as CSV, JSON or Excel, or read from the dataset API endpoint. For ongoing feeds, use Apify integrations (Google Sheets, Slack, Zapier, Make, n8n) or call the Actor from your own code with the Apify API.

#### Is it legal / allowed?

It only reads public data via the platform's public API and respects rate limits. You are responsible for complying with Wikipedia's terms and applicable law.

#### What exactly is `pageviews_30d`?

The sum of daily pageviews over the 30 days ending yesterday, across all platforms, from the Wikimedia Pageviews API. Pages with no data (very new or unviewed) get `0`. Turn it off with `includePageviews: false` to save one request per page.

### Related Actors

- [Hacker News Scraper](https://apify.com/gogumaa/hacker-news-scraper)
- [Hugging Face Hub Scraper](https://apify.com/gogumaa/huggingface-hub-scraper)
- [Substack Posts Scraper](https://apify.com/gogumaa/substack-posts-scraper)

# Actor input Schema

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

Wikipedia language code: en, de, fr, ja, es … Page URLs in Titles override this per page.

## `mode` (type: `string`):

search = full-text search, then one record per hit. pages = fetch the given titles / URLs.

## `query` (type: `string`):

Mode=search.

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

Mode=pages. Article titles or full Wikipedia URLs.

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

Add full_text: the whole article as plain text (one extra request per page).

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

Add pageviews_30d: total views over the last 30 days (one extra request per page).

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

Stop after this many pages.

## Actor input object example

```json
{
  "language": "en",
  "mode": "search",
  "query": "rust programming language",
  "titles": [
    "Rust (programming language)",
    "https://en.wikipedia.org/wiki/Python_(programming_language)"
  ],
  "includeFullText": false,
  "includePageviews": true,
  "maxItems": 100
}
```

# Actor output Schema

## `items` (type: `string`):

One record per page: title, summary, optional full text, thumbnail, coordinates, Wikidata ID, 30-day pageviews.

# 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": [
        "Rust (programming language)",
        "https://en.wikipedia.org/wiki/Python_(programming_language)"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("gogumaa/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 = { "titles": [
        "Rust (programming language)",
        "https://en.wikipedia.org/wiki/Python_(programming_language)",
    ] }

# Run the Actor and wait for it to finish
run = client.actor("gogumaa/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 '{
  "titles": [
    "Rust (programming language)",
    "https://en.wikipedia.org/wiki/Python_(programming_language)"
  ]
}' |
apify call gogumaa/wikipedia-scraper --silent --output-dataset

```

## MCP server setup

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