Wikipedia API

Get Wikipedia data as clean JSON with one key: 22 endpoints, 1 to 5 credits per call, the same response shape as every other platform.

What you get#

Onekey exposes Wikipedia as 22 endpoints behind one API key: 5 endpoints return one record (data is an object) and 17 endpoints return a list (data is an array). Every answer uses the same envelope (success, data, metadata, error), the cost is reported in metadata.credits_charged, and fields are mapped onto the unified schema so the code you write for Wikipedia also works for the rest of the knowledge & reference category.

Endpoints#

EndpointWhat it doesParametersCreditsStatus
articleWikipedia article summary (English).title*1stable
categoriesCategories a Wikipedia page belongs to (first 50).title*5stable
category_membersPages in a Wikipedia category (first 50).category*5stable
extractPlain-text intro extract of a Wikipedia article (follows redirects).title*1stable
featuredWikipedia featured article of the day (today's featured article for a date).year*, month*, day*1stable
intro_htmlHTML intro of a Wikipedia article plus its plain-text form.title*1stable
langlinksEquivalent article titles in other languages.title*5stable
linksOutgoing article links of a Wikipedia page (first 50).title*5stable
media_listMedia files used on a Wikipedia page.title*5stable
most_readMost-read Wikipedia articles for a day (Wikimedia pageviews top).year*, month*, day*5stable
nearbyWikipedia articles near a latitude/longitude (10 km).lat*, lon*5stable
on_this_dayWikipedia 'On this day' historical events for a month/day.month*, day*5stable
on_this_day_birthsWikipedia 'On this day' births for a month/day.month*, day*5stable
on_this_day_deathsWikipedia 'On this day' deaths for a month/day.month*, day*5stable
on_this_day_holidaysWikipedia 'On this day' holidays for a month/day.month*, day*5stable
pageviewsDaily pageviews for one Wikipedia article between two dates (YYYYMMDD).title*, start*, end*5stable
pageviews_aggregateDaily aggregate English Wikipedia pageviews between two dates (YYYYMMDD).start*, end*5stable
randomA random Wikipedia article summary.-1stable
relatedArticles related to a Wikipedia article (morelike search).title*5stable
revisionsTen most recent revisions of a Wikipedia page.title*5stable
searchSearch Wikipedia articles (English).q*5stable
suggestTitle autocomplete suggestions for a search prefix.q*5stable

A * marks a required parameter. Each endpoint name links to its reference page with the full parameter table, caching window and a recorded response.

Make a request#

This calls wikipedia.article (1 credit, stable). Replace YOUR_API_KEY with your key; sign up, no card. 1,000 free credits cover the open-platform endpoints. Hard-to-reach platforms (X, TikTok, Instagram, Reddit, and others marked on their page) need a verified email and a purchased pack.

curl "https://api.onekey.dev/v1/wikipedia/article?title=Alan%20Turing" \
  -H "x-api-key: YOUR_API_KEY"

Fields you get back#

These unified fields come back from Wikipedia, with the same names as on every other platform. The count is how many of its 22 mapped endpoints return the field; a field the source lacks is null, never missing. 8 platform-specific fields (ext.<name>) come on top, documented on each endpoint page.

FieldTypeEndpoints
content.titlestring20
content.textstring13
content.idstring11
content.urlURL7
content.yearinteger4
content.updatedAtISO 8601 date3
engagement.viewsinteger3
media.thumbnailUrlURL3
author.usernamestring1
content.createdAtISO 8601 date1
content.languagestring1
content.typestring1
place.latnumber1
place.lonnumber1

The full schema is in Unified schema.

Pricing#

Wikipedia calls cost 1 to 5 credits, flat per endpoint. Free when served from cache (0.2 credit for a cached response over 100 KB). Invalid, failed or not-found calls are not charged. See pricing for credit packs.