# Download Wikipedia articles as clean text for RAG

**Use case:** 

Downloads Wikipedia articles as clean plain text with headings, a word count and the article split into sections, ready for chunking, embeddings and RAG. Each row also has the summary, categories, URL, last edit date and license attribution fields for compliant reuse.

## Input

```json
{
  "articles": [
    "Retrieval-augmented generation",
    "Large language model",
    "Vector database",
    "Transformer (deep learning architecture)"
  ],
  "searchQueries": [],
  "maxResultsPerSearch": 20,
  "categories": [],
  "categoryDepth": 0,
  "maxResultsPerCategory": 100,
  "includeMostViewed": false,
  "mostViewedDate": "",
  "maxMostViewed": 25,
  "language": "en",
  "includeFullText": true,
  "includeSections": true,
  "includeInfobox": false,
  "includeHtml": false,
  "includeCategories": true,
  "includeLinks": false,
  "maxLinksPerArticle": 500,
  "includeImages": false,
  "maxImagesPerArticle": 20,
  "includeLanguageLinks": false,
  "includeWikidata": false,
  "skipDisambiguation": false,
  "includePageviews": false,
  "pageviewsGranularity": "daily",
  "pageviewsDays": 30,
  "pageviewsStartDate": "",
  "pageviewsEndDate": "",
  "pageviewsAccess": "all-access",
  "pageviewsAgent": "user",
  "pageviewRows": false,
  "maxArticles": 0,
  "proxyConfiguration": {
    "useApifyProxy": false
  }
}
```

## Output

```json
{
  "title": {
    "label": "Title",
    "format": "text"
  },
  "language": {
    "label": "Lang",
    "format": "text"
  },
  "url": {
    "label": "Link",
    "format": "link"
  },
  "description": {
    "label": "Description",
    "format": "text"
  },
  "extract": {
    "label": "Summary",
    "format": "text"
  },
  "wordCount": {
    "label": "Words",
    "format": "number"
  },
  "categories": {
    "label": "Categories",
    "format": "array"
  },
  "lastEdited": {
    "label": "Last edited",
    "format": "date"
  },
  "length": {
    "label": "Bytes",
    "format": "number"
  },
  "languageCount": {
    "label": "Languages",
    "format": "number"
  },
  "pageviewsTotal": {
    "label": "Views",
    "format": "number"
  },
  "thumbnail": {
    "label": "Thumbnail",
    "format": "object"
  },
  "wikidataId": {
    "label": "Wikidata",
    "format": "text"
  },
  "isDisambiguation": {
    "label": "Disambiguation",
    "format": "boolean"
  },
  "source": {
    "label": "Source",
    "format": "text"
  },
  "input": {
    "label": "Input",
    "format": "text"
  },
  "searchRank": {
    "label": "Search rank",
    "format": "number"
  },
  "mostViewedRank": {
    "label": "Top rank",
    "format": "number"
  }
}
```

## How it works

### 1. Sign up on Apify or log in

The Wikipedia Scraper: Articles, Full Text, Infobox, Pageviews Actor is ready to run with the inputs already set for "Download Wikipedia articles as clean text for RAG". [Sign up or log in](https://console.apify.com/create-task-from-example/O8HwEaXl5gzgvjRtb) and you'll land in Apify Console with a copy of this exact task.

### 2. Start the "Download Wikipedia articles as clean text for RAG" task

The Wikipedia Scraper: Articles, Full Text, Infobox, Pageviews Actor will start running based on the input automatically. You can also change all the input fields, like articles (titles or urls), search queries, and more, to match your specific use case.

### 3. Receive the "Download Wikipedia articles as clean text for RAG" output

Monitor the progress in real time. You will be notified as soon as your dataset is complete and ready for review. Each result includes data such as title, lang, link, and more.

### 4. Integrate into your workflow

The final output is delivered in JSON, CSV, or Excel format, ready to be plugged into your workflow. You can also [run the "Download Wikipedia articles as clean text for RAG" task via API](https://apify.com/zhtech/wikipedia-scraper.md).

## FAQ

### What does the Wikipedia articles plain text task return?

The Wikipedia articles plain text task returns one row per article with title, URL, summary, full plain text with headings, sections with heading level and text, word count, categories and last edit date.

### How do I get a whole topic instead of single articles?

Add a category such as Machine learning to Categories in the Wikipedia articles plain text task, or use Search queries. Each found article is downloaded with the same text options.

### Can I run the Wikipedia articles plain text task on a schedule or through the API?

Save the Wikipedia articles plain text task to your Apify account, then add it to an Apify Schedule (for example daily) or start it from the Apify API, webhooks, Zapier, Make, n8n or the Apify MCP server for AI agents.

### How much does the Wikipedia articles plain text task cost?

The Wikipedia articles plain text task is pay per event: a small start fee per run plus a fee per full article saved. Error rows and skipped disambiguation pages are free. Prices are on the Pricing tab.

## About this Actor

This example demonstrates how to use [Wikipedia Scraper: Articles, Full Text, Infobox, Pageviews](https://apify.com/zhtech/wikipedia-scraper.md) with a specific input configuration. Visit the [Actor detail page](https://apify.com/zhtech/wikipedia-scraper.md) to learn more, explore other use cases, and run it yourself.


## How to integrate an Actor?

This Task's input is already configured above. Use it as-is rather than inventing a new one.

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 full API examples (JavaScript, Python, CLI, MCP, OpenAPI), see this Task's Actor page: https://apify.com/zhtech/wikipedia-scraper.md

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`).
