Wikipedia
Mediawiki Encyclopedia
- Authentication
- No auth
- HTTPS
- Yes
- CORS
- Unknown
- Category
- Open Data
- Documentation / URL
- https://www.mediawiki.org/wiki/API:Main_page
Overview
The MediaWiki Action API powers Wikipedia and every other MediaWiki site: search articles, fetch page content, read summaries and categories, list images, and much more — free, keyless, and open. It’s the canonical free encyclopedia API for knowledge apps, glossaries, and research tools.
Quick Start
Search pages (verified live):
curl "https://en.wikipedia.org/w/api.php?action=query&list=search&srsearch=openai&format=json&srlimit=3"
Get a page summary (extract + thumbnail):
curl "https://en.wikipedia.org/api/rest_v1/page/summary/Machine_learning"
Fetch raw wikitext or parsed HTML of a page:
curl "https://en.wikipedia.org/w/api.php?action=parse&page=Machine_learning&format=json&prop=text§ion=0"
Get the pageviews for a page:
curl "https://wikimedia.org/api/rest_v1/metrics/pageviews/per-article/en.wikipedia/all-access/user/Machine_learning/daily/20260101/20260131"
Key parameters
action=query— the workhorse:list=search,prop=extracts(plain intro),prop=categories…format=json— always request JSON (there’s alsoformatversion=2for cleaner output).maxlag&continue— respect them for large jobs (the API enforces continuation).- REST API endpoints (e.g.
rest_v1/page/summary/) are simpler for common read tasks.
Authentication
None — keyless (a User-Agent identifying your app is politely required; anonymous access is fine).
Rate Limits & Notes
- Free and open; anonymous requests are rate-limited per IP (roughly a few hundred/sec burst — be conservative).
- Set a descriptive User-Agent — Wikimedia blocks generic/bot-like agents.
- Content is CC BY-SA 4.0 — attribution is required for reuse.
- Use
prop=extracts&explaintextfor clean plain-text intros (great for snippets).
FAQ
Is the Wikipedia API free? Yes — free, keyless, no registration.
How do I get a clean article intro?
prop=extracts&explaintext&exintro returns the plain-text lead section.
Can I use it in production? Yes — many production apps use it; just set a proper User-Agent and respect rate limits.
More in Open Data
| API | Auth | HTTPS | CORS | |
|---|---|---|---|---|
| 18F Unofficial US Federal Government API Development | No auth | No | Unknown | ↗ |
| AcreLens Land suitability scoring API for any US property: off-grid, rural, recreational, investment | API Key | Yes | Unknown | ↗ |
| API Setu An Indian Government platform that provides a lot of APIS for KYC, business, education & employment | No auth | Yes | Yes | ↗ |
| Archive.org The Internet Archive | No auth | Yes | No | ↗ |
| Black History Facts Contribute or search one of the largest black history fact databases on the web | API Key | Yes | Yes | ↗ |