# Wikipedia Scraper — Search, Articles & Categories (`felixgoldwin/wikipedia-articles-scraper`) Actor

Export Wikipedia article introductions and metadata from keyword searches, title lists or categories. Includes revision details, Wikidata IDs and source attribution in 20 languages.

- **URL**: https://apify.com/felixgoldwin/wikipedia-articles-scraper.md
- **Developed by:** [Felix GoldWin](https://apify.com/felixgoldwin) (community)
- **Categories:** Other
- **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

### What does Wikipedia Articles Scraper do?

Search [Wikipedia](https://www.wikipedia.org/) and export **article introductions, page metadata and source attribution** through Apify. Choose keyword search, a list of exact article titles, or the direct article members of a category. The Actor uses Wikimedia's public **MediaWiki Action API** and supports 20 Wikipedia language editions without an account or API key.

Each saved row represents one unique article. It includes the article title, URL, introduction, page and revision IDs, Wikidata ID when available, disambiguation status and license information. This is an introduction and metadata export: full article bodies, tables, images, references, pageviews and recursive category traversal are outside its scope.

### Why use this Wikipedia scraper?

- Build a source-linked topic or article directory from search results.
- Collect short introductions for research and content discovery workflows.
- Enrich known page titles with stable page IDs and Wikidata identifiers.
- Export the direct articles in a Wikipedia category without visiting each page.
- Repeat the same collection with Apify schedules, call it through the API, or connect it to downstream tools.

The Actor preserves source links, contributor-history links, provider information and a license notice on every row. It does not download media assets or collect editor profiles, email addresses or account information.

### How to scrape Wikipedia articles

1. Select **Keyword search**, **Exact page titles**, or **Category article members**.
2. Choose a language edition and fill the matching target field. Clear any nonempty target field belonging to another mode.
3. Set a result cap, a request cap and the maximum saved introduction length.
4. Start the Actor and review its coverage summary.
5. Download the dataset in **JSON, HTML, CSV or Excel**, or use the API tab for programmatic access.

Keyword-search example:

```json
{
  "mode": "search",
  "language": "en",
  "queries": ["artificial intelligence", "machine learning"],
  "includeDisambiguation": false,
  "introMaxChars": 12000,
  "maxItems": 1000,
  "maxRequests": 100
}
```

Exact-page example:

```json
{
  "mode": "pages",
  "language": "en",
  "titles": ["Software", "Free software"],
  "maxItems": 100
}
```

Category example:

```json
{
  "mode": "category",
  "language": "en",
  "categories": ["Machine learning"],
  "maxItems": 500
}
```

### Input options

See the Input tab for the complete form.

| Input | Default | Behavior |
| --- | --- | --- |
| `mode` | `search` | `search`, `pages` or `category`. |
| `language` | `en` | One of 20 supported Wikipedia editions. |
| `queries` | `artificial intelligence` when omitted in search mode | Up to 20 search queries, each at most 300 characters. Wikipedia search operators are preserved. |
| `titles` | None | Pages mode only: up to 100 exact page titles, each at most 255 characters. |
| `categories` | None | Category mode only: up to 20 category names, each at most 255 characters. The canonical `Category:` prefix is added when absent. |
| `includeDisambiguation` | `false` | Whether to include pages Wikipedia marks as disambiguation pages. |
| `introMaxChars` | `12000` | Saved introduction length cap, from 500 to 50,000 characters. Longer introductions set `introTruncated: true`. |
| `maxItems` | `1000` | Global saved-article cap, from 1 to 10,000. |
| `maxRequests` | `100` | Global Wikimedia HTTP request cap, from 1 to 200, including retries and redirects. |

Supported editions are **English, German, French, Spanish, Italian, Portuguese, Russian, Ukrainian, Polish, Dutch, Swedish, Japanese, Chinese, Korean, Arabic, Hindi, Turkish, Indonesian, Czech and Hebrew** (`en`, `de`, `fr`, `es`, `it`, `pt`, `ru`, `uk`, `pl`, `nl`, `sv`, `ja`, `zh`, `ko`, `ar`, `hi`, `tr`, `id`, `cs`, `he`).

Use names in the selected language edition. The Actor does not translate queries, titles or category names. For categories, supply the category's name with no namespace prefix, or use the canonical English `Category:` prefix accepted by MediaWiki. URLs are not accepted. Underscores in titles and categories become spaces. Duplicate inputs are removed, while source results are deduplicated by language and page ID.

Explicit empty target lists are rejected. The default query is used only when `queries` is omitted in Search mode; Pages and Category modes always require their own targets. Nonempty target lists for a different mode are rejected to avoid silently ignoring them.

### What data does the Actor return?

| Field | Description |
| --- | --- |
| `type` | Always `article`. |
| `pageId`, `title`, `language`, `url` | Article identity and source URL. |
| `introduction` | Plain-text introduction supplied by the API, or `null` when unavailable. |
| `introTruncated` | Whether this Actor shortened the available introduction to your requested character cap. |
| `wikidataId` | Linked Wikidata item identifier, such as `Q7397`, or `null`. |
| `revisionId`, `lastModified` | Latest revision ID and revision timestamp when returned by the API. |
| `isDisambiguation` | Whether Wikipedia marks the page as a disambiguation page. |
| `source`, `provider` | Wikipedia and Wikimedia Foundation. |
| `license`, `licenseUrl` | Text-content license notice and license URL. |
| `attribution`, `historyUrl` | Source/contributor attribution and a page-history link. |
| `scrapedAt` | Time the record was processed. |

Simplified metadata examples from Wikipedia are shown below. The actual dataset also includes introductions and the other fields above.

```json
[
  {
    "type": "article",
    "pageId": 5309,
    "title": "Software",
    "language": "en",
    "url": "https://en.wikipedia.org/wiki/Software",
    "wikidataId": "Q7397",
    "source": "Wikipedia",
    "provider": "Wikimedia Foundation",
    "license": "CC BY-SA 4.0"
  },
  {
    "type": "article",
    "pageId": 10635,
    "title": "Free software",
    "language": "en",
    "url": "https://en.wikipedia.org/wiki/Free_software",
    "wikidataId": "Q341",
    "source": "Wikipedia",
    "provider": "Wikimedia Foundation",
    "license": "CC BY-SA 4.0"
  }
]
```

An article may have an empty or unavailable introduction while still containing valid metadata. Such a saved article counts as one result. `introTruncated` describes this Actor's character limit; it does not mean the introduction is the full article.

### Pricing

**$1 per 1,000 saved articles, plus $0.005 per run start. Platform usage is included.** For example, 1,000 saved articles cost $1.005; 100 saved articles cost $0.105.

Only articles saved to the dataset count as results. Duplicate pages, excluded disambiguation pages, missing titles, errors and run summaries are not billed as results. A run with no saved articles still incurs the start fee. Use `maxItems` and Apify's maximum charge per run to control spending; allow at least $0.006 for one article plus the start fee.

### Coverage, pagination and limits

Search and category collection follow the API's continuation responses. There is **no fixed 500-article ceiling**, but `maxItems` is a maximum rather than a guarantee. The available source results, your targets, excluded pages, request cap and spending cap determine the final count.

The Actor fetches small batches of articles, and introduction enrichment may require additional continuation calls. A high result cap with a low request cap can therefore produce a partial export. Search results also remain subject to Wikipedia's own search limits. The Actor does not divide queries to bypass source limits.

Category mode includes only **direct article members** in the main article namespace. It does not follow subcategories or export category pages, files, talk pages or user pages. A missing or empty category can produce no articles. In Pages mode, Wikipedia redirects are resolved where the API supports them; missing, unavailable or non-article titles are reported or skipped rather than becoming result rows.

Targets are processed in input order, so an early search or category can fill the global result allowance. Results are not globally ranked across targets. New scheduled runs collect fresh snapshots; there is no cross-run “new articles only” database. A resumed run checks its existing dataset to avoid adding the same article again.

Requests identify this Actor to Wikimedia, run serially and use a conservative delay and `maxlag`. Access denials, rate limits or server-lag errors stop collection without proxy rotation or access bypass. Temporary network and server failures have bounded retries. Public API availability and content can change.

### Run summary and troubleshooting

Open **Coverage, limits and errors** in the run output to inspect the `SUMMARY` key-value-store record. It includes saved rows, source requests, restored rows, input duplicates, warnings, partial status and per-target coverage. Per-target details include pages fetched, saved articles, duplicates, filtered or malformed records, missing titles, a stop reason and any error.

A run can save useful articles while still being partial. Missing titles, malformed source records, incomplete continuation handling or request limits are surfaced in the summary. Valid searches with no matching articles can succeed with an empty dataset. If every source request fails without a usable target, the run fails. Review the summary before treating an export as complete.

#### Why are there fewer results than requested?

Your target may have fewer articles, some may be disambiguation pages or duplicates, a category may contain mostly subcategories, or a source/request/spending limit may have stopped collection. Check `SUMMARY`, increase a suitable budget, or narrow your targets.

#### Does it return full article text or pageviews?

No. This Actor exports introductions and article metadata. It does not promise full-text coverage, image rights, tables, references or pageview statistics.

#### Can I use and republish the introductions?

Wikipedia text is generally available under **Creative Commons Attribution-ShareAlike 4.0**, subject to the applicable page's terms and any additional attribution notices. Preserve the article URL, contributor attribution and license information when reusing it, and follow the applicable share-alike requirements for adaptations. The output records preserve these source references and indicate when an introduction was shortened. See the [Wikimedia Terms of Use, licensing section](https://foundation.wikimedia.org/wiki/Policy:Terms_of_Use#7._Licensing_of_Content) and [CC BY-SA 4.0](https://creativecommons.org/licenses/by-sa/4.0/).

#### Support and sources

Report reproducible problems through the Actor's **Issues** tab, with the input and run link. The **API** tab provides integration examples. Do not include credentials in issue reports.

This independent tool is not affiliated with or endorsed by Wikipedia or the Wikimedia Foundation. Source content may contain errors and changes over time. The Actor reads public article content and metadata; it does not access private accounts or editor contact information. Technical references: [MediaWiki Action API](https://www.mediawiki.org/wiki/API:Action_API), [search API](https://www.mediawiki.org/wiki/API:Search), and [API etiquette](https://www.mediawiki.org/wiki/API:Etiquette).

# Actor input Schema

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

Search by keyword, fetch exact page titles, or list direct article members of categories. Each mode uses only its matching target field.

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

Select the Wikipedia edition to search. Titles and categories must belong to this edition.

## `queries` (type: `array`):

Search mode only. Up to 20 queries of 300 characters. Supports Wikipedia search syntax. If omitted in search mode, artificial intelligence is used; an explicit empty list is rejected. Do not supply URLs.

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

Pages mode only. Up to 100 exact article titles, such as Python (programming language). Use names, not URLs; underscores become spaces.

## `categories` (type: `array`):

Category mode only. Up to 20 category names from the selected edition, with or without the canonical Category: prefix. Only direct article members are collected; subcategories are not followed.

## `includeDisambiguation` (type: `boolean`):

Save pages marked as disambiguation pages by Wikipedia. Otherwise they are skipped without a result charge.

## `introMaxChars` (type: `integer`):

Maximum saved characters in each article introduction. Longer introductions are truncated and marked introTruncated. This does not request full article text.

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

Global cap across all targets, after duplicates and excluded disambiguation pages. A ceiling, not a guaranteed count.

## `maxRequests` (type: `integer`):

Global cap on actual Wikimedia HTTP requests, including retries and redirects. Lower limits may leave a partial export.

## Actor input object example

```json
{
  "mode": "search",
  "language": "en",
  "queries": [
    "artificial intelligence"
  ],
  "titles": [],
  "categories": [],
  "includeDisambiguation": false,
  "introMaxChars": 12000,
  "maxItems": 1000,
  "maxRequests": 100
}
```

# Actor output Schema

## `articles` (type: `string`):

No description

## `summary` (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 = {
    "queries": [
        "artificial intelligence"
    ],
    "titles": [],
    "categories": []
};

// Run the Actor and wait for it to finish
const run = await client.actor("felixgoldwin/wikipedia-articles-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 = {
    "queries": ["artificial intelligence"],
    "titles": [],
    "categories": [],
}

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

```

## MCP server setup

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