Access wikipedia summaries

When the user asks about a person, place, concept, event, or any encyclopedic topic and needs a concise factual summary — reach for Wikipedia REST API. Returns title, description, extract, thumbnail in one unauthenticated GET.

access-wikipedia-summaries · v1 · updated 2026-04-16

Agents: This page is a SKILL.md-style capability guide. For JSON, call GET /api/skills/access-wikipedia-summaries. To drop this into a local Claude Code install, copy the frontmatter + body below into ~/.claude/skills/access-wikipedia-summaries/SKILL.md.

When to use this skill

When the user asks about a person, place, concept, event, or any encyclopedic topic and needs a concise factual summary — reach for Wikipedia's REST API. One unauthenticated GET returns title, Wikidata description, plain-text extract, thumbnail, and article URLs. For full article body content or raw HTML, this is the wrong skill — the HTML and parse endpoints return 100 KB+ payloads.

Your best first call

curl "https://en.wikipedia.org/api/rest_v1/page/summary/Python_(programming_language)"

No auth. No key. Returns a JSON object with the structured summary.

The key fields you will use:

Fallbacks (when the best call isn't enough)

Pitfalls

One-line summary for the user

I can fetch concise Wikipedia article summaries — title, description, extract, thumbnail — in a single unauthenticated GET, but I need the exact article title with underscores and disambiguation suffixes.

APIs this skill uses

Wikipedia API · primary · verified

Wikipedia Action API and REST API for accessing article content, search, and metadata. Provides endpoints for retrieving page content, summaries, search results, and random articles.

Generated from

Wikipedia API tutorial Getting Started with Wikipedia API

SKILL.md source (frontmatter + body)
---
name: access-wikipedia-summaries
description: When the user asks about a person, place, concept, event, or any encyclopedic topic and needs a concise factual summary — reach for Wikipedia REST API. Returns title, description, extract, thumbnail in one unauthenticated GET.
---

## When to use this skill

When the user asks about a person, place, concept, event, or any encyclopedic topic and needs a concise factual summary — reach for Wikipedia's REST API. One unauthenticated GET returns title, Wikidata description, plain-text extract, thumbnail, and article URLs. For full article body content or raw HTML, this is the wrong skill — the HTML and parse endpoints return 100 KB+ payloads.

## Your best first call

```bash
curl "https://en.wikipedia.org/api/rest_v1/page/summary/Python_(programming_language)"
```

No auth. No key. Returns a JSON object with the structured summary.

The key fields you will use:

- `title` — canonical article title
- `type` — `"standard"` for articles, `"disambiguation"` for disambiguation pages; check this before using the extract
- `description` — Wikidata short description (e.g. "General-purpose programming language"), editor-supplied metadata that disambiguates topics at a glance
- `extract` — plain-text article extract, the content you relay to the user
- `thumbnail.source` — URL to the lead image
- `content_urls.desktop.page` — link to the full Wikipedia article
- `wikibase_item` — Wikidata entity ID (e.g. "Q28865")

## Fallbacks (when the best call isn't enough)

- **Don't know the exact article title?** → OpenSearch: `curl "https://en.wikipedia.org/w/api.php?action=opensearch&search=machine+learning&limit=5&format=json"` returns ranked title suggestions with URLs. Pick the right title, then call the summary endpoint.
- **Want a random article for discovery?** → `curl "https://en.wikipedia.org/api/rest_v1/page/random/title"` returns a random article title and metadata. Pass the returned title to the summary endpoint.

## Pitfalls

- **Disambiguation pages look like articles.** The summary endpoint returns `"type": "disambiguation"` for disambiguation pages — a page like "Python" lists multiple meanings instead of answering the question. Always check `type` before using `extract`.
- **Titles use underscores and parenthetical disambiguation.** `Python_(programming_language)` works; bare spaces will redirect unpredictably. Always replace spaces with underscores and include the disambiguation suffix when the title is ambiguous.
- **Action API calls require `format=json`.** Omit it from `/w/api.php` calls and you get a rendered HTML help page, not JSON.
- **OpenSearch descriptions are often empty strings.** The third array element in the OpenSearch response is frequently blank — do not rely on it for disambiguation; use the summary endpoint's `type` field instead.

## One-line summary for the user

I can fetch concise Wikipedia article summaries — title, description, extract, thumbnail — in a single unauthenticated GET, but I need the exact article title with underscores and disambiguation suffixes.

« Back to all skills