Wikipedia APIWikipedia.org ↗
Search Wikipedia articles, retrieve full text and metadata, and browse category trees via 3 structured endpoints. JSON responses with pageid, extract, and categories.
What is the Wikipedia API?
The Wikipedia API provides 3 endpoints that cover article search, detailed content retrieval, and category browsing across the entirety of English Wikipedia. search_articles returns ranked results with snippets, word counts, and timestamps. get_article_details returns the full article extract, categories, revision ID, and byte length by either title or page ID. get_category_members lets you walk the category tree with typed pagination.
curl -X GET 'https://api.parse.bot/scraper/cabed3f6-f0a2-4ce6-ab14-897da89a04db/search_articles?limit=5&query=artificial+intelligence&offset=0' \ -H 'X-API-Key: $PARSE_API_KEY'
Typed, relational, agent-ready
A generated client with real types, enums, and the links between objects — the structure a flat JSON response can't carry. Autocompletes in your editor and reads cleanly to coding agents.
- Fully typed · autocompletes
- Objects link to objects
- Typed errors & pagination
Typed Python client. Set up the SDK in your uv project, then pull this API’s typed client:
uv add parse-sdk uv run parse init uv run parse add --marketplace wikipedia-api
uv run parse add --marketplace pulls a pinned snapshot of this canonical API — it won’t change underneath you. To customize it, subscribe and swap to your own copy.
from parse_apis.wikipedia_api import Wikipedia, Article, ArticleSummary, CategoryMember, Category, MemberType
wiki = Wikipedia()
# Search for articles about machine learning
for summary in wiki.articlesummaries.search(query="machine learning"):
print(summary.title, summary.wordcount, summary.timestamp)
# Get full details for the first result
results = wiki.articlesummaries.search(query="quantum computing")
for summary in results:
article = summary.details()
print(article.title, article.url, article.length)
for cat in article.categories:
print(cat)
break
# Browse a category using constructible Category
science = wiki.category("Artificial intelligence")
for member in science.members(type=MemberType.SUBCAT):
print(member.title, member.pageid, member.namespace)
# Fetch an article directly by page ID
article = wiki.articles.get(pageid="23862")
print(article.title, article.extract, article.language)
Full-text search over Wikipedia articles. Returns matching articles ranked by relevance with titles, snippets, word counts, sizes, and timestamps. Paginated via integer offset; each page contains up to `limit` results. The response includes total_hits for the query and next_offset for advancing.
| Param | Type | Description |
|---|---|---|
| limit | integer | Number of results to return per page (1-50). |
| queryrequired | string | Search query string. |
| offset | integer | Pagination offset for fetching subsequent pages of results. |
{
"type": "object",
"fields": {
"query": "search query string that was used",
"offset": "integer current pagination offset",
"articles": "array of article summaries each containing pageid, title, snippet, size, wordcount, and timestamp",
"total_hits": "integer total number of matching articles",
"next_offset": "integer offset for the next page, or null if no more pages"
},
"sample": {
"data": {
"query": "artificial intelligence",
"offset": 0,
"articles": [
{
"size": 271608,
"title": "Artificial intelligence",
"pageid": 1164,
"snippet": "Artificial intelligence (AI) is the capability of computational systems to perform tasks typically associated with human intelligence, such as learning",
"timestamp": "2026-06-10T15:13:30Z",
"wordcount": 26939
}
],
"total_hits": 27884,
"next_offset": 5
},
"status": "success"
}
}About the Wikipedia API
Endpoints and What They Return
The search_articles endpoint accepts a query string and returns an articles array where each item includes pageid, title, snippet, size, wordcount, and timestamp. The total_hits field tells you how many results exist across all pages, and next_offset provides a direct value to pass into the offset parameter for the next page. Results are limited to a maximum of 50 per call.
Article Details
get_article_details requires either a title (e.g., 'Artificial intelligence') or a pageid (e.g., '21721040'). By default it returns the introductory extract only; set full_extract to 'true' to retrieve the complete article text. The response includes url, length in bytes, language, last_revision_id, content_model, and a categories array listing every category the article belongs to.
Browsing Category Trees
get_category_members accepts a category name without the Category: prefix and returns up to 50 members per call. The type parameter controls what is returned: 'page' for articles, 'subcat' for subcategories, or 'file' for media files. Each member object contains pageid, title, and namespace. Pagination is token-based: the next_continue field from one response is passed as the continue parameter in the next call, and is null when no further results exist.
The Wikipedia API is a managed, monitored endpoint for Wikipedia.org — not a raw scraper you maintain. Every endpoint is automatically health-checked on a schedule, and when Wikipedia.org changes and a check fails, the API is automatically queued for repair and re-verified. It is built to keep working as the site underneath it changes.
This isn't an official Wikipedia.org API — it's an independent, maintained REST wrapper over public data. Where the source has no official API (or only a limited one), Parse gives you a stable contract over a source that never promised one, and keeps it current. Need a new endpoint or field? You can revise it yourself in plain English and the agent rebuilds it against the live site in minutes — contributing the change back to the shared API is free.
Will this API break when the source site changes?+
Is this an official API from the source site?+
Can I fix or extend this API myself if I need a new endpoint or field?+
What happens if I call an endpoint that has an issue?+
- Build a knowledge base ingestion pipeline using
full_extractto pull complete article text by title. - Populate autocomplete or search suggestions using
search_articleswithsnippetandtitlefields. - Map topic hierarchies by recursively calling
get_category_memberswithtype: 'subcat'. - Cross-reference article freshness using the
timestampfrom search results andlast_revision_idfrom article details. - Resolve ambiguous entity names to canonical Wikipedia
pageidvalues for use in downstream data pipelines. - Enumerate all articles within a subject area (e.g., 'Machine learning') by paginating through
get_category_memberswithtype: 'page'. - Collect structured metadata — word count, byte length, language, content model — for corpus analysis.
| Tier | Price | Credits/month | Rate limit |
|---|---|---|---|
| Free | $0/mo | 100 | 5 req/min |
| Hobby | $30/mo | 1,000 | 20 req/min |
| Developer | $100/mo | 5,000 | 100 req/min |
One credit = one API call regardless of which marketplace API you call. Exceeding the rate limit returns a 429 response. Authenticate with the X-API-Key header.
Does Wikipedia have an official developer API?+
What does `get_article_details` return by default versus with `full_extract: 'true'`?+
extract field contains only the introductory section of the article. Setting full_extract to 'true' replaces that with the complete article text. All other response fields — url, title, length, pageid, language, categories, content_model, and last_revision_id — are returned regardless of that parameter.Does the API cover languages other than English?+
language field is returned in get_article_details responses, but the current endpoints are scoped to English Wikipedia. Non-English Wikipedia editions are not covered. You can fork this API on Parse and revise it to target a different language edition.Can I retrieve article revision history or diff data?+
last_revision_id for the current article state; full revision history and diff data are not available through these endpoints. You can fork this API on Parse and revise it to add a revision-history endpoint.How does pagination work across the three endpoints, and are the mechanisms consistent?+
search_articles uses an integer offset that you read from next_offset in each response. get_category_members uses an opaque string token: read next_continue from one response and pass it as the continue parameter in the next. Both return a null sentinel when no further pages exist. get_article_details is a single-record lookup and has no pagination.