# Wikipedia Scraper — Articles, Summaries & Pageview Trends (`eins332570/wikipedia-scraper`) Actor

Scrape Wikipedia — article summaries, extracts, thumbnails & monthly pageview trends — via official Wikimedia APIs. Search by keyword or fetch exact titles, any language. Great for research, content pipelines & trending-topic analysis. No login, no key, no proxy.

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

## Pricing

from $5.00 / 1,000 results

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?

Actors are web data automations that power AI and operations. They run on the Apify platform to scrape websites, process data, connect APIs, and automate workflows.
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.
Actors are written with capital "A".

## 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.
The best way to integrate Actors is as follows.

- **AI agents and MCP clients** — the [Apify MCP server](https://docs.apify.com/integrations/mcp.md) at `https://mcp.apify.com` (remote, streamable HTTP, OAuth on first use).
- **Agentic workflows and local Actor development** — [Agent Skills](https://apify.com/.well-known/agent-skills/index.json) with the [Apify CLI](https://docs.apify.com/cli/docs.md): `npm install -g apify-cli`, then `apify login`.
- **JavaScript/TypeScript projects** — the official [JS/TS client](https://docs.apify.com/api/client/js/docs.md): `npm install apify-client`.
- **Python projects** — the official [Python client](https://docs.apify.com/api/client/python/docs.md): `pip install apify-client`.
- **Any other language** — the [REST API](https://docs.apify.com/api/v2.md).

For usage examples, see the [API](#api) section below.

For more details, see Apify documentation as [Markdown index](https://docs.apify.com/llms.txt) and [Markdown full-text](https://docs.apify.com/llms-full.txt).

# README

## Wikipedia Scraper — Articles, Summaries & Pageview Trends

Scrape **Wikipedia** article data — summaries, descriptions, extracts, thumbnails, coordinates, and **monthly pageview trends** — into **one unified dataset** using the official **Wikimedia APIs**. No login, no proxies, no browser. Just clean, structured knowledge data.

Search by keyword or fetch exact page titles, in any language edition. Turn on pageviews to see **which topics are trending**.

### What you get

Every article is returned as one row (`recordType: "article"`):

| Field | Description |
|---|---|
| `pageId` | Wikipedia page ID |
| `title` | article title |
| `description` | short one-line description |
| `extract` | plain-text summary (intro paragraph) |
| `type` | page type (standard / disambiguation, etc.) |
| `lang` | language edition |
| `url` | link to the article |
| `thumbnail` | lead image (when available) |
| `latitude` / `longitude` | coordinates (for places) |
| `timestamp` | ISO time of the last revision |
| `pageviewsTotal` | total views over the window (when **Include pageview trends** is on) |
| `pageviews` | per-month `{ timestamp, views }` breakdown |

### Input

```json
{
  "search": ["machine learning"],
  "titles": ["Alan Turing"],
  "lang": "en",
  "searchLimit": 10,
  "includePageviews": false,
  "pageviewsMonths": 3
}
```

- **search** — keywords to search Wikipedia.
- **titles** — exact page titles to fetch directly.
- **lang** — language edition (e.g. `en`, `de`, `fr`, `ja`).
- **searchLimit** — max articles per search query (1–50).
- **includePageviews** — also fetch monthly pageviews per article.
- **pageviewsMonths** — how many recent months of pageviews (1–24).

Provide at least one of `search` or `titles`. Articles are de-duplicated by their canonical title (so aliases that redirect to the same page — e.g. "USA" and "United States" — return one row).

### Sample output

One dataset row (an article, run with `includePageviews` on):

```json
{
  "recordType": "article",
  "pageId": "1164",
  "title": "Artificial intelligence",
  "description": "Intelligence of machines",
  "extract": "Artificial intelligence (AI) is the capability of computational systems to perform tasks typically associated with human intelligence, such as learning, reasoning, problem-solving, perception, and decision-making…",
  "type": "standard",
  "lang": "en",
  "url": "https://en.wikipedia.org/wiki/Artificial_intelligence",
  "thumbnail": null,
  "latitude": null,
  "longitude": null,
  "timestamp": "2026-08-21T23:01:29.000Z",
  "pageviewsTotal": 2518174,
  "pageviews": [
    { "timestamp": "2026050100", "views": 938727 },
    { "timestamp": "2026060100", "views": 871873 },
    { "timestamp": "2026070100", "views": 707574 }
  ]
}
```

*(`thumbnail` and `latitude`/`longitude` are populated for pages that have a lead image or coordinates — e.g. places and landmarks. Pageviews cover the most recent **complete** months only.)*

### Why it's reliable & cheap

Every request hits the **official public Wikimedia APIs** (REST summary, Action API search, Pageviews metrics) — no headless browser, no anti-bot walls, no API key. Transient errors (rate limits, 5xx, network blips) are retried automatically, and an unreachable or unknown page is reported and skipped — one bad source never fails the whole run.

### Use cases

- **Trending-topic analysis** — rank topics by monthly pageviews
- **Research & knowledge bases** — pull structured summaries at scale
- **Content pipelines** — enrich articles, feed an AI summarizer or RAG index
- **Geo datasets** — collect coordinates for places and landmarks

Content from Wikipedia, available under [CC BY-SA](https://creativecommons.org/licenses/by-sa/4.0/) via the [Wikimedia APIs](https://www.mediawiki.org/wiki/API:REST_API).

### FAQ

**Do I need an API key or login?** No. It uses the official public Wikimedia APIs — no key, no account, no proxy.

**Is it free to try?** Yes — click **Try for free** and run the prefilled search (`machine learning`) in seconds.

**What are pageview trends?** Turn on **Include pageviews** to get each article's monthly reader counts — perfect for spotting trending topics.

**Can I use other languages?** Yes — set `lang` (e.g. `de`, `fr`, `ja`) to query any Wikipedia edition.

**Is this allowed?** Wikimedia offers these public APIs for reuse; content is CC BY-SA (attribution included in the output docs).

### Pricing

**Pay per result — $5 per 1,000 articles.** Runs that return nothing cost nothing. No monthly fee, no proxy costs.

# Actor input Schema

## `search` (type: `array`):

Search Wikipedia by keyword. Each query returns up to `searchLimit` matching articles. Example: \["machine learning", "quantum computing"].

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

Fetch specific Wikipedia pages by their exact title, e.g. "Alan Turing".

## `lang` (type: `string`):

Wikipedia language edition to query (e.g. en, de, fr, es, ja).

## `searchLimit` (type: `integer`):

Cap the number of articles returned per search query (1–50).

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

Also fetch each article's monthly pageviews (how many people read it) — great for spotting trending topics.

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

How many recent months of pageviews to fetch when 'Include pageview trends' is on (1–24).

## Actor input object example

```json
{
  "search": [
    "machine learning"
  ],
  "lang": "en",
  "searchLimit": 10,
  "includePageviews": false,
  "pageviewsMonths": 3
}
```

# Actor output Schema

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

All scraped article records as dataset items.

# 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 = {
    "search": [
        "machine learning"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("eins332570/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 = { "search": ["machine learning"] }

# Run the Actor and wait for it to finish
run = client.actor("eins332570/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 '{
  "search": [
    "machine learning"
  ]
}' |
apify call eins332570/wikipedia-scraper --silent --output-dataset

```

## MCP server setup

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