Wikipedia API

Beginner's Pick Open Data / No Auth Required Beginner HTTPS
Free to Use
79 B
Measured Score 0 50 100 Speed 21/30 Consistency 17/20 Security 18/20 Browser access 15/15 Transparency 8/15 TESTED 2026-08-10

Overview

The Wikipedia API (MediaWiki API) gives you programmatic access to Wikipedia articles, search functionality, page metadata, and revision history—completely free with no authentication required for read operations. It supports JSON responses and is easy to call from any language with a simple HTTP GET request. Whether you want to fetch article summaries, search for pages, or retrieve full wikitext, this API makes it straightforward.

Beginner Tip

Use the REST API endpoint https://en.wikipedia.org/api/rest_v1/page/summary/{title} for the simplest way to get a plain-text article summary—no OAuth or query parameters needed, just replace {title} with the article name.

Measurement Record

What actually happened when we called this API from our own infrastructure. Every value below was recorded by the request, not copied from the provider's documentation.

Request
GET https://en.wikipedia.org/api/rest_v1/page/summary/JavaScript
Result
HTTP 200 · application/json · 2,556 bytes · compressed
Response time
112 ms (median of 3) · fastest 104 ms
Transport
TLSv1.3 · TLS_AES_128_GCM_SHA256 · certificate issued by Let's Encrypt
Browser CORS
Allowed — Access-Control-Allow-Origin: *
Served by
production-tls
Recorded
2026-08-10

Fields Returned

Top-level fields present in the response we captured, with the type and value we actually received.

Field Type Value received
type string standard
title string JavaScript
displaytitle string <span lang="en" dir="ltr"><span class="mw-pag…
namespace object {2 fields}
wikibase_item string Q2005
titles object {3 fields}
pageid integer 9845
thumbnail object {3 fields}
originalimage object {3 fields}
lang string en
dir string ltr
revision string 1366826697
tid string bc837da8-8c19-11f1-8f98-1432fb13bb6a
timestamp string (date) 2026-07-30T13:22:39Z

Captured Response

Captured from a real request to https://en.wikipedia.org/api/rest_v1/page/summary/JavaScript on 2026-08-10. Long arrays and nested objects are truncated to keep the shape readable.

JSON Response · Captured
{
  "type": "standard",
  "title": "JavaScript",
  "displaytitle": "<span lang=\"en\" dir=\"ltr\"><span class=\"mw-page-title-main\">JavaScript</span></span>",
  "namespace": {
    "id": 0,
    "text": ""
  },
  "wikibase_item": "Q2005",
  "titles": {
    "canonical": "JavaScript",
    "normalized": "JavaScript",
    "display": "<span lang=\"en\" dir=\"ltr\"><span class=\"mw-page-title-main\">JavaScript</span></span>"
  },
  "pageid": 9845,
  "thumbnail": {
    "source": "https://upload.wikimedia.org/wikipedia/commons/thumb/d/d7/Logo_of_TC39.svg/330px-Logo_of_TC39.svg.png?utm_source=en.wikipedia.org&utm_campaign=api&utm_conten…",
    "width": 330,
    "height": 330
  },
  "originalimage": {
    "source": "https://upload.wikimedia.org/wikipedia/commons/thumb/d/d7/Logo_of_TC39.svg/960px-Logo_of_TC39.svg.png?utm_source=en.wikipedia.org&utm_campaign=api&utm_conten…",
    "width": 512,
    "height": 512
  },
  "lang": "en",
  "dir": "ltr",
  "revision": "1366826697",
  "tid": "bc837da8-8c19-11f1-8f98-1432fb13bb6a",
  "timestamp": "2026-07-30T13:22:39Z",
  "…": "(5 more fields)"
}

Field Reference

title The canonical title of the Wikipedia article.
pageid Unique numeric identifier for the Wikipedia page, stable across title changes.
thumbnail URL and dimensions of the article's lead image thumbnail, if available.
lang Language code of the Wikipedia edition, e.g., en for English, fr for French.

Implementation Example

Calls a real endpoint of this API. Replace any placeholder credentials with your own key.

Request
const url = "https://en.wikipedia.org/api/rest_v1/page/summary/JavaScript";
const response = await fetch(url);
if (!response.ok) throw new Error(`Request failed: ${response.status}`);
const data = await response.json();
console.log(data);

What Can You Build?

Note: These code examples are AI-generated and unverified. Always refer to the official API documentation for accurate usage.

How This API Fails

We deliberately sent this API a broken request and recorded exactly what came back on 2026-08-10. Knowing the shape of an error before you hit it makes error handling much easier to write.

HTTP 400 Requesting a path that does not exist application/json
{
  "status": 400,
  "type": "Internal error"
}

Common Errors & Troubleshooting

Generated guidance based on this API's documentation, not observed by us. Treat it as a starting point and check against the provider's own error reference.

404 Not Found The article title is misspelled or uses incorrect capitalization (Wikipedia titles are case-sensitive after the first character).
Use the search endpoint first (?action=query&list=search&srsearch=your+term) to find the exact title, then fetch the article.
Disambiguation page returned instead of article The title matches a disambiguation page that lists multiple possible articles.
Append the topic in parentheses to disambiguate, e.g., Mercury_(planet) instead of Mercury, or parse the disambiguation list to present options to the user.
Rate limiting or blocks on high-volume requests Sending many requests rapidly without a proper User-Agent header.
Always include a descriptive User-Agent header identifying your app (e.g., MyApp/1.0 ([email protected]))—this is required by Wikipedia's API policy.

Measured Score Breakdown

Live HTTP request to the API endpoint

Speed 21/30
Consistency 17/20
Security 18/20
Browser access 15/15
Transparency 8/15
Endpoint Response Time 112ms

Fully tested on Aug 10, 2026

Technical Specifications

Auth No Auth
HTTPS REQUIRED
CORS UNKNOWN
Category Open Data
Difficulty Beginner
Endpoint last called: 2026-08-10

Related Tags

Similar APIs

View All →