# Wikipedia Scraper: Articles, Full Text, Infobox, Pageviews (`zhtech/wikipedia-scraper`) Actor

Scrape Wikipedia in any language with the official Wikimedia APIs: articles by title, URL, search, category or most viewed list, with summary, full text, sections, infobox, categories, links, images, Wikidata and daily or monthly pageviews.

- **URL**: https://apify.com/zhtech/wikipedia-scraper.md
- **Developed by:** [ZH Tech](https://apify.com/zhtech) (community)
- **Categories:** AI, SEO tools, Education
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $0.30 / 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/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: articles, full text, infobox, categories and pageviews

Scrape **Wikipedia in any language** with the **official Wikimedia APIs**. Give it article titles or links, a search query, a category or ask for the **most viewed articles** of a day or month, and get one clean row per article: **title, URL, description, summary, full text, sections, infobox fields, categories, last edit date, length, links, images with licenses, Wikidata QID and entity, coordinates, thumbnail** and **daily or monthly pageviews** with total, average and peak.

No login, no API key, no browser, no proxy. The default run takes about 5 seconds and you only pay for articles you get.

Built for **SEO and content research, trend research, AI training data and RAG pipelines, knowledge graphs and data enrichment**.

### What can this Wikipedia scraper do?

| You give it | You get |
|---|---|
| Article titles or links in any language (`Albert Einstein`, `https://de.wikipedia.org/wiki/Berlin`, mobile links, `?curid=` links) | One row per article, redirects followed, duplicates merged |
| Search queries (full Wikipedia search syntax, `intitle:`, `incategory:`, quotes) | The top results with their rank and matching snippet |
| Categories (`Machine learning`, `Kategorie:Physik`, a category link), optionally with subcategories | Every article in the category, up to your limit |
| The most viewed list for a day or a month | The top articles of that day or month with rank and views, main page and non article pages left out |

Every article row has `title`, `language`, `pageid`, `url`, `description`, `extract` (intro summary as plain text), `categories`, `lastEdited`, `lastRevisionId`, `length` (bytes), `languageCount`, `isDisambiguation`, `redirectedFrom`, `thumbnail`, `imageUrl`, `coordinates`, `wikidataId`, `pageviewsTotal`, `pageviewsDailyAverage`, `pageviews` (series), the source that found it, and ready to use **license and attribution fields**.

Optional, per run: `fullText` with headings and `wordCount`, `sections`, `infobox`, `html`, `links` and `externalLinks`, `images` with license and artist, `languageLinks` to every other language version, and a compact `wikidata` entity.

### Why this actor

- **Four sources in one run.** Titles and URLs, search, categories with subcategory depth, and the most viewed list. Inputs that land on the same article (redirects, two links to one page, a search hit that is also in your list) are saved and charged once, and the row lists every input that found it.
- **Pageviews built in, not sold separately.** Daily or monthly views over any range back to July 2015, by device and visitor type, with total, daily average and peak, days without views filled with 0. Turn on pageview rows to get one row per day for charts.
- **Infobox and sections that read well.** Infobox values come as readers see them (dates, places, lists), as label and value pairs, in most languages. Sections give heading, level and text for clean chunking.
- **Attribution ready.** Every row carries `license`, `licenseUrl`, `historyUrl` and an `attribution` sentence you can paste under reused text. Images come with their own license, license URL and artist.
- **Fair billing.** Missing articles, invalid input, empty searches and empty categories become error rows that are never charged. Summary rows cost less than full content rows.
- **Official APIs and good manners.** MediaWiki Action API, Wikimedia REST API, Pageviews API and Wikidata API only, an identifying User-Agent, `maxlag`, Retry-After handling and pacing under the Wikimedia API rate limits. Nothing to break when page layouts change.

### Use cases

- **SEO and content strategy**: find what people read on a topic (pageviews), compare demand across languages, study how strong articles are structured (sections, length, links), build topic clusters from categories and internal links.
- **Trend research**: daily most viewed lists, spikes in pageviews around launches, elections, sports and releases, monthly series for seasonality.
- **AI training data and RAG**: clean plain text with headings, sections for chunking, categories and Wikidata types for filtering, and attribution fields for compliant reuse.
- **Knowledge graphs and enrichment**: Wikidata QID, instance of, country, coordinates, official website, dates, plus infobox fields for people, places, companies and products.
- **Research and journalism**: last edit dates, article length, language coverage and pageviews for many articles at once.

### How to use

1. Put titles or links in **Articles**, or add **Search queries**, **Categories** or turn on **Add the most viewed articles**.
2. Pick the **Language** for titles, search, categories and the most viewed list (links keep their own language).
3. Choose the content you need: full text, sections, infobox, HTML, categories, links, images, other language versions, Wikidata.
4. Set the **Pageviews** period and granularity, or turn pageviews off.
5. Click **Start**. Results appear in the **Articles**, **Pageviews**, **Pageview rows** and **Errors** views and can be exported as JSON, CSV, Excel or XML.

### Input examples

The prefilled example: 10 articles in English, German and French with 30 days of daily pageviews.

```json
{
    "articles": ["Web scraping", "Artificial intelligence", "https://de.wikipedia.org/wiki/Künstliche_Intelligenz", "https://fr.wikipedia.org/wiki/Tour_Eiffel"],
    "includePageviews": true
}
```

Full content for a RAG dataset: text, sections, infobox and Wikidata.

```json
{
    "articles": ["Albert Einstein", "Marie Curie", "Isaac Newton"],
    "includeFullText": true,
    "includeSections": true,
    "includeInfobox": true,
    "includeWikidata": true,
    "includePageviews": false
}
```

Search and category in Spanish, with links and images:

```json
{
    "articles": [],
    "language": "es",
    "searchQueries": ["energía solar"],
    "maxResultsPerSearch": 50,
    "categories": ["Categoría:Energías renovables"],
    "categoryDepth": 1,
    "maxResultsPerCategory": 200,
    "includeLinks": true,
    "includeImages": true
}
```

Yesterday's 100 most viewed English articles with a daily series of the last 14 days:

```json
{
    "articles": [],
    "includeMostViewed": true,
    "maxMostViewed": 100,
    "skipDisambiguation": true,
    "pageviewsDays": 14
}
```

Monthly views for a year, one row per month for a chart:

```json
{
    "articles": ["ChatGPT", "Bitcoin", "Taylor Swift"],
    "pageviewsGranularity": "monthly",
    "pageviewsStartDate": "2025-11",
    "pageviewsEndDate": "2026-10",
    "pageviewRows": true
}
```

### Output examples

An article row with every option on (long values and lists shortened; links capped at 50 in this run):

```json
{
    "type": "article",
    "language": "en",
    "title": "Paris",
    "pageid": 22989,
    "url": "https://en.wikipedia.org/wiki/Paris",
    "description": "Capital and largest city of France",
    "extract": "Paris is the capital and largest city of France, with an estimated city population of 2.04 million ...",
    "fullText": "Paris is the capital and largest city of France ...",
    "sections": [
        { "index": 0, "heading": null, "level": 1, "text": "Paris is the capital and largest city of France ..." },
        { "index": 1, "heading": "Etymology", "level": 2, "text": "The ancient oppidum that corresponds to the modern city of Paris ..." }
    ],
    "wordCount": 14247,
    "infoboxTitle": "Paris",
    "infobox": { "Country": "France", "Region": "Île-de-France", "Department": "Paris", "Intercommunality": "Métropole du Grand Paris" },
    "categories": ["Capital cities in Europe", "Cities in France", "Cities in Île-de-France"],
    "categoryCount": 13,
    "lastEdited": "2026-11-12T23:00:18Z",
    "lastRevisionId": 1385351351,
    "length": 231208,
    "languageCount": 289,
    "isDisambiguation": false,
    "redirectedFrom": null,
    "thumbnail": { "url": "https://thumb.wikimedia.org/wikipedia/commons/thumb/4/4b/La_Tour_Eiffel_...jpg/500px-La_Tour_Eiffel_...jpg", "width": 500, "height": 313 },
    "imageUrl": "https://upload.wikimedia.org/wikipedia/commons/4/4b/La_Tour_Eiffel_...jpg",
    "coordinates": { "lat": 48.8567, "lon": 2.3522 },
    "wikidataId": "Q90",
    "wikidata": {
        "id": "Q90",
        "label": "Paris",
        "description": "capital and most populous city in France",
        "aliases": ["City of Light", "City of Love", "Lutetia"],
        "instanceOf": [{ "id": "Q200250", "label": "metropolis" }],
        "country": [{ "id": "Q142", "label": "France" }],
        "coordinates": { "lat": 48.8567, "lon": 2.3522 },
        "officialWebsite": "https://www.paris.fr/",
        "sitelinkCount": 367,
        "claims": { "P17": ["Q142"], "P1082": [2103778] }
    },
    "links": ["10th arrondissement of Paris", "11th arrondissement of Paris"],
    "linkCount": 50,
    "externalLinks": ["http://www.smithsonianmag.com/arts-culture/the-surreal-world-of-salvador-dali-78993324/"],
    "images": [
        { "file": "File:Arc de Triomphe HDR 2007.jpg", "url": "https://upload.wikimedia.org/wikipedia/commons/6/6d/Arc_de_Triomphe_HDR_2007.jpg", "width": 3512, "height": 2341, "mime": "image/jpeg", "license": "CC BY 2.0", "licenseUrl": "https://creativecommons.org/licenses/by/2.0", "artist": "Kainet" }
    ],
    "languageLinks": [{ "language": "fr", "title": "Paris", "url": "https://fr.wikipedia.org/wiki/Paris" }],
    "pageviewsTotal": 1654206,
    "pageviewsDailyAverage": 4937.9,
    "pageviews": {
        "granularity": "monthly",
        "access": "all-access",
        "agent": "user",
        "startDate": "2025-12-01",
        "endDate": "2026-10-31",
        "total": 1654206,
        "dailyAverage": 4937.9,
        "peakDate": "2026-06",
        "peakViews": 173484,
        "series": [{ "date": "2025-12", "views": 135060 }, { "date": "2026-01", "views": 145938 }],
        "note": null
    },
    "source": "article",
    "input": "https://en.m.wikipedia.org/wiki/Paris",
    "sources": [{ "source": "article", "input": "https://en.m.wikipedia.org/wiki/Paris" }],
    "license": "CC BY-SA 4.0",
    "licenseUrl": "https://creativecommons.org/licenses/by-sa/4.0/deed.en",
    "historyUrl": "https://en.wikipedia.org/w/index.php?title=Paris&action=history",
    "attribution": "Text from the Wikipedia article \"Paris\" (https://en.wikipedia.org/wiki/Paris), by Wikipedia contributors (https://en.wikipedia.org/w/index.php?title=Paris&action=history), licensed under CC BY-SA 4.0 (https://creativecommons.org/licenses/by-sa/4.0/deed.en).",
    "scrapedAt": "2026-11-22T02:05:42.418Z"
}
```

Search, category and most viewed rows also have `searchQuery`, `searchRank`, `searchSnippet`, `category`, `mostViewedDate`, `mostViewedRank` and `mostViewedViews`.

A pageview row (only with **Also save one row per day or month**):

```json
{ "type": "pageview", "language": "en", "title": "Riemann hypothesis", "pageid": 19344125, "url": "https://en.wikipedia.org/wiki/Riemann_hypothesis", "date": "2026-11-03", "views": 476, "granularity": "daily", "access": "mobile-web", "agent": "user" }
```

An error row (never charged):

```json
{ "type": "error", "input": "NotARealPage", "errorCode": "NOT_FOUND", "error": "No en.wikipedia.org article is titled \"NotARealPage\". Check the spelling or the language.", "language": "en", "source": "article" }
```

Error codes: `NOT_FOUND` (article or category does not exist), `NO_RESULTS` (search or category with no articles, or no most viewed list yet), `INVALID_INPUT`, `INVALID_TITLE`, `NOT_AN_ARTICLE` (for example a category or user page in the Articles list), `LANGUAGE_NOT_FOUND`, `RATE_LIMITED`, `API_ERROR`, `FAILED`.

### Field notes

- **extract** is the intro section as plain text. **fullText** is the whole article as plain text with section headings on their own lines; tables, infoboxes, references and image captions are left out by Wikipedia's own text extractor. **wordCount** is language aware (Chinese, Japanese and Thai are counted correctly) and is filled when full text is on, or from the search result.
- **sections** start with the lead (`index` 0, `heading` null) and keep the original order and heading levels (2 to 6).
- **infobox** maps each label to its value as displayed; lists are joined with `; `. `infoboxRows` keeps the order and the group header of each row. Articles without an infobox get null.
- **categories** leave out hidden maintenance categories.
- **pageviews** count page requests, not unique people. `agent: user` (default) excludes known crawlers and automated traffic. Views are counted per exact title, so views of a redirect title are not added to the target. The newest day available is yesterday (UTC); monthly views use complete months only.
- **images** are the files used on the page in alphabetical order (icons included), with the license from each file page. The lead image is always in `imageUrl` and `thumbnail`.
- **languageCount** is the number of other language editions with this article, a handy notability signal.
- **wikidata.claims** holds every statement as property ID to values (entity IDs, dates, numbers, strings, coordinates), up to 20 values per property, preferred values first and deprecated ones removed.

### Attribution and license

Wikipedia text is licensed under **CC BY-SA 4.0** (and GFDL). If you republish it, you must give credit and share alike. The Wikimedia Terms of Use accept a hyperlink or URL to the article as credit, because each article's history lists its authors. Each row gives you `url`, `historyUrl`, `license`, `licenseUrl` and a ready `attribution` sentence. If you change the text, say so and keep the same license for your changed version.

Images have their own licenses, shown in the `images` list (`license`, `licenseUrl`, `artist`). Wikidata structured data is CC0 and needs no attribution. Pageview counts are open data.

This actor is not affiliated with or endorsed by the Wikimedia Foundation. Wikipedia is a trademark of the Wikimedia Foundation.

### Pricing

Pay per event, you only pay for what is delivered:

- **Actor start**: a small flat fee once per run.
- **Article**: per article row with summary, metadata, categories, links, images, other language versions, Wikidata and pageviews.
- **Article with full content**: replaces the article event when full text, sections, infobox or HTML is on.
- **Pageview row**: per day or month row, only when you turn pageview rows on.

The current prices are on the Pricing tab. Never charged: error rows, duplicates, skipped disambiguation pages, and anything after your Max articles or max total charge. Invalid input or an unknown language stops the run before the start fee.

### Use with the API, integrations and AI agents

- **API**: `POST https://api.apify.com/v2/acts/zhtech~wikipedia-scraper/run-sync-get-dataset-items?token=YOUR_APIFY_TOKEN` with the JSON input as the body returns the rows in one call. Add `&view=articles` (or `pageviews`, `pageviewRows`, `errors`).
- **Clients**: `apify-client` for JavaScript and Python. Example (JavaScript): `await client.actor('zhtech/wikipedia-scraper').call({ articles: ['Albert Einstein'], includeFullText: true })`.
- **Schedules and integrations**: run the most viewed list every morning, or track pageviews of your topics weekly, and send rows to Google Sheets, Slack, a webhook, Zapier, Make or n8n.
- **LLMs and MCP**: the actor works as a tool through the Apify MCP server (mcp.apify.com), so Claude, ChatGPT, Cursor and other agents can look up articles, search Wikipedia or check pageviews on demand.

### FAQ

**Do I need a Wikipedia account or API key?**
No. The actor uses the public Wikimedia APIs that anyone can call without an account.

**Which languages work?**
All Wikipedia language editions (about 340). Use the subdomain code: `en`, `de`, `fr`, `es`, `ja`, `zh`, `pt`, `simple` and so on. Links keep their own language, so one run can mix languages.

**How many articles can I get and how fast?**
Thousands per run. Wikimedia allows about 200 API requests per minute per client, and the actor stays under that. Summaries come 20 articles per request, so a summary only run does about 1,000 articles per minute; pageviews, full text, links and HTML each add one request per article, about 150 articles per minute with pageviews and 50 to 60 with everything on. For millions of pages, the Wikimedia dumps are the better tool.

**Can I get the full article text?**
Yes, turn on **Full text** (plain text with headings) or **Sections**. For the raw rendered page, turn on **Article HTML**.

**Does the infobox work in other languages?**
Yes for most editions that use standard infobox tables (English, French, Spanish, Italian, Japanese, Portuguese and many more). A few editions such as German Wikipedia use few infoboxes, so many articles return null there. For language independent facts, turn on **Wikidata entity**.

**Why do pageviews differ from other tools?**
The actor reads the official Wikimedia Pageviews API with the device and visitor type you choose (default: all devices, people only). Views of redirect titles are counted separately by Wikimedia. Days without views are filled with 0 in the series.

**Why was my article NOT_FOUND?**
The title does not exist in that language, or it is spelled differently. Titles are case sensitive after the first letter (`Web scraping` works, `Web Scraping` is a redirect and is followed). Error rows are free.

**Is it legal to scrape Wikipedia?**
Wikipedia content is free to reuse under CC BY-SA with attribution. The actor only uses the official public APIs, follows the Wikimedia API etiquette, User-Agent policy and rate limits, and reads robots.txt on every run. You are responsible for reusing the content under its license.

### Limitations

- Main namespace articles only. Talk, user, file and template pages are not returned.
- Full text comes from Wikipedia's plain text extractor: tables, infobox contents, math formulas and reference lists are not in `fullText` (use infobox and HTML for those).
- Infobox parsing reads standard infobox tables; unusual custom layouts can return partial data or null.
- Pageviews start on 2015-07-01 and end yesterday (UTC). The most viewed list is published about a day after the day ends.
- Speed is capped by the Wikimedia rate limits, not by the actor.

### Support

Found a wrong field, an article that does not parse, or need another data point? Open an issue on the Issues tab with the input you used and it will be looked at quickly.

# Actor input Schema

## `articles` (type: `array`):

One per line: an article title (Web scraping) or a Wikipedia link in any language (https://de.wikipedia.org/wiki/Berlin, mobile links, index.php?title= links and ?curid= links work too). A link uses its own language; a title uses the Language field. Redirects are followed. The prefilled example list is skipped automatically when you add a search, category or most viewed source.

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

Full text search on Wikipedia in the chosen language, one query per line. Results keep Wikipedia's relevance order (searchRank) and the matching snippet. Supports Wikipedia search syntax such as intitle:, incategory: and quotes.

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

Top results to take from each search query (Wikipedia allows up to 10,000).

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

Get the articles in a category, one per line: a name (Machine learning), Category:Machine learning, a localized prefix (Kategorie:Physik) or a category link.

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

0 takes only the articles directly in each category. 1 also takes articles of its subcategories, 2 and 3 go deeper. Each subcategory is visited once.

## `maxResultsPerCategory` (type: `integer`):

Stop collecting a category (including its subcategories) after this many articles.

## `includeMostViewed` (type: `boolean`):

Adds the most viewed articles of a day or month in the chosen language (Wikimedia Pageviews API), with their rank and views. The main page, search pages and other non article pages are left out. Great for trend research.

## `mostViewedDate` (type: `string`):

YYYY-MM-DD for a day, YYYY-MM for a whole month, or leave empty for the latest available day (lists appear about a day after the day ends).

## `maxMostViewed` (type: `integer`):

Number of top articles to take (up to 1,000).

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

Wikipedia language code used for titles, search, categories and the most viewed list: en, de, fr, es, it, ja, zh, ru, pt, ar, nl, pl, simple and about 340 more. Links in the Articles list keep their own language.

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

The whole article as clean plain text with headings, plus a language aware word count. One extra API request per article and charged as article-full instead of article.

## `includeSections` (type: `boolean`):

The article split into sections: heading, level and plain text of each, in order. Handy for RAG chunking. Charged as article-full.

## `includeInfobox` (type: `boolean`):

The infobox as label and value pairs with the values as readers see them (dates, places, lists), from the official REST API page HTML. Works in most languages; articles without an infobox get null. Charged as article-full.

## `includeHtml` (type: `boolean`):

The full rendered article HTML (Parsoid HTML from the REST API). Large, 100 KB to 2 MB per article. Charged as article-full.

## `includeCategories` (type: `boolean`):

Visible categories (hidden maintenance categories are left out). Included in the base price.

## `includeLinks` (type: `boolean`):

Internal links to other articles and external links (URLs) of each article, up to the limit below. One extra API request per article.

## `maxLinksPerArticle` (type: `integer`):

Cap for internal links and for external links, each.

## `includeImages` (type: `boolean`):

Files used in each article with direct URL, size, MIME type, license, license URL and artist (for correct image attribution). Lead image and thumbnail are always included.

## `maxImagesPerArticle` (type: `integer`):

Cap for the images list.

## `includeLanguageLinks` (type: `boolean`):

Title and URL of the same article in every other language edition. The number of languages (languageCount) is always included.

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

Adds the linked Wikidata item: label, description, aliases, instance of, country, occupation (with labels), birth, death and inception dates, coordinates, official website, image, sitelink count and all statements in a compact form. The Wikidata ID (QID) is always included.

## `skipDisambiguation` (type: `boolean`):

Leave out "may refer to" pages (not saved, not charged). Otherwise they are saved with isDisambiguation true.

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

Views of each article from the official Wikimedia Pageviews API: total, daily average, peak and the full daily or monthly series (days without views filled with 0). Included in the base price.

## `pageviewsGranularity` (type: `string`):

Daily or monthly views. Monthly uses complete months only.

## `pageviewsDays` (type: `integer`):

How many days back from the end date, when no start date is set. 30 by default; with monthly granularity, 365 gives the last 12 complete months.

## `pageviewsStartDate` (type: `string`):

First day, YYYY-MM-DD (or YYYY-MM for monthly). Data starts 2015-07-01. Overrides Period.

## `pageviewsEndDate` (type: `string`):

Last day, YYYY-MM-DD or YYYY-MM. Empty means yesterday (UTC).

## `pageviewsAccess` (type: `string`):

Count views from all devices or one type only. Also used for the most viewed list.

## `pageviewsAgent` (type: `string`):

People only (default), or include automated traffic and crawlers.

## `pageviewRows` (type: `boolean`):

Adds a pageview row (date, views) for every day or month of every article, ready for charts and spreadsheets. Each row is a cheap pageview-row event.

## `maxArticles` (type: `integer`):

Stop after this many article rows. 0 means no limit. Your maximum cost per run (set in the run options) is respected as well.

## `proxyConfiguration` (type: `object`):

Not needed: the actor uses official public APIs. Leave it off. Residential proxy is not supported and is replaced with datacenter proxy automatically.

## Actor input object example

```json
{
  "articles": [
    "Web scraping",
    "Artificial intelligence",
    "Large language model",
    "Retrieval-augmented generation",
    "Search engine optimization",
    "Wikipedia",
    "Data mining",
    "https://en.wikipedia.org/wiki/Open_data",
    "https://de.wikipedia.org/wiki/Künstliche_Intelligenz",
    "https://fr.wikipedia.org/wiki/Tour_Eiffel"
  ],
  "searchQueries": [],
  "maxResultsPerSearch": 20,
  "categories": [],
  "categoryDepth": 0,
  "maxResultsPerCategory": 100,
  "includeMostViewed": false,
  "mostViewedDate": "",
  "maxMostViewed": 25,
  "language": "en",
  "includeFullText": false,
  "includeSections": false,
  "includeInfobox": false,
  "includeHtml": false,
  "includeCategories": true,
  "includeLinks": false,
  "maxLinksPerArticle": 500,
  "includeImages": false,
  "maxImagesPerArticle": 20,
  "includeLanguageLinks": false,
  "includeWikidata": false,
  "skipDisambiguation": false,
  "includePageviews": true,
  "pageviewsGranularity": "daily",
  "pageviewsDays": 30,
  "pageviewsStartDate": "",
  "pageviewsEndDate": "",
  "pageviewsAccess": "all-access",
  "pageviewsAgent": "user",
  "pageviewRows": false,
  "maxArticles": 0,
  "proxyConfiguration": {
    "useApifyProxy": false
  }
}
```

# Actor output Schema

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

No description

## `pageviews` (type: `string`):

No description

## `pageviewRows` (type: `string`):

No description

## `errors` (type: `string`):

No description

## `allResults` (type: `string`):

No description

## `runSummary` (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 = {
    "articles": [
        "Web scraping",
        "Artificial intelligence",
        "Large language model",
        "Retrieval-augmented generation",
        "Search engine optimization",
        "Wikipedia",
        "Data mining",
        "https://en.wikipedia.org/wiki/Open_data",
        "https://de.wikipedia.org/wiki/Künstliche_Intelligenz",
        "https://fr.wikipedia.org/wiki/Tour_Eiffel"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("zhtech/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 = { "articles": [
        "Web scraping",
        "Artificial intelligence",
        "Large language model",
        "Retrieval-augmented generation",
        "Search engine optimization",
        "Wikipedia",
        "Data mining",
        "https://en.wikipedia.org/wiki/Open_data",
        "https://de.wikipedia.org/wiki/Künstliche_Intelligenz",
        "https://fr.wikipedia.org/wiki/Tour_Eiffel",
    ] }

# Run the Actor and wait for it to finish
run = client.actor("zhtech/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 '{
  "articles": [
    "Web scraping",
    "Artificial intelligence",
    "Large language model",
    "Retrieval-augmented generation",
    "Search engine optimization",
    "Wikipedia",
    "Data mining",
    "https://en.wikipedia.org/wiki/Open_data",
    "https://de.wikipedia.org/wiki/Künstliche_Intelligenz",
    "https://fr.wikipedia.org/wiki/Tour_Eiffel"
  ]
}' |
apify call zhtech/wikipedia-scraper --silent --output-dataset

```

## MCP server setup

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