# Wikipedia Article Text Export — Sections and Attribution (`jpmarketdata/wikipedia-article-text-export`) Actor

Export selected English Wikipedia article text and ordered sections, including tables, lists and source attribution for research agents and knowledge ingestion.

- **URL**: https://apify.com/jpmarketdata/wikipedia-article-text-export.md
- **Developed by:** [h ichi](https://apify.com/jpmarketdata) (community)
- **Categories:** Developer tools, Automation
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

$1.00 / 1,000 delivered articles

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.

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 Article Text Export

Export the complete text of selected English Wikipedia articles for research agents and selected-page knowledge ingestion.

### Input

`articleTitles` accepts 1–10 English mainspace article titles or `https://en.wikipedia.org/wiki/` article URLs. The default is `Artificial intelligence`. Known non-article namespaces, action/query inputs, credentials, fragments, other hosts/editions, blank entries, unknown keys and over-limit inputs are rejected before network access. Redirects stay within allowed English article paths; canonical article IDs deduplicate aliases. Missing articles or disambiguation pages fail the batch so callers choose the intended article.

### Output

One row per unique resolved article with title/page/revision IDs, requested title aliases, canonical and stable revision attribution URLs, history attribution URL, full cleaned article text, and ordered sections with heading levels and IDs. Substantive tables/lists/text captions/references and visible imported-source attribution notices are retained; menus, edit controls, scripts, styles and navigation are removed. No text is silently truncated. Every row includes CC BY-SA 4.0 license URL, source Terms URL, and an explicit text-cleanup/media-omission modification notice. Article-specific additional license/attribution notices are preserved. A page whose article-text license cannot be confirmed fails rather than assuming the standard license. SUMMARY in key-value storage holds selected/delivered/alias counts.

### Limits

Acquisition deadline180seconds and delivery deadline90seconds; per-request timeout30seconds. Total transfer/decoded budget64MiB; staged output24MiB. 10 input entries and at most 10 output articles. Only allowed ordinary `/wiki/` article HTML and robots are fetched with an identifying User-Agent, sequentially at least one second between attempts. `/api/`, `/w/`, Special/User/File/etc namespaces and linked media are never fetched. Maximum 5MB per HTML response; oversized articles fail visibly. No search, multilingual editions, site-wide dumps, arbitrary URLs, browser, or external paid API. Source shape/revision/license changes, auth blocks, rate limits and timeouts fail before output.

### Pricing

One `article-delivered` event per validated unique article saved at $0.001. No start fee/trial events. Complete selected-article coverage and licenses are checked before saving. Apify event budget caps selection before retrieval; if it cannot cover the input entries, fail before requests/charges. Redirect aliases deduplicated into one delivered article incur one event. Repeated runs charge delivered articles again. No charge for failures, aliases or SUMMARY.

### Privacy

Only selected public encyclopedia text is collected. Contributor/editor history, account pages, private information, cookies, headers and credentials are excluded. Article text can itself discuss public biographical facts; the Actor does not extract contact profiles. Media files and their separately licensed content are not copied. Preserve attribution and share-alike requirements when reusing exported text.

# Actor input Schema

## `articleTitles` (type: `array`):

1–10 English mainspace article titles or exact English article URLs. One billable record per unique resolved article. Other editions, namespaces and actions are unsupported.

## Actor input object example

```json
{
  "articleTitles": [
    "Artificial intelligence"
  ]
}
```

# Actor output Schema

## `results` (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 = {};

// Run the Actor and wait for it to finish
const run = await client.actor("jpmarketdata/wikipedia-article-text-export").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 = {}

# Run the Actor and wait for it to finish
run = client.actor("jpmarketdata/wikipedia-article-text-export").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 '{}' |
apify call jpmarketdata/wikipedia-article-text-export --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,jpmarketdata/wikipedia-article-text-export"
        }
    }
}
```

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/vXQ9bClor1TaXQqY2/builds/owd5zVX9hCUy4wn6T/openapi.json
