<!-- Wikimedia Enterprise. Canonical page: https://enterprise.wikimedia.com/project-data/wikipedia-api/ -->

# Wikipedia API

## The definitive source for open knowledge and LLM training

**Wikipedia** is one of the most visited websites on the internet, because it is the largest single online source of human-created knowledge: over 69 million articles across 360+ language editions. It is also one of the last places where strict policies guarantee that what you read was written and checked by people, held to a neutral point of view, and revised as the world moves. At over 3 edits every second, Wikipedia changes about as fast as the events it describes. That makes it a prime source for training LLMs, grounding AI agents, building RAG and reasoning systems, and keeping any knowledge base current.

**Is there a Wikipedia API?** Yes, several. The one built and run by the Wikimedia Foundation for high-volume and commercial use is **Wikimedia Enterprise**. Whether you are shipping a small app or training a frontier model, there is an account sized for it, and a free one starts instantly.

[Sign Up for Free Access](https://dashboard.enterprise.wikimedia.com/signup/?utm_source=website&utm_medium=cta&utm_campaign=signup&utm_content=wikipedia-api)

### Why use the Wikipedia API?

Wikipedia is the reference standard for human-verified knowledge. It is a peer-reviewed corpus, which is exactly what grounding and factual accuracy require, and it is consistently the largest single source in published AI training-data breakdowns. It powers voice assistants, search knowledge panels, and knowledge graphs across the industry.

- **Factual ground truth:** unlike raw web-scraped text, Wikipedia content is governed by [verifiability](https://en.wikipedia.org/wiki/Wikipedia:Verifiability) and [neutral point of view](https://en.wikipedia.org/wiki/Wikipedia:Neutral_point_of_view) policies. Real people patrol, discuss, revert, and reach consensus on every change.
- **Transparent process:** every article carries a full public revision history and a talk page where its disputes were argued out. The reasoning behind the text is part of the record, not hidden behind an editorial wall.
- **Massive multilingual corpus:** over 69 million articles across 360+ language editions, which is an unmatched dataset for machine translation and cross-lingual NLP.
- **Structured metadata:** beyond prose, the API exposes infoboxes, categories, templates, and the Wikidata item behind each article, ready for knowledge graph work.
- **Realtime updates:** breaking news, scientific results, and elections land on Wikipedia in minutes. The Realtime API streams those changes as they happen.

### What data do the Wikipedia APIs return?

The Wikimedia Enterprise APIs let you pull everything from a single article or download a full Wikipedia dump for a knowledge graph, database, or training run.

- **[Structured Contents](https://enterprise.wikimedia.com/api/structured-contents/):** you do not have to parse messy wikitext. Structured Contents delivers abstracts, sections, infoboxes, images, and links as clean JSON, so you can use Wikipedia's knowledge immediately with no post-processing.
- **[Credibility signals](https://enterprise.wikimedia.com/api/credibility-signals/):** actionable metadata for judging whether a given edit should be trusted. RevertRisk scores how likely an edit is to be reverted, and ReferenceRisk gauges whether it cited an adequate source.
- **Linked data:** the `additional_entities` field connects every article to its [Wikidata item](https://enterprise.wikimedia.com/project-data/wikidata-api/), which in turn links the same concept across every language edition and every other Wikimedia project.
- **Wikitext and HTML:** articles are authored in wikitext, a markup language of its own. The API returns the body in both wikitext, which preserves the markup and its template references, and rendered HTML, which expands those templates the way a reader sees them. One call gets you both.
- **Categories:** almost every article belongs to one or more categories, returned in the `categories` array. Categories are the fastest route to topic-based subsets and to edges in a knowledge graph.
- **Rich metadata:** when the page was last edited and by whom, when it was created, its protection status, the templates it uses, its watcher count, and more.
- **Openly licensed:** Wikipedia is licensed under [CC BY-SA](https://creativecommons.org/licenses/by-sa/4.0/) and the [GNU Free Documentation License](https://www.gnu.org/licenses/fdl-1.3.html), so you can reuse it for any purpose, including commercially, as long as you attribute the source and share derivative work under the same license.

*Image: The English Wikipedia article on NASA, showing the expanded section outline in the left rail, a cited lead section, the agency infobox with its seal, insignia and structured overview fields, and a language menu listing 155 editions.*

Source: [NASA on English Wikipedia](https://en.wikipedia.org/wiki/NASA)

### How leading companies use the Wikipedia API

[Ecosia enriches search results and AI answers](https://enterprise.wikimedia.com/blog/ecosia-enriches-search-results-and-ai-answers/)

[Reef Media fact-checks and verifies sources](https://enterprise.wikimedia.com/blog/reef-media-ai/)

[Get Started with the Wikipedia API](https://dashboard.enterprise.wikimedia.com/signup/?utm_source=website&utm_medium=cta&utm_campaign=signup&utm_content=wikipedia-api)

## How to access Wikipedia data

Wikipedia data is delivered through the [Wikimedia Enterprise APIs](https://enterprise.wikimedia.com/api/): three APIs, one account, one access token, and the same JSON schema across all of them.

- **[Snapshot API](https://enterprise.wikimedia.com/docs/snapshot/):** download the sum of all human knowledge as bulk dumps, one bundle per language edition, for offline processing and training.
- **[On-demand API](https://enterprise.wikimedia.com/docs/on-demand/):** retrieve specific articles from any language edition, refreshed every two weeks on a free account and daily on a paid one.
- **[Realtime API](https://enterprise.wikimedia.com/docs/realtime/):** stream Wikipedia's edits as they happen.

Example call to download the latest English Wikipedia snapshot:

```bash
curl -L 'https://api.enterprise.wikimedia.com/v2/snapshots/enwiki_namespace_0/download' \
  -H 'Authorization: Bearer ACCESS_TOKEN'
```

Example call to get a single article from English Wikipedia:

```bash
curl -L 'https://api.enterprise.wikimedia.com/v2/articles/NASA' \
  -H 'Content-Type: application/json' \
  -H 'Authorization: Bearer ACCESS_TOKEN' \
  -d '{"filters":[{"field":"is_part_of.identifier","value":"enwiki"}],"limit":1}'
```

Getting a `403: Forbidden` error? Sign up for a free Wikimedia Enterprise account and use the [Login endpoint](https://enterprise.wikimedia.com/docs/authentication/) to get an access token. [Getting started](https://enterprise.wikimedia.com/docs/) walks through the whole first call.

## What comes back in a Wikipedia response

A single On-demand response carries the article body in both HTML and wikitext, the revision and its editor, the linked Wikidata entity, categories, templates, protection status, license, and the lead image.

The [API products page](https://enterprise.wikimedia.com/api/#production-api-payload-example) shows a complete live response for an English Wikipedia article, refreshed from the production API, and the [Data Dictionary](https://enterprise.wikimedia.com/docs/data-dictionary/) documents every field in it. The [API reference](https://enterprise.wikimedia.com/docs/api/) has the full schema and a request builder.

## Wikipedia and Wikidata together

**Wikipedia** holds articles written for people. **[Wikidata](https://enterprise.wikimedia.com/project-data/wikidata-api/)** holds the structured facts and relationships behind that same knowledge, stored as triples in a graph database that machines can traverse directly.

The two connect through the article's Q-number. Pull an article, read `additional_entities`, and you have a key into every other language version of it and into the same concept on Wiktionary, Wikiquote, Wikivoyage, and the rest.

```json
"additional_entities": [
  {
    "identifier": "Q309751",
    "url": "https://www.wikidata.org/entity/Q309751",
    "aspects": ["C.P18", "S", "T"]
  }
]
```

Pass that Q-number to the Wikidata endpoint to get the structured record:

```bash
curl -L 'https://api.enterprise.wikimedia.com/v2/wikidata/items/Q309751' \
  -H 'Authorization: Bearer ACCESS_TOKEN'
```

## Wikipedia API FAQ

### Is the Wikipedia API free?

Yes. Anyone can sign up for a free Wikimedia Enterprise account, with no credit card. A free account covers the Snapshot API, so you can download complete language editions, and a monthly allowance of On-demand requests, including the Structured Contents endpoints. It suits developers, researchers, and small teams who need large amounts of knowledge without real-time freshness. For high volume, hourly or real-time updates, and production support, [paid plans](https://enterprise.wikimedia.com/pricing/) are available.

### Do I need a Wikipedia API key?

Not a key, a token. Wikimedia Enterprise uses standard JWT authentication rather than a static API key: you exchange your account credentials at the Login endpoint for an access token that lasts 24 hours, alongside a refresh token that lasts 90 days. [Authentication](https://enterprise.wikimedia.com/docs/authentication/) covers the full flow, and both SDKs handle the refresh for you.

### Where can I find the Wikipedia API documentation?

At [enterprise.wikimedia.com/docs](https://enterprise.wikimedia.com/docs/). The [API reference](https://enterprise.wikimedia.com/docs/api/) documents every endpoint, field, and response schema, and the prose guides cover authentication, filtering, identifiers, snapshots, on-demand requests, and real-time streaming.

### How do I use the Wikipedia API in Python?

Wikimedia Enterprise maintains [SDKs for Python and Go](https://enterprise.wikimedia.com/docs/#software-development-kits-sdks), so you can drop API calls into an existing codebase without hand-rolling the auth and pagination. Every endpoint is also a plain HTTPS request, so `requests` works fine if you would rather not add a dependency.

### How big is Wikipedia?

Wikipedia has over 69 million articles across 360+ language editions, and English Wikipedia alone has over 7.4 million. As a download, English Wikipedia's article snapshot, which carries both HTML and wikitext, is about 150 GB compressed. Its pre-parsed Structured Contents snapshot is about 35 GB (both measured in November 2026).

### Can I download all of Wikipedia?

Yes. The [Snapshot API](https://enterprise.wikimedia.com/docs/snapshot/) publishes complete dumps of each language edition in a consistent, machine-readable format, and it is included with a free account. Larger bundles are split into chunks you can pull in parallel. English Wikipedia's article snapshot is over 100 GB compressed; the full revision history of every edition is a great deal larger than that, which is why snapshots are scoped to current article text.

### Is there a Wikipedia dataset?

Yes. A pre-parsed Wikipedia Structured Contents dataset of the English and French editions is available on [Hugging Face](https://enterprise.wikimedia.com/blog/hugging-face-dataset/) and [Kaggle](https://enterprise.wikimedia.com/blog/kaggle-dataset/). For other language editions, use the [Snapshot API](https://enterprise.wikimedia.com/docs/snapshot/).

### What are the Wikipedia API rate limits?

Wikimedia Enterprise limits are per account rather than per IP, and they are published on the [pricing page](https://enterprise.wikimedia.com/pricing/). If you are hitting `429 Too Many Requests` against the public MediaWiki endpoints, that is the signal to move the workload here: snapshot downloads and On-demand quotas are designed for exactly the volume that trips those limits.

### How is Wikimedia Enterprise different from the MediaWiki API?

The public MediaWiki API is built for wiki operations, one request at a time, shared with everyone and rate limited accordingly. Wikimedia Enterprise is built for consuming the corpus: bulk snapshots, a service level, a stable schema shared across all 360+ Wikipedia editions and every other Wikimedia project, and pre-parsed [Structured Contents](https://enterprise.wikimedia.com/api/structured-contents/) so you are not writing a wikitext parser.

### How do I parse Wikipedia wikitext?

You may not need to. Wikitext relies on templates that only expand when a page renders, so a parser has to handle nested templates and a long tail of edge cases. [Structured Contents](https://enterprise.wikimedia.com/api/structured-contents/), a Beta feature, returns sections, infoboxes, and references as pre-parsed JSON, and every article response also carries the rendered HTML. [Databricks used Structured Contents](https://enterprise.wikimedia.com/blog/how-databricks-parsed-wikipedia-to-markdown-with-python/) to convert English Wikipedia to Markdown without writing a wikitext parser.

### What is the difference between Wikipedia and Wikidata?

Wikipedia is prose written for people; Wikidata is the same knowledge as machine-readable triples. Most Wikipedia infoboxes are built from Wikidata, and every article links to its Wikidata item. The [Wikidata API page](https://enterprise.wikimedia.com/project-data/wikidata-api/) covers the graph in full.

## Get started with the Wikipedia API

Access Wikipedia, Wikidata, and the rest of the [Wikimedia project data](https://enterprise.wikimedia.com/project-data/) through one unified API with consistent JSON output. Unlock the power of trusted knowledge on high-availability infrastructure, and get started with free instant access today.

[Sign Up for Free Access](https://dashboard.enterprise.wikimedia.com/signup/?utm_source=website&utm_medium=cta&utm_campaign=signup&utm_content=wikipedia-api)
