# Wikipedia Scraper – Articles, Wikidata & Pageviews (`justaduck/wikipedia-wikidata-scraper`) Actor

Fetch Wikipedia articles in any language by title, URL, search or category. Get summary, categories, image, coordinates and last edit, plus optional full text, Wikidata facts and 30-day pageviews. Uses the official Wikimedia APIs; no HTML pages are scraped.

- **URL**: https://apify.com/justaduck/wikipedia-wikidata-scraper.md
- **Developed by:** [Justaduck](https://apify.com/justaduck) (community)
- **Categories:** AI, Education, Developer tools
- **Features:** Limited permissions
- **Stats:** 1 total users, 0 monthly users, 0.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $0.70 / 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.
Since this Actor supports Apify Store discounts, the price gets lower the higher subscription plan you have.

Learn more: https://docs.apify.com/actors/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, Wikidata & Pageviews

**Wikipedia scraper for articles in any language: get them by title, URL, keyword search or category, with optional Wikidata facts and pageviews.**

- **What you get:** one row per article with `title`, `description`, `extract` (intro summary), `categories`, `imageUrl`, `latitude` / `longitude`, `lastEditedAt` and `sourceUrl`; optionally `fullText`, Wikidata properties (`wikidataProperties`) and 30-day pageviews (`pageviews30d`).
- **What it costs:** US$1.00 per 1,000 articles plus US$0.0005 per run start; full text, Wikidata and pageviews do not cost extra. Apify's free plan (US$5 of usage a month) covers about 5,000 articles. That is the price on Apify's Free plan; on paid Apify plans it goes down to US$0.70 per 1,000 articles, the "from" price on the Store page.
- **Try it:** Click **Start** on the prefilled form: it returns 3 articles (Ada Lovelace, Tokyo, Python) for US$0.00305 in a few seconds.

Get **Wikipedia articles in any language** by exact title, article URL, keyword search or category, and export clean JSON, CSV or Excel: the intro summary, optional full article text, categories, main image, coordinates, last edit, the linked **Wikidata** item with any properties you choose (population, inception date, country, official website…), and optional **30-day pageviews**.

All data comes from the **official Wikimedia APIs** run by the Wikimedia Foundation: the MediaWiki Action API of each Wikipedia (`https://<language>.wikipedia.org/w/api.php`), the Wikidata API (`https://www.wikidata.org/w/api.php`, `wbgetentities`) and the Wikimedia Pageviews API (`https://wikimedia.org/api/rest_v1/metrics/pageviews`). No HTML pages are scraped. This Actor is not affiliated with or endorsed by the Wikimedia Foundation, and it does not offer or guarantee access to Wikimedia's APIs; it is a client that calls them politely on your behalf.

### What you can do with it

- Build a dataset of articles for research, RAG or LLM pipelines: summaries or full plain text, with the licence and source link on every row.
- Enrich a list of entities (companies, cities, people, products) with Wikipedia summaries and Wikidata facts in one run.
- Pull every article in a category, optionally including subcategories.
- Rank topics by interest with 30-day human pageviews.
- Run it on a schedule and compare `lastRevisionId` (per `language` + `pageId`) with your previous results to see which articles were edited.

### How to use the Wikipedia scraper

1. Open [this Actor on Apify Store](https://apify.com/justaduck/wikipedia-wikidata-scraper) and try it in Apify Console. A free Apify account is enough; no credit card is needed.
2. The input form is prefilled with a small example: it returns 3 articles: Ada Lovelace, Tokyo and Python (programming language). Click **Start** to try it; it finishes in a few seconds.
3. Give **Article titles**, **Article URLs**, **Search keywords** or **Categories** (any mix), pick the **Language**, and turn on **Include Wikidata label, description and aliases**, **Include 30-day pageviews** or **Include full article text** if you need them. Set **Max items** to cap the run and its cost.
4. Click **Start** and open the **Output** tab when the run finishes. Preview the articles as a table, or export them as JSON, CSV or Excel.
5. To automate it, save the input as a task and **schedule** it, call the Actor through the **Apify API**, or send the results to Make, Zapier, n8n, Slack or a webhook with Apify **integrations**.

### Input

Give any mix of these four (at least one):

| Field | What it does |
|---|---|
| `titles` | Exact article titles, e.g. `Ada Lovelace`. Uses `language`. Redirects, capitalisation and Chinese traditional/simplified variants are resolved automatically. |
| `urls` | Article URLs in any language: `https://de.wikipedia.org/wiki/Berlin`, mobile `https://en.m.wikipedia.org/wiki/…`, `https://en.wikipedia.org/w/index.php?title=…`, `https://en.wikipedia.org/?curid=8091`, `https://zh.wikipedia.org/zh-tw/…`. The language comes from the URL; `#section` parts are ignored. |
| `searchQueries` | Keywords. Each keyword returns up to `maxResultsPerSearch` articles (default 100, max 10,000) in Wikipedia's own relevance order. |
| `categories` | Category names with or without `Category:` (local prefixes like `Kategorie:` also work). `categoryDepth` 0–5 (default 0 = direct members only). |

Options:

| Field | Default | What it does |
|---|---|---|
| `language` | `en` | Wikipedia language code for titles, searches and categories (`en`, `de`, `fr`, `ja`, `zh`, `simple`, …). |
| `includeFullText` | `false` | Adds `fullText`: the whole article as plain text, section headings kept as `== Heading ==`. One extra request per returned article. |
| `includeWikidata` | `false` | Adds the Wikidata label, description and aliases in the article's language. |
| `wikidataProperties` | – | Wikidata property IDs to return, e.g. `["P31", "P17", "P1082", "P571", "P856"]`. Turns on Wikidata automatically. |
| `includePageviews` | `false` | Adds `pageviews30d`: views by people (not bots or spiders) on all platforms over the last 30 full days (UTC). One extra request per returned article. |
| `maxItems` | `1000` | Maximum number of articles returned in total. |

Example:

```json
{
    "titles": ["Tokyo", "Douglas Adams", "Python (programming language)"],
    "searchQueries": ["quantum entanglement"],
    "maxResultsPerSearch": 20,
    "categories": ["Moons of Mars"],
    "categoryDepth": 1,
    "wikidataProperties": ["P31", "P17", "P1082", "P571", "P2046"],
    "includePageviews": true
}
```

#### Special cases

- **Redirects** (e.g. `UK`): you get the target article (`United Kingdom`) and `redirectedFrom` shows the redirect title. If a redirect points to an article already returned, it is returned once.
- **Disambiguation pages** (e.g. `Mercury`): returned like any article with `isDisambiguation: true`, so you can filter them. The Actor never guesses which meaning you wanted.
- **Only articles are returned.** Special pages (`Special:Random`, `Special:Search?…` URLs, `Media:`), pages in other namespaces (`Talk:`, `User:`, `Category:`, `Wikipedia:`, `Template:`, `File:`…) and `?curid=` IDs that do not exist are skipped with the reason.
- **Prefixes for another wiki** (`fr:Paris`, `de:Berlin`, `wikt:dog`) are not followed. The input is skipped and the log tells you the right way: give the URL (`https://fr.wikipedia.org/wiki/Paris`) or set `language` to `fr` and give `Paris`.
- **Language codes and URLs that are not a Wikipedia language edition** (`www`, `meta`, `commons`, `species`, made-up codes): checked against Wikimedia's official list of Wikipedias before anything is requested; that input is skipped with the reason. If Wikimedia ever redirects a request to a host outside its official APIs, only that input fails.
- **Titles that do not exist, invalid titles, categories that do not exist** (and have no members): that input is skipped and the reason is written to the run log and the `SUMMARY` record; everything else still runs. The run fails only if every input fails.
- **The same article from several inputs** (title, URL, search, category): returned once, for the first input that found it.
- **Search results**: up to 500 results per keyword are fetched in a single request, in Wikipedia's order. Above 500 the Actor has to page, and Wikipedia's ranking can shift between pages, so a few articles may repeat (repeats are dropped) or be missed. Wikipedia's search itself is not fully deterministic: the same keyword can return a slightly different set or order from one run to the next.

### Output

One row per article. Real example (`titles: ["Tokyo"]` with Wikidata properties; Wikidata values as of 2026-12-01; long values and lists shortened, `P31` shows 2 of its values):

```json
{
  "language": "en",
  "pageId": 30057,
  "title": "Tokyo",
  "sourceUrl": "https://en.wikipedia.org/wiki/Tokyo",
  "extract": "Tokyo, officially the Tokyo Metropolis, is the capital and most populous city of Japan. …",
  "fullText": null,
  "description": "Capital and most populous city of Japan",
  "categories": ["1450s establishments in Japan", "1457 establishments in Asia", "Capital cities in Asia", "Kantō region"],
  "isDisambiguation": false,
  "lastRevisionId": 1386294178,
  "lastEditedAt": "2026-11-17T19:49:00.000Z",
  "sizeBytes": 225530,
  "wordCount": null,
  "imageUrl": "https://upload.wikimedia.org/wikipedia/commons/b/b2/Skyscrapers_of_Shinjuku_2009_January.jpg?utm_source=en.wikipedia.org&utm_campaign=api&utm_content=original",
  "latitude": 35.68972222,
  "longitude": 139.69222222,
  "wikidataId": "Q1490",
  "wikidataLabel": "Tokyo",
  "wikidataDescription": "capital and largest city of Japan",
  "wikidataAliases": ["Tôkyô", "Tokyo-to", "Tokyo Metropolitan prefecture"],
  "wikidataProperties": {
    "P31": [
      { "rank": "normal", "datatype": "wikibase-item", "value": "Q124313007", "label": "metropolitan prefecture" },
      { "rank": "normal", "datatype": "wikibase-item", "value": "Q1025961", "label": "capital of Japan" }
    ],
    "P17": [{ "rank": "normal", "datatype": "wikibase-item", "value": "Q17", "label": "Japan" }],
    "P1082": [
      { "rank": "normal", "datatype": "quantity", "value": 14047594, "unit": null, "unitLabel": null },
      { "rank": "normal", "datatype": "quantity", "value": 13159388, "unit": null, "unitLabel": null },
      { "rank": "normal", "datatype": "quantity", "value": 12576611, "unit": null, "unitLabel": null },
      { "rank": "normal", "datatype": "quantity", "value": 13513734, "unit": null, "unitLabel": null },
      { "rank": "preferred", "datatype": "quantity", "value": 14264798, "unit": null, "unitLabel": null }
    ],
    "P571": [{ "rank": "normal", "datatype": "time", "value": "1868-09-06", "precision": 11, "calendar": "gregorian" }],
    "P2046": [{ "rank": "normal", "datatype": "quantity", "value": 2194.05, "unit": "Q712226", "unitLabel": "square kilometre" }]
  },
  "pageviews30d": null,
  "pageviewsStart": null,
  "pageviewsEnd": null,
  "inputType": "title",
  "input": "Tokyo",
  "redirectedFrom": null,
  "searchRank": null,
  "foundInCategory": null,
  "categoryDepth": null,
  "license": "Creative Commons Attribution-Share Alike 4.0",
  "licenseUrl": "https://creativecommons.org/licenses/by-sa/4.0/deed.en",
  "attribution": "\"Tokyo\" from Wikipedia (en), by Wikipedia contributors. Source: https://en.wikipedia.org/wiki/Tokyo. Licensed under Creative Commons Attribution-Share Alike 4.0 (https://creativecommons.org/licenses/by-sa/4.0/deed.en). Converted to plain text."
}
```

A property can have several values, and all values that are not deprecated are returned, in Wikidata's order. Population (`P1082`) is the usual case: Tokyo has five values, each for a different year. The year of each value (Wikidata's "point in time" qualifier) is not returned, so use the value with `rank: "preferred"` when there is one; when no value is preferred, the latest one cannot be picked from the output alone.

#### Fields

Values come straight from the official responses. When Wikimedia has no value, the field is `null` (never guessed).

| Field | Type | Description |
|---|---|---|
| `language` | string | Wikipedia language code of the article. |
| `pageId` | integer | Wikipedia page ID (unique within one language). |
| `title` | string | Official article title (after redirects). |
| `sourceUrl` | string | Link to the article on Wikipedia. |
| `extract` | string | null | Intro section as plain text (TextExtracts). `null` if the article has no intro text. |
| `fullText` | string | null | Whole article as plain text; only with `includeFullText`. |
| `description` | string | null | Short description shown by Wikipedia. |
| `categories` | string\[] | Visible categories, without the `Category:` prefix. Hidden maintenance categories are left out. |
| `isDisambiguation` | boolean | `true` for disambiguation pages. |
| `lastRevisionId` | integer | ID of the latest revision. |
| `lastEditedAt` | string | Time of the latest revision (ISO 8601, UTC). |
| `sizeBytes` | integer | Size of the article's wikitext in bytes. |
| `wordCount` | integer | null | Word count from Wikipedia search; only for search results. |
| `imageUrl` | string | null | Main image of the article (original file URL). |
| `latitude`, `longitude` | number | null | Primary coordinates of the article, if it has any. |
| `wikidataId` | string | null | Linked Wikidata item ID (e.g. `Q1490`). |
| `wikidataLabel`, `wikidataDescription` | string | null | Wikidata label and description in the article's language (with Wikidata's language fallback); only with `includeWikidata` or `wikidataProperties`. |
| `wikidataAliases` | string\[] | null | Wikidata aliases in the article's language. |
| `wikidataProperties` | object | null | Requested properties: `{ "P31": [values…] }`. Each value has `rank` (`preferred`/`normal`; deprecated values are left out), `datatype` and `value`. Items: `value` is the Q-ID plus `label`. Quantities: number `value`, `unit` Q-ID (`null` = no unit) and `unitLabel`. Dates: `value` at the stated precision (`YYYY-MM-DD`, `YYYY-MM` or `YYYY`; full timestamp for hour precision or finer) plus `precision` (Wikidata's precision code, 11 = day, 9 = year, 7 = century) and `calendar` (`gregorian` or `julian`). Years before the common era keep Wikidata's notation: `-0044-03-15` is 15 March 44 BC (there is no year 0), and for century or millennium precision `value` is the representative year Wikidata stores (e.g. `-3000` with precision 7). Quantity bounds (±) are not returned. Text in a language: `value` and `language`. Coordinates: `value` `{ latitude, longitude }`. Strings, external IDs and URLs: string `value`. Unknown or no value: `value: null` and `snaktype`. A property the item does not have is `[]`. |
| `pageviews30d` | integer | null | Sum of daily views by people over `pageviewsStart`–`pageviewsEnd`; only with `includePageviews`. `null` when the Pageviews API has no data for the article (e.g. very new or never viewed). |
| `pageviewsStart`, `pageviewsEnd` | string | null | The 30 full days counted (UTC dates). The end is the day before Wikimedia's server time at the moment of the run. |
| `inputType` | string | `title`, `url`, `search` or `category`. |
| `input` | string | The input value that returned this article. |
| `redirectedFrom` | string | null | Redirect title that led to this article. |
| `searchRank` | integer | null | Position in Wikipedia's search results (1 = first); only for searches. |
| `foundInCategory`, `categoryDepth` | string | null, integer | null | Category the article was listed in and its depth (0 = the category you gave); only for categories. |
| `license`, `licenseUrl` | string | Licence of the article text, as reported by that Wikipedia. |
| `attribution` | string | Ready-to-use attribution line (see below). |

### Licence and attribution (please read)

- **Wikipedia text** (`title`, `extract`, `fullText`, `categories`, and `description` when it is written on Wikipedia itself) is licensed under **Creative Commons Attribution-ShareAlike 4.0** (the exact licence is read from each Wikipedia and put in `license` / `licenseUrl`). If you republish it you must credit Wikipedia's contributors, link to the source article and the licence, say that you changed it (this Actor converts it to plain text), and share your adapted text under the same licence. The `attribution` field gives you a line that does this.
- **Wikidata** data is released under **CC0** (public domain dedication); no attribution is required. On many non-English Wikipedias the short `description` also comes from Wikidata.
- **Pageviews** data is released under **CC0 1.0** by the Wikimedia Foundation.
- **Images** linked in `imageUrl` have their own licences on Wikimedia Commons; check the file page before reusing an image.

### How the Actor uses Wikimedia's APIs

- It identifies itself with a User-Agent that names the Actor and links to this page, as the [Wikimedia User-Agent policy](https://foundation.wikimedia.org/wiki/Policy:Wikimedia_Foundation_User-Agent_Policy) requires.
- It sends one request at a time, at most 2 per second **in total across all Wikimedia sites** (Wikimedia's limit of about 200 requests per minute applies across all sites), asks for 20 articles per request where the API allows it, uses `maxlag=5` on the Action API and pauses when Wikimedia asks it to (`Retry-After`), following the [API usage guidelines](https://foundation.wikimedia.org/wiki/Policy:Wikimedia_Foundation_API_Usage_Guidelines) and [rate limits](https://www.mediawiki.org/wiki/Wikimedia_APIs/Rate_limits). Large runs are therefore steady rather than instant (see FAQ).
- It never uses the Wikidata SPARQL query service.

### Run time limit and scheduled runs

- **Time limit:** one run lasts at most 20 minutes. Results are written page by page as they arrive, so when the limit is reached everything already written is kept (and charged as usual). In the run summary (`SUMMARY` in the run's key-value store) the input that was running is marked `partial` ("time budget … more results are available") and inputs not reached are marked `not-run` (nothing charged for them).
- **Speed:** All Wikimedia requests together are limited to 2 per second. With `includeFullText` and `includePageviews` each article needs 2 more requests, so expect about **60 articles per minute** (about 1,000 articles in 17 minutes); keep such runs under about 1,000 articles or split the titles, searches and categories into several runs. Without them, a search or category page of up to 500 articles is one request.
- **When the source fails:** a page that fails its format check is not written and the run ends as failed (results from earlier pages are kept); an input that keeps failing (timeouts, server errors) is marked `failed` or `partial`, and after 3 such inputs in a row the remaining inputs of that source are marked `not-run`.
- **Scheduled runs:** This Actor does not keep track of what earlier runs returned: every run returns all matching articles (and charges for them). To see which articles were edited since your last run, compare `lastRevisionId` per `language` + `pageId` with your previous results.

### Pricing

Pay per result: **US$1.00 per 1,000 articles** (US$0.001 per article) plus **US$0.0005 per run start**. You pay only for articles written to the dataset; missing titles, skipped inputs, failed inputs and searches with no results cost nothing. Full text, Wikidata and pageviews do not cost extra.

| Example | Cost |
|---|---|
| Default input (3 articles) | 3 × $0.001 + $0.0005 = **$0.0035** |
| 1,000 articles from a category | 1,000 × $0.001 + $0.0005 = **$1.0005** |

Discounts by Apify plan (per 1,000 results): Free $1.00, Bronze $0.90, Silver $0.80, Gold $0.70.

**Free plan:** Apify's free plan includes US$5 of prepaid usage every month (no credit card needed). With this Actor that is enough for about 5,000 articles a month.

### Use with AI agents (MCP)

AI agents can run this Actor through the [Apify MCP server](https://docs.apify.com/mcp) (Model Context Protocol). There are two ways to connect:

- **Load this Actor as its own tool:** add `https://mcp.apify.com?tools=justaduck/wikipedia-wikidata-scraper` to your MCP client. The server exposes it as the tool `justaduck--wikipedia-wikidata-scraper`.
- **Let the agent find it:** connect to `https://mcp.apify.com` (default tools). The agent can find this Actor with `search-actors`, read its input schema with `fetch-actor-details` and start it with `call-actor`.

On first connection you sign in to Apify with OAuth (or send your Apify API token as a Bearer header). The agent passes the same fields as in the Input section. A run returns its dataset ID, and the agent reads the rows with `get-dataset-items`. Runs started this way run on your Apify account and are charged as in the Pricing section; `call-actor` also accepts `maxTotalChargeUsd` in `callOptions` to cap what one run can spend.

### FAQ

**Do I need a Wikipedia account or API key?** No. The Actor uses Wikimedia's public read APIs without logging in.

**How fast is it?** Titles, searches and categories are fetched 20 articles per request, at most 2 requests per second in total. `includeFullText` and `includePageviews` add one request per article each, because Wikimedia has no batch endpoint for them: with both on, expect about 1 article per second (1,000 articles ≈ 17 minutes). Wikimedia limits unauthenticated clients to about 200 requests per minute across all its sites, so the Actor deliberately stays below that.

**How much memory?** 512 MB by default. A search or category result is collected in full before it is saved, so for thousands of long articles with `includeFullText`, run with 1 GB.

**Which language is the Wikidata label in?** The article's language, with Wikidata's own fallback when there is no label in that language.

**Why does `pageviews30d` differ from what I see elsewhere?** It counts only views by people (`agent=user`) on desktop and mobile web and apps, for the 30 full days before the run. Tools that include bots or use other windows will show other numbers.

**Does it handle Chinese traditional / simplified titles?** Yes: titles are matched with Wikipedia's own variant conversion and redirects (e.g. `台湾` returns `臺灣`). The text is returned as stored on Wikipedia, without converting it.

**Can I get more than 10,000 search results?** No. Wikipedia's search returns at most 10,000 results per query. Use categories or several narrower keywords.

**What happens if Wikimedia changes its API?** The Actor checks the structure of every response. If required fields disappear, the run stops with "Source format changed" instead of returning wrong or half-filled data.

### What this Actor does not output, and why

- **No editor names or IP addresses.** Only the revision ID and time of the latest edit are requested; the editor field is never asked for.
- **E-mail addresses and phone numbers in article text are masked** (`[email removed]`, `[phone removed]`) on a best-effort basis. Articles about people are public encyclopedia content and are returned as written; names in the text are not removed.
- **No Wikidata qualifiers, references or sitelinks**, and no deprecated values.
- **No HTML** and no images themselves, only the main image's URL.

### Related Actors

Another research data Actor by the same author:

- **[OpenAlex & arXiv Scraper – Academic Papers](https://apify.com/justaduck/openalex-arxiv-papers)**: academic papers, abstracts and citation counts from OpenAlex and arXiv. Use it for the academic papers behind a topic, with citation counts.

# Actor input Schema

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

Exact article titles, e.g. "Ada Lovelace". Uses the language below. Redirects and traditional/simplified Chinese variants are resolved automatically.

## `urls` (type: `array`):

Wikipedia article URLs in any language, e.g. https://de.wikipedia.org/wiki/Berlin, mobile (en.m.wikipedia.org) links, ?curid= links. The language comes from the URL.

## `searchQueries` (type: `array`):

Keywords to search on Wikipedia (articles only). Each keyword returns up to "Max results per search" articles in Wikipedia's relevance order.

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

Category names with or without the "Category:" prefix, e.g. "Nobel laureates in Physics". Returns the articles in the category.

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

Wikipedia language code for titles, search keywords and categories, e.g. en, de, fr, ja, zh, simple. URLs use their own language.

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

Maximum articles per search keyword (Wikipedia search returns at most 10,000).

## `categoryDepth` (type: `integer`):

0 = only articles directly in the category. 1 = also articles in its subcategories, and so on (up to 5).

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

Add the whole article as plain text in fullText (section headings kept as == Heading ==). One extra request per article.

## `includeWikidata` (type: `boolean`):

Add the linked Wikidata item's label, description and aliases in the article's language.

## `wikidataProperties` (type: `array`):

Wikidata property IDs to return, e.g. P31 (instance of), P17 (country), P1082 (population), P571 (inception), P856 (official website). Values that are Wikidata items come with their label.

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

Add the article's total pageviews by people (not bots) over the last 30 full days, from the Wikimedia Pageviews API. One extra request per article.

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

Maximum number of articles to return in total. You pay only for articles returned.

## Actor input object example

```json
{
  "titles": [
    "Ada Lovelace",
    "Tokyo",
    "Python (programming language)"
  ],
  "language": "en",
  "maxResultsPerSearch": 100,
  "categoryDepth": 0,
  "includeFullText": false,
  "includeWikidata": false,
  "includePageviews": false,
  "maxItems": 1000
}
```

# Actor output Schema

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

One dataset item per result. Field descriptions are in the dataset schema.

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

SUMMARY record: per-input status, item counts and the reason for any skipped or failed input.

# 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": [
        "Ada Lovelace",
        "Tokyo",
        "Python (programming language)"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("justaduck/wikipedia-wikidata-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": [
        "Ada Lovelace",
        "Tokyo",
        "Python (programming language)",
    ] }

# Run the Actor and wait for it to finish
run = client.actor("justaduck/wikipedia-wikidata-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": [
    "Ada Lovelace",
    "Tokyo",
    "Python (programming language)"
  ]
}' |
apify call justaduck/wikipedia-wikidata-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,justaduck/wikipedia-wikidata-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/FzHohd52Tf0OM4n9P/builds/9FyCjD0bYZgAbvei1/openapi.json
