Getting Started with Wikipedia REST API

← Wikipedia REST API

When to use this API

When you need a quick factual summary of a topic from Wikipedia — a one-line description, a paragraph extract, a thumbnail image, or a link to the full article. The REST API returns clean JSON with no scraping. Its strongest feature is the description field: a Wikidata-curated one-liner that disambiguates terms ("Small domesticated carnivorous mammal" for Cat, not the programming language or the musical). The API also exposes full article HTML, mobile-optimized content, media lists, and related articles — all under /page/{endpoint}/{title}. For most agent use cases the summary endpoint is the one you want. This API serves English Wikipedia only; swap the subdomain for other languages.

Getting a topic summary

"What exactly is a cat?" The /page/summary/{title} endpoint returns a structured object with a Wikidata description, a plain-text extract, and image URLs in a single unauthenticated call. Use the article title as the path parameter, replacing spaces with underscores.

curl "https://en.wikipedia.org/api/rest_v1/page/summary/Cat" | head -c 10000
{
  "type": "standard",
  "title": "Cat",
  "description": "Small domesticated carnivorous mammal",
  "extract": "The cat, also called domestic cat and house cat, is a small carnivorous mammal. It is an obligate carnivore, requiring a predominantly meat-based diet. Its retractable claws are adapted to killing small prey species such as mice and rats. It has a strong, flexible body, quick reflexes, and sharp teeth, and its night vision and sense of smell are well developed. It is a social species, but a solitary hunter and a crepuscular predator.",
  "thumbnail": {
    "source": "https://upload.wikimedia.org/wikipedia/commons/thumb/1/15/Cat_August_2010-4.jpg/330px-Cat_August_2010-4.jpg",
    "width": 330,
    "height": 202
  },
  "originalimage": {
    "source": "https://upload.wikimedia.org/wikipedia/commons/1/15/Cat_August_2010-4.jpg",
    "width": 3640,
    "height": 2226
  },
  "wikibase_item": "Q146",
  "content_urls": {
    "desktop": { "page": "https://en.wikipedia.org/wiki/Cat" },
    "mobile": { "page": "https://en.wikipedia.org/wiki/Cat" }
  },
  "lang": "en",
  "timestamp": "2026-04-11T05:38:32Z"
}

The description field ("Small domesticated carnivorous mammal") is a Wikidata short description — curated by editors, not auto-generated. It disambiguates terms the article title cannot: "Java" the island, "Java" the language, and "Java" the coffee each have different description values. The type field is "standard" for regular articles and "disambiguation" for pages that list multiple meanings — check type before quoting extract to a user, because a disambiguation extract reads as a list, not a definition. The extract is plain text with no HTML markup, ready to quote. Both thumbnail (pre-sized, roughly 320px wide) and originalimage (full resolution) are included when available, but some articles lack images entirely.

A cat is a small domesticated carnivorous mammal — an obligate carnivore with retractable claws, strong night vision, and crepuscular hunting habits. It is a social species but hunts alone.

Pitfalls

One-line summary for the user

I can get a concise Wikipedia summary — title, one-line Wikidata description, paragraph extract, and thumbnail — for any topic in a single unauthenticated GET, with descriptions that disambiguate terms better than the article title alone.