
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 68 million articles across 348 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 roughly five 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 access tier sized for it, and the free one starts instantly.
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 and 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: 68 million articles across 348 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: 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: 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_entitiesfield connects every article to its Wikidata item, 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
categoriesarray. 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 and the GNU Free Documentation License, 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.

Source: NASA on English Wikipedia
How leading companies use the Wikipedia API
How to access Wikipedia data
Wikipedia data is delivered through the Wikimedia Enterprise APIs: three APIs, one account, one access token, and the same JSON schema across all of them.
- Snapshot API: download the sum of all human knowledge as bulk dumps, one bundle per language edition, for offline processing and training.
- On-demand API: retrieve specific articles from any language edition, refreshed every two weeks on a free account and daily on a paid one.
- Realtime API: stream Wikipedia's edits as they happen.
Example call to download the latest English Wikipedia snapshot:
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:
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 to get an access token. Getting started 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 shows a complete live response for an English Wikipedia article, refreshed from the production API, and the Data Dictionary documents every field in it. The API reference has the full schema and a request builder.
Wikipedia and Wikidata together
Wikipedia holds articles written for people. Wikidata 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.
"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:
curl -L 'https://api.enterprise.wikimedia.com/v2/wikidata/items/Q309751' \ -H 'Authorization: Bearer ACCESS_TOKEN'Frequently Asked Questions
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 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 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. The API reference 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, 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.
Can I download all of Wikipedia?
Yes. The Snapshot API 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 text runs to tens of gigabytes 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.
What are the Wikipedia API rate limits?
Wikimedia Enterprise limits are per account tier rather than per IP, and they are published on the pricing page. 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 this 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 348 Wikipedia editions and every other Wikimedia project, and pre-parsed Structured Contents so you are not 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 covers the graph in full.
Get Started
Access Wikipedia, Wikidata, and the rest of the Wikimedia 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.