Wikipedia Scraper – Articles, Wikidata & Pageviews avatar

Wikipedia Scraper – Articles, Wikidata & Pageviews

Pricing

from $0.70 / 1,000 articles

Go to Apify Store
Wikipedia Scraper – Articles, Wikidata & Pageviews

Wikipedia Scraper – Articles, Wikidata & Pageviews

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.

Pricing

from $0.70 / 1,000 articles

Rating

0.0

(0)

Developer

Justaduck

Justaduck

Maintained by Community

Actor stats

0

Bookmarked

1

Total users

0

Monthly active users

4 hours ago

Last modified

Features

Limited permissions

Share

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 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):

FieldWhat it does
titlesExact article titles, e.g. Ada Lovelace. Uses language. Redirects, capitalisation and Chinese traditional/simplified variants are resolved automatically.
urlsArticle 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.
searchQueriesKeywords. Each keyword returns up to maxResultsPerSearch articles (default 100, max 10,000) in Wikipedia's own relevance order.
categoriesCategory names with or without Category: (local prefixes like Kategorie: also work). categoryDepth 0–5 (default 0 = direct members only).

Options:

FieldDefaultWhat it does
languageenWikipedia language code for titles, searches and categories (en, de, fr, ja, zh, simple, …).
includeFullTextfalseAdds fullText: the whole article as plain text, section headings kept as == Heading ==. One extra request per returned article.
includeWikidatafalseAdds 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.
includePageviewsfalseAdds pageviews30d: views by people (not bots or spiders) on all platforms over the last 30 full days (UTC). One extra request per returned article.
maxItems1000Maximum number of articles returned in total.

Example:

{
"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):

{
"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).

FieldTypeDescription
languagestringWikipedia language code of the article.
pageIdintegerWikipedia page ID (unique within one language).
titlestringOfficial article title (after redirects).
sourceUrlstringLink to the article on Wikipedia.
extractstring | nullIntro section as plain text (TextExtracts). null if the article has no intro text.
fullTextstring | nullWhole article as plain text; only with includeFullText.
descriptionstring | nullShort description shown by Wikipedia.
categoriesstring[]Visible categories, without the Category: prefix. Hidden maintenance categories are left out.
isDisambiguationbooleantrue for disambiguation pages.
lastRevisionIdintegerID of the latest revision.
lastEditedAtstringTime of the latest revision (ISO 8601, UTC).
sizeBytesintegerSize of the article's wikitext in bytes.
wordCountinteger | nullWord count from Wikipedia search; only for search results.
imageUrlstring | nullMain image of the article (original file URL).
latitude, longitudenumber | nullPrimary coordinates of the article, if it has any.
wikidataIdstring | nullLinked Wikidata item ID (e.g. Q1490).
wikidataLabel, wikidataDescriptionstring | nullWikidata label and description in the article's language (with Wikidata's language fallback); only with includeWikidata or wikidataProperties.
wikidataAliasesstring[] | nullWikidata aliases in the article's language.
wikidataPropertiesobject | nullRequested 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 [].
pageviews30dinteger | nullSum 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, pageviewsEndstring | nullThe 30 full days counted (UTC dates). The end is the day before Wikimedia's server time at the moment of the run.
inputTypestringtitle, url, search or category.
inputstringThe input value that returned this article.
redirectedFromstring | nullRedirect title that led to this article.
searchRankinteger | nullPosition in Wikipedia's search results (1 = first); only for searches.
foundInCategory, categoryDepthstring | null, integer | nullCategory the article was listed in and its depth (0 = the category you gave); only for categories.
license, licenseUrlstringLicence of the article text, as reported by that Wikipedia.
attributionstringReady-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 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 and 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.

ExampleCost
Default input (3 articles)3 × $0.001 + $0.0005 = $0.0035
1,000 articles from a category1,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 (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.

Another research data Actor by the same author: