# Wikipedia Scraper — Articles, Content & Pageviews (`hipersoft/wikipedia-scraper`) Actor

Search Wikipedia or look up exact articles and get the full plain-text content, summary, categories, image, Wikidata ID and monthly pageview trends. Any language. Great for research, RAG and AI datasets. No key.

- **URL**: https://apify.com/hipersoft/wikipedia-scraper.md
- **Developed by:** [hiper soft](https://apify.com/hipersoft) (community)
- **Categories:** AI, Developer tools
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $0.001 / article scraped

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/platform/actors/running/actors-in-store#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 — Full Article Text, Summaries & Pageviews, structured JSON, no API key

Search Wikipedia or look up exact article titles and get back clean, structured JSON — full plain-text article content, intro summary, categories, lead image, Wikidata ID and monthly pageview trends. Works in any language edition. **No account, no API key.** Perfect for research, building RAG and AI training datasets, content analysis and tracking topic popularity over time.

### Features

- 🔎 **Search + exact titles** — combine `searchTerms` (which pull matching articles) with exact `titles`; results are deduplicated by title.
- 🌍 **Any language** — set `language` to any Wikipedia edition code (`en`, `es`, `de`, `fr`, `ja`, …).
- 📄 **Full plain text** — toggle `fullText` for the complete article as clean plain text, or just the intro summary when off.
- 📈 **Pageview trends** — flip `includePageviews` to attach the last 6 months of monthly pageviews plus a `pageviewsTotal`.
- 🏷️ **Rich metadata** — visible categories, lead image URL, Wikidata ID, page ID, word count and last-modified timestamp on every record.
- ✂️ **Clean snippets** — search snippets are stripped of HTML and decoded from entities into readable text.
- 📊 **Scales per term** — take up to 500 articles from each search term with automatic pagination and retries.

### What you get

Each dataset row is one article:

```json
{
  "title": "Machine learning",
  "pageId": 233488,
  "url": "https://en.wikipedia.org/wiki/Machine_learning",
  "language": "en",
  "summary": "Machine learning (ML) is a field of study in artificial intelligence concerned with...",
  "text": "Machine learning (ML) is a field of study in artificial intelligence...\n\nHistory...",
  "wordCount": 9231,
  "categories": ["Machine learning", "Cybernetics", "Learning"],
  "imageUrl": "https://upload.wikimedia.org/wikipedia/commons/.../example.svg",
  "wikidataId": "Q2539",
  "lastModified": "2024-11-20T14:03:12Z",
  "searchSnippet": "Machine learning is a field of study in artificial intelligence...",
  "pageviews": [
    { "month": "202502", "views": 412034 },
    { "month": "202503", "views": 398115 }
  ],
  "pageviewsTotal": 2410882
}
```

### Input

```json
{
  "searchTerms": ["quantum computing", "climate change"],
  "titles": ["Alan Turing", "Python (programming language)"],
  "language": "en",
  "maxResultsPerSearch": 20,
  "fullText": true,
  "includePageviews": true
}
```

| Field | Description |
| --- | --- |
| `searchTerms` | Terms to search Wikipedia for; matching articles are scraped. |
| `titles` | Exact article titles to scrape, combined with any search results. |
| `language` | Wikipedia language edition code (e.g. `en`, `es`, `de`, `fr`, `ja`). |
| `maxResultsPerSearch` | How many articles to take from each search term (1–500). |
| `fullText` | Include the full plain-text article; if off, only the intro summary. |
| `includePageviews` | Attach the last 6 months of monthly pageviews per article. |

### Use cases

- Build clean, plain-text article corpora for RAG pipelines and AI training datasets.
- Track topic popularity over time using monthly pageview trends.
- Enrich entities with Wikidata IDs, categories and lead images.
- Compile multilingual reference content by running the same titles across language editions.

### Pricing

Pay-per-event: you're billed a small amount per run and per item scraped — you only pay for what you get. See the **Pricing** tab for current rates.

### FAQ

**Do I need a Wikipedia account or API key?**
No. The actor uses [Wikipedia](https://www.wikipedia.org/)'s public MediaWiki APIs and the Wikimedia pageviews API — no account, login or API key.

**How many articles can I scrape per run?**
Each search term can return up to 500 articles (`maxResultsPerSearch`), with automatic pagination and retries. You can also add any number of exact `titles`, and results are deduplicated by title.

**Can I scrape non-English Wikipedia?**
Yes. Set `language` to any Wikipedia edition code (`en`, `es`, `de`, `fr`, `ja`, …), and run the same titles across editions for multilingual corpora.

**What's the output format?**
Structured JSON — one record per article with `title`, `url`, `summary`, full plain-text `text`, `wordCount`, `categories`, `imageUrl`, `wikidataId` and optional monthly `pageviews`. Export as JSON, CSV, Excel or via the API.

**Can I get full article text and pageview trends?**
Yes. Toggle `fullText` for the complete cleaned plain text (or just the intro summary when off), and set `includePageviews` to attach the last 6 months of monthly pageviews plus a `pageviewsTotal`.

### Related Actors

Building research or RAG datasets? Combine this with our other reference and developer-data scrapers:

- [Stack Overflow & Stack Exchange Scraper](https://apify.com/hipersoft/stackexchange-scraper) — questions by tag or search across Stack Exchange sites.
- [Hacker News Scraper](https://apify.com/hipersoft/hacker-news-scraper) — stories, comments and Ask/Show HN by keyword and filters.
- [GitHub Scraper](https://apify.com/hipersoft/github-scraper) — repositories and user profiles with stars, topics, licenses and leads.
- [npm Package Scraper](https://apify.com/hipersoft/npm-scraper) — search and look up npm packages with metadata, dependencies and downloads.

### Notes

This Actor uses Wikipedia's public MediaWiki APIs and the Wikimedia pageviews API, returning that content as-is over openly available pages with no login required. Article text is available under Wikipedia's own licensing (typically CC BY-SA); check and comply with those terms for reuse. This is an independent tool and is not affiliated with, endorsed by, or sponsored by Wikipedia or the Wikimedia Foundation.

# Actor input Schema

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

Search Wikipedia for these terms and scrape the matching articles.

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

Scrape these exact article titles, e.g. "Albert Einstein". Combined with any search results.

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

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

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

How many articles to take from each search term.

## `fullText` (type: `boolean`):

Include the full plain-text article. If off, only the intro summary is returned.

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

Include the last 6 months of monthly pageviews for each article.

## Actor input object example

```json
{
  "searchTerms": [
    "quantum computing",
    "climate change"
  ],
  "titles": [
    "Alan Turing",
    "Python (programming language)"
  ],
  "language": "en",
  "maxResultsPerSearch": 20,
  "fullText": true,
  "includePageviews": true
}
```

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

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

# Run the Actor and wait for it to finish
run = client.actor("hipersoft/wikipedia-scraper").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print("💾 Check your data here: https://console.apify.com/storage/datasets/" + run["defaultDatasetId"])
for item in client.dataset(run["defaultDatasetId"]).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{
  "searchTerms": [
    "machine learning"
  ]
}' |
apify call hipersoft/wikipedia-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "command": "npx",
            "args": [
                "mcp-remote",
                "https://mcp.apify.com/?tools=hipersoft/wikipedia-scraper",
                "--header",
                "Authorization: Bearer <YOUR_API_TOKEN>"
            ]
        }
    }
}

```

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/UNAe7EkLUJqg8ghEF/builds/c0WGVE0jV72W8gkRy/openapi.json
