How to Extract Wikipedia Data and Articles at Scale

Wikipedia holds structured knowledge on nearly every topic imaginable, and all of it is publicly accessible. The problem is that the raw MediaWiki API is fiddly to work with: pagination, language edition URLs, redirect handling, and content parsing all require custom code. The NanoScrape Wikipedia Scraper handles all of that. Give it a list of article titles, Wikipedia URLs, or a search keyword and it returns structured JSON records with the full article text, summary, sections, categories, images, Wikidata ID, and 30-day page view counts. At $0.002 per article, a thousand articles costs $2.

Difficulty: Beginner
Time: 5 minutes
Cost: $0.002 per article ($2.00 per 1,000)
Tools: Apify, NanoScrape Wikipedia Scraper
Open Wikipedia Scraper on Apify See what you get

In this tutorial

  1. What you get
  2. Use cases
  3. Prerequisites
  4. Step 1: Open the actor
  5. Step 2: Configure your query
  6. Step 3: Start the run
  7. Step 4: Export the results
  8. Input options
  9. Output field reference
  10. What it costs
  11. Automate with a schedule
  12. FAQ

What you get

The NanoScrape Wikipedia Scraper uses the public Wikipedia and Wikimedia APIs and returns one structured JSON record per article. Each record contains:

Because it uses Wikipedia's public APIs rather than browser scraping, there are no CSS selectors to maintain. The same input works across all 12 supported language editions.

Use cases

Prerequisites

STEP 1

Step 1: Open the actor on Apify

Go to the Wikipedia Scraper actor page on Apify. Click Try for free to open the input form. First-time Apify visitors will create a free account before landing on the input screen.

STEP 2

Step 2: Configure your query

The actor accepts three input modes. Pick the one that fits your workflow:

A typical input for a research dataset looks like this:

{
  "titles": [
    "Artificial intelligence",
    "Machine learning",
    "Natural language processing",
    "Large language model"
  ],
  "language": "en",
  "includeFullContent": true,
  "includeImages": false,
  "includeReferences": false
}

To use search mode instead, swap titles for a searchQuery string and set maxSearchResults to the number of articles you want:

{
  "searchQuery": "climate change",
  "language": "en",
  "maxSearchResults": 10,
  "includeFullContent": true
}
STEP 3

Step 3: Start the run

Click Start. Because the actor calls the official MediaWiki REST API rather than rendering pages in a browser, runs are fast.

Start with a handful of titles on your first run to check the output before you queue a large list.
STEP 4

Step 4: Export the results

Once the run finishes, open the Dataset tab. Each row is one Wikipedia article. Click Export to download as CSV, JSON, Excel, or Google Sheets. Here is a real output record from a run on the English article "Berlin" (long fields shortened, some list fields trimmed, content_html and the image/link lists omitted):

{
  "title": "Berlin",
  "url": "https://en.wikipedia.org/wiki/Berlin",
  "language": "en",
  "page_id": 3354,
  "revision_id": 1380001131,
  "extract": "Berlin is the capital and largest city of Germany. With 3.7 million inhabitants, ...",
  "description": "Capital and largest city of Germany",
  "content_full": "This article is about the capital city of Germany. ...",
  "sections": [ { "title": "", "level": 0, "text": "Berlin is the capital and largest city of Germany. ..." } ],
  "categories": ["Berlin", "Capital cities in Europe", "German state capitals"],
  "coordinates": { "lat": 52.52, "lng": 13.405 },
  "wikidata_id": "Q64",
  "last_modified": "2026-10-13T04:54:07Z",
  "word_count": 19965,
  "view_count_30d": 163279,
  "is_disambiguation": false,
  "scraped_at": "2026-10-14T07:02:02Z"
}

Input options

All input fields are optional except for at least one of titles, searchQuery, or urls.

Output field reference

What it costs

The actor uses pay-per-event pricing with two charge types:

Example costs at those rates:

The actor calls public Wikipedia APIs, not a browser. Current rates are always on the actor page.

New Apify accounts receive $5 of free credit, which covers 2,500 Wikipedia articles before you need to add a payment method.

Automate with a schedule

To keep a dataset in sync with Wikipedia edits, schedule the actor to run daily or weekly. In the Apify console, go to Schedules, create a new schedule, and attach the Wikipedia Scraper with your saved input. The actor re-fetches each article and the last_modified field tells you which ones have changed.

For more complex pipelines, n8n can trigger a Wikipedia Scraper run, filter new or changed records, and push them to a Google Sheet, Airtable, Notion database, or vector store with no custom code.

FAQ

Do I need a Wikipedia API key?

No. The actor uses the public Wikipedia and Wikimedia APIs, which need no API key. You only need a free Apify account to run the scraper.

How many languages does it support?

12 language editions: English, German, French, Spanish, Italian, Portuguese, Dutch, Polish, Russian, Japanese, Chinese, and Arabic. Set the language input field to the appropriate ISO code, such as de for German or zh for Chinese.

How is this different from querying the Wikipedia API directly?

The actor handles the parts of the MediaWiki API that are annoying to work with: combining the summary, parse, and pageviews endpoints into a single call, resolving redirects, normalizing titles, handling disambiguation pages, and returning a clean unified JSON schema. You get a ready-to-use record without writing any glue code.

Can I extract data from multiple Wikipedia languages in one run?

Each run targets one language edition. To collect articles across languages, run the actor once per language with the same list of titles and then merge the results by Wikidata ID, which is consistent across all editions.

What is a Wikidata ID and why does it matter?

Every Wikipedia article is linked to a Wikidata entity identified by a Q-ID (e.g., Q64 for Berlin). The Q-ID is language-independent, so you can use it to join articles from different language editions, look up structured facts from the Wikidata knowledge graph, or link Wikipedia records to other datasets that use Wikidata as their entity layer.

Can I extract references or citations from articles?

Yes. Set includeReferences to true in the input. The actor will include the full citation list for each article. This field defaults to false because reference lists are large and most use cases do not need them.

Related resources

Try Wikipedia Scraper for free Browse all NanoScrape tutorials