Looking for the overview — what this API returns, what it costs, and a call you can run without a key? See the Wikipedia API page →
Media, Film & Knowledge

Wikipedia API & Scraper

The Wikipedia API returns encyclopedia data as clean JSON.

16 actionsLive JSON1,000 free credits$0.67–$1.50 / 1,000 creditsMCP-ready
Get a free keyOpen in playground

🤖 Using an AI assistant? Copy this link into ChatGPT / Claude / Cursor — it reads every endpoint and parameter instantly and tells you if this API fits your use case.

The primary summary endpoint returns a page's title, extract, description, thumbnail, coordinates, Wikidata QID and content URL, and you can pull a full page, search, entity_facts, pageviews, related pages and autocomplete. It is built for knowledge apps, RAG pipelines and research that need Wikipedia and Wikidata content without a scraper. One ReefAPI key, one shared credit pool, the standard envelope.

Reference

Three ways to name the same subject, and only one of them travels

A Wikipedia record carries several identifiers and they are not interchangeable. Picking the wrong one is why a stored reference breaks after an article is renamed, or points at something unrelated the moment you switch languages. Values measured on the Ada Lovelace article.

IdentifierMeasured valueWhat it survives
title"Ada Lovelace"nothing — it changes when editors rename the article, and it is different in every language
pageid974renames, but NOT languages. Page 974 on en.wikipedia is an entirely unrelated article on de.wikipedia.
wikibase_item / qidQ7259both. The Wikidata QID is the same subject in all 360+ language editions — this is the one to store.
url / mobile_urlhttps://en.wikipedia.org/wiki/Ada_Lovelacenothing — it is built from the current title, underscores and all
thumbnail330 × 427a pre-scaled image for lists
originalimage957 × 1239the full-resolution file — do not load it into a grid

Two different licences ship in the same API and both arrive in an attribution object on the response. Article text and geosearch are Wikipedia content under CC-BY-SA 4.0, which obliges you to attribute and to share alike. Pageview traffic comes from the Wikimedia Analytics API under CC0 1.0, with no obligation at all. Keep the attribution object with the data; it is the record of which rule applies to which field.

Live example

Real request and response JSON

Captured from the indexed primary action, search, on .

Captured request
{
  "method": "POST",
  "url": "https://api.reefapi.com/wikipedia/v1/search",
  "headers": {
    "x-api-key": "$REEF_KEY",
    "content-type": "application/json"
  },
  "body": {
    "query": "quantum computing"
  }
}
Captured response
{
  "ok": true,
  "meta": {
    "api": "wikipedia",
    "endpoint": "search",
    "mode": "live",
    "latency_ms": 513.2,
    "record_count": 10,
    "bytes": 4896,
    "cache_hit": false,
    "completeness_pct": 100,
    "requests": 1,
    "lang": "en",
    "total": 5988
  },
  "data": {
    "results": [
      {
        "title": "Quantum computing",
        "pageid": 25220,
        "snippet": "quantum computing (abbreviated 'n.quantum computing') is an unconventional process of computing that uses neuromorphic computing to perform quantum operations",
        "snippet_html": "<span class=\"searchmatch\">quantum</span> <span class=\"searchmatch\">computing</span> (abbreviated &#039;n.<span class=\"searchmatch\">quantum</span> <span class=\"searchmatch\">computing</span>&#039;) is an unconventional process of <span class=\"searchmatch\">computing</span> that uses neuromorphic <span class=\"searchmatch\">computing</span> to perform <span class=\"searchmatch\">quantum</span> operations",
        "wordcount": 14328,
        "size": 133478,
        "timestamp": "[redacted-phone]T23:00:54Z"
      },
      {
        "title": "Superconducting quantum computing",
        "pageid": 1730328,
        "snippet": "quantum computing is a branch of quantum computing and solid-state physics that implements superconducting electronic circuits as qubits in a quantum",
        "snippet_html": "<span class=\"searchmatch\">quantum</span> <span class=\"searchmatch\">computing</span> is a branch of <span class=\"searchmatch\">quantum</span> <span class=\"searchmatch\">computing</span> and solid-state physics that implements superconducting electronic circuits as qubits in a <span class=\"searchmatch\">quantum</span>",
        "wordcount": 10506,
        "size": 98879,
        "timestamp": "[redacted-phone]T06:38:04Z"
      },
      {
        "title": "Timeline of quantum computing and communication",
        "pageid": 191911,
        "snippet": "timeline of quantum computing and communication. Erwin Schrödinger publishes a theorem setting the basis for quantum steering and the limits of quantum state",
        "snippet_html": "timeline of <span class=\"searchmatch\">quantum</span> <span class=\"searchmatch\">computing</span> and communication. Erwin Schrödinger publishes a theorem setting the basis for <span class=\"searchmatch\">quantum</span> steering and the limits of <span class=\"searchmatch\">quantum</span> state",
        "wordcount": 23262,
        "size": 245064,
        "timestamp": "[redacted-phone]T16:37:54Z"
      }
    ],
    "total": 5988,
    "query": "quantum computing",
    "suggestion": null,
    "next_offset": 10,
    "attribution": {
      "source": "Wikipedia",
      "license": "CC-BY-SA 4.0",
      "note": "Text from Wikipedia, the free encyclopedia (wikipedia.org)"
    }
  }
}
Actions

What the Wikipedia API does

ActionDescriptionConcrete use caseKey params
summarypage summary: extract, description, thumbnail, coordinates, wikibase QID, urls (lang= any of 360+ editions)Content platforms call summary to get page summary.title, lang
pagefull article: plain-text body + internal links + image list + categories + external links (content=false → structure only)Research tools call page to get full article.title, lang, content, links_limit, images_limit
searchfull-text search → ranked pages (snippet/pageid/wordcount) + totalhits; enrich= adds extract/thumbnail/QIDCommunity analysts call search to get full-text search → ranked pages (snippet/pageid/wordcount) + totalhits; enrich= adds extract/….query, lang, limit, offset, enrich
entity_factsWikidata facts for a QID or title: label/description/aliases + resolved human-readable facts{prop:value} + key_facts + identifiers + image/coordsMedia monitors call entity_facts to get wikidata facts for a QID or title.id, qid, title, query, lang, ...
pageviewsdaily/monthly traffic for an article over a date range → series + total + averageContent platforms call pageviews to get daily/monthly traffic for an article over a date range → series + total + average.title, lang, start, end, days, ...
relatedpages related to a title; enrich= adds extract/thumbnailResearch tools call related to get pages related to a title; enrich= adds extract/thumbnail.title, lang, limit, enrich
autocompletetypeahead title suggestionsCommunity analysts call autocomplete to get typeahead title suggestions.q, lang, limit
geosearchWikipedia pages near a coordinate or around a titleMedia monitors call geosearch to get wikipedia pages near a coordinate or around a title.lat, lon, coord, title, radius, ...
on_this_dayhistorical events/births/deaths/holidays for a month-day (kind=all|selected|events|births|deaths|holidays)Content platforms call on_this_day to get historical events/births/deaths/holidays for a month-day (kind=all|selected|events|births|dea….month, day, date, kind, limit, ...
top_articlesmost-viewed articles for a given date (trending)Research tools call top_articles to get most-viewed articles for a given date (trending).date, limit, access, include_special, lang
category_memberslist the pages, sub-categories or files that belong to a Wikipedia category (cmtype=page|subcat|file); paginate with meta.next/cmcontinueCommunity analysts call category_members to list the pages, sub-categories or files that belong to a Wikipedia category (cmtype=page|subc….category, lang, limit, cmtype, cmcontinue
langlinksfull cross-language map for a title: every edition's {lang, title, url, langname, autonym} plus a langmap{lang:title} lookup (the page action only returns the count)Media monitors call langlinks to get full cross-language map for a title.title, lang, limit
randomone or more random articles; enrich= adds extract/thumbnail/QIDContent platforms call random to get one or more random articles; enrich= adds extract/thumbnail/QID.lang, limit, enrich
revisionsedit history of an article: revid, parentid, timestamp, user, comment, size, tags; from/to window the rangeResearch tools call revisions to get edit history of an article.title, lang, limit, from, to
htmlrendered article HTML (REST Parsoid) — or raw wiki markup with format=wikitextCommunity analysts call html to get rendered article HTML (REST Parsoid).title, lang, format
featuredWikimedia featured-content feed for a date: tfa (today's featured article), image-of-the-day, in-the-news, most-read and on-this-day (blocks vary by language/date)Media monitors call featured to get wikimedia featured-content feed for a date.date, lang
Code samples

Call search from your stack

curl -X POST https://api.reefapi.com/wikipedia/v1/search \
  -H "x-api-key: $REEF_KEY" \
  -H "content-type: application/json" \
  -d '{"query":"quantum computing"}'
MCP one-liner
Ask your MCP-connected assistant: call reefapi.wikipedia.search with {"query":"quantum computing"}.
Use cases

Who uses this API and why

  • RAG pipelines call summary to ground an AI assistant in encyclopedic facts.
  • Knowledge apps use entity_facts and related to build topic pages.
  • Research tools use pageviews to measure public attention on a subject.
FAQ

Questions developers ask before integrating

Which identifier should I store in my database?

The QID. A measured summary of Ada Lovelace returned title "Ada Lovelace", pageid 974 and wikibase_item "Q7259" side by side. Titles get renamed by editors and differ per language. pageids survive renames but are scoped to one language edition, so 974 means something completely different on the German wiki. Q7259 is the same human on every one of the 360+ editions, which is what makes it the only safe join key — and langlinks turns it back into whatever title you need.

Why does entity_facts return the same information twice?

Because the two shapes serve different code. key_facts is a normalized set with predictable snake_case keys — instance_of, born, died, birthplace, deathplace, citizenship, occupation, spouse, father, mother, children — which is what you bind to a UI. facts is the raw Wikidata property set with human labels and spaces in the keys: "birth name", "place of birth", "field of work", "Commons category". Measured, both were present in one response. Use key_facts unless you need a property the normalized set does not cover, then fall back to facts.

Are the values in key_facts strings?

Sometimes. In a single measured response, sex_or_gender was the string "female" while occupation was an array of eight entries and children was an array of three. The type follows the underlying Wikidata property's cardinality, so a person with one occupation and a person with eight do not return the same shape. Normalize every value to an array on the way in, or your renderer will print a string character by character the first time it meets a single-valued field. value_cap limits how many entries a multi-valued property returns.

How accurate are the entity facts?

They are Wikidata statements passed through unchanged, which means they are as good as Wikidata is — and Wikidata contains contested, outdated and occasionally plainly wrong claims, especially for historical figures where statements get attached loosely. We do not correct or filter them, because a silent correction would leave you unable to tell our guess from the source. If a fact matters, the QID gives you the Wikidata item to check the statement's own references.

What date format does pageviews use?

Two, in the same response, so read carefully. A measured 7-day pull returned start "20260819" and end "20260826" — compact YYYYMMDD with no separators — while every entry inside daily[] used ISO "2026-08-19". Alongside the series you get total 26637 and average 3805.3 precomputed. The response also echoes project, granularity, access and agent, which matters because the default agent is all-agents: that figure includes bot traffic, and filtering to human users gives a materially lower and usually more honest number.

What does country "XX" mean in geosearch results?

It is a placeholder for a location Wikipedia could not attribute to a country, not a real ISO code. A measured search around Istanbul returned three results within 41 metres: a landmark with country "TR", an event page with country "XX", and a third with country null. Filter on it and you will silently drop historical events, undersea features and disputed places. dist_m is a float in metres and is reliable — a result at dist_m 0 sits exactly on the coordinate you passed.

Why is coordinates null on an article?

Because the subject is not a place. Measured, the summary and the entity record for a person both returned coordinates null, while geosearch results carry lat and lon directly. Only articles about a physical location have coordinates, so treat null as the normal case and use type to tell what kind of article you are looking at — the measured summary reported type "standard", and disambiguation pages and redirects report their own values.

How do I read the same article in another language?

Pass lang on any action for a direct read, and use langlinks when you want to know which editions exist for a subject before you ask. The QID from a summary is the reliable bridge: get Q7259 once, then resolve it wherever you need it rather than translating the title yourself. Coverage depth varies enormously between editions — an article that is comprehensive in English can be two sentences elsewhere — so check the extract length before you treat a translation as equivalent content.

What is the Wikipedia API?

Wikipedia API is a ReefAPI endpoint group for article summaries, search and structured facts. It returns live JSON through POST requests under /wikipedia/v1.

Is the Wikipedia API free to try?

Yes. ReefAPI starts with 1,000 free credits, no card required. Wikipedia calls use the same shared credit balance as every other ReefAPI engine.

Do I need a Wikipedia login or account?

No login to Wikipedia is needed for the API response. You call ReefAPI with your x-api-key header, and the playground can run live examples before you create a production key.

How fresh is the Wikipedia data?

The page example is captured from a live summary call, and production requests fetch live data through ReefAPI rather than a static sample.

How many credits does the Wikipedia API use?

Wikipedia actions currently cost 1-2 credits per successful call. Failed or blocked calls are free, and all APIs draw from one credit pool.

Can I call Wikipedia from an AI assistant or MCP client?

Yes. Connect ReefAPI once through MCP and your assistant can call wikipedia actions with the same key, credit pool and JSON envelope used by normal REST requests.

docs / wikipedia

Wikipedia

Article summaries, search and structured facts.

base /wikipedia/v116 endpoints
post/wikipedia/v1/summary1 credit

page summary: extract, description, thumbnail, coordinates, wikibase QID, urls (lang= any of 360+ editions)

ParameterAllowed / rangeDescription
titlerequiredExact article title (case-sensitive first letter aside).
lang = enoptionalWikipedia language edition code (en, de, fr, ja, … 360+ editions). Default en.
Try in playground →
post/wikipedia/v1/page1 credit

full article: plain-text body + internal links + image list + categories + external links (content=false → structure only)

ParameterAllowed / rangeDescription
titlerequiredExact article title (case-sensitive first letter aside).
lang = enoptionalWikipedia language edition code (en, de, fr, ja, … 360+ editions). Default en.
content = trueoptionalfalse (or 0/no) → return article STRUCTURE only (links/images/categories), skip the plain-text body.
links_limit = 100optional1–500Max internal links to return (1-500); clamped.
images_limit = 50optional1–200Max images to return (1-200); clamped.
Try in playground →
post/wikipedia/v1/entity_facts2 credits

Wikidata facts for a QID or title: label/description/aliases + resolved human-readable facts{prop:value} + key_facts + identifiers + image/coords

ParameterAllowed / rangeDescription
idoptionalWikidata QID (e.g. Q937). Supply this OR `title`/`query` to resolve one.
titleoptionalArticle/entity title to resolve to a Wikidata QID. Supply this OR `id`.
lang = enoptionalWikipedia language edition code (en, de, fr, ja, … 360+ editions). Default en.
value_cap = 50optional1–200Max values kept per multi-valued Wikidata property (1-200); clamped.
Try in playground →
post/wikipedia/v1/pageviews1 credit

daily/monthly traffic for an article over a date range → series + total + average

ParameterAllowed / rangeDescription
titlerequiredArticle title to pull traffic for.
lang = enoptionalWikipedia language edition code (en, de, fr, ja, … 360+ editions). Default en.
startoptionalRange start date, YYYYMMDD or YYYY-MM-DD. Supply both start AND end, or use `days` instead.
endoptionalRange end date, YYYYMMDD or YYYY-MM-DD. Supply both start AND end, or use `days` instead.
days = 30optional1–1000Look-back window ending today, used when start/end are omitted (1-1000).
granularity = dailyoptionaldaily · monthlyBucket size. Anything not starting with 'month' is treated as daily.
access = all-accessoptionalall-access · desktop · mobile-app · mobile-webWikimedia Pageviews access channel (passed through to the REST API).
agent = all-agentsoptionalall-agents · user · spider · automatedWikimedia Pageviews agent class (passed through to the REST API).
Try in playground →
post/wikipedia/v1/autocompletefree

typeahead title suggestions

ParameterAllowed / rangeDescription
qrequiredTypeahead prefix to autocomplete.
lang = enoptionalWikipedia language edition code (en, de, fr, ja, … 360+ editions). Default en.
limit = 10optional1–50Max results (1-50, default 10); clamped.
Try in playground →
post/wikipedia/v1/geosearch1 credit

Wikipedia pages near a coordinate or around a title

ParameterAllowed / rangeDescription
latoptional-90–90Latitude. Provide lat+lon, OR `coord`, OR `title` for geosearch.
lonoptional-180–180Longitude (pairs with lat).
coordoptional'lat,lon' string — alternative to separate lat/lon params.
titleoptionalFind pages near THIS article's coordinates (alternative to lat/lon/coord).
radius = 1000optional10–10000Search radius in metres (10-10000); clamped.
limit = 10optional1–50Max results (1-50, default 10); clamped.
lang = enoptionalWikipedia language edition code (en, de, fr, ja, … 360+ editions). Default en.
Try in playground →
post/wikipedia/v1/on_this_day1 credit

historical events/births/deaths/holidays for a month-day (kind=all|selected|events|births|deaths|holidays)

ParameterAllowed / rangeDescription
monthoptional1–12Month 1-12 (pair with `day`), OR supply `date` instead. Defaults to today.
dayoptional1–31Day-of-month 1-31 (pairs with `month`).
dateoptionalDate whose month-day is used (MM-DD or YYYY-MM-DD). Alternative to month/day.
kind = alloptionalall · selected · events · births · deaths · holidaysWhich on-this-day category. An unknown value falls back to 'all'.
limit = 30optional1–100Max results (1-100, default 30); clamped.
lang = enoptionalWikipedia language edition code (en, de, fr, ja, … 360+ editions). Default en.
Try in playground →
post/wikipedia/v1/top_articles1 credit

most-viewed articles for a given date (trending)

ParameterAllowed / rangeDescription
dateoptionalDay to rank, YYYY-MM-DD or YYYYMMDD. Defaults to yesterday (today lags).
limit = 50optional1–1000Max results (1-1000, default 50); clamped.
access = all-accessoptionalall-access · desktop · mobile-app · mobile-webWikimedia Pageviews access channel (passed through to the REST API).
include_special = falseoptionalKeep special pages (Main_Page, Special:Search) in the ranking; default drops them.
lang = enoptionalWikipedia language edition code (en, de, fr, ja, … 360+ editions). Default en.
Try in playground →
post/wikipedia/v1/category_members1 credit

list the pages, sub-categories or files that belong to a Wikipedia category (cmtype=page|subcat|file); paginate with meta.next/cmcontinue

ParameterAllowed / rangeDescription
categoryrequiredCategory name, with or without the 'Category:' prefix (e.g. 'Physicists' or 'Category:1879 births').
lang = enoptionalWikipedia language edition code (en, de, fr, ja, … 360+ editions). Default en.
limit = 20optional1–500Max results (1-500, default 20); clamped.
cmtype = pageoptionalpage · subcat · fileWhich kind of category member to list. Unknown values fall back to 'page'.
cmcontinueoptionalPagination token from a previous response's meta.next — fetch the next batch.
Try in playground →
post/wikipedia/v1/random1 credit

one or more random articles; enrich= adds extract/thumbnail/QID

ParameterAllowed / rangeDescription
lang = enoptionalWikipedia language edition code (en, de, fr, ja, … 360+ editions). Default en.
limit = 1optional1–50Max results (1-50, default 1); clamped.
enrich = falseoptionalIf true, hydrate each result with extract + thumbnail + Wikidata QID (extra requests).
Try in playground →
post/wikipedia/v1/revisions1 credit

edit history of an article: revid, parentid, timestamp, user, comment, size, tags; from/to window the range

ParameterAllowed / rangeDescription
titlerequiredExact article title (case-sensitive first letter aside).
lang = enoptionalWikipedia language edition code (en, de, fr, ja, … 360+ editions). Default en.
limit = 10optional1–500Max results (1-500, default 10); clamped.
fromoptionalWindow start (ISO timestamp). Returns revisions at/after this point (newest-first). Optional.
tooptionalWindow end (ISO timestamp). Returns revisions at/before this point. Optional.
Try in playground →
post/wikipedia/v1/html2 credits

rendered article HTML (REST Parsoid) — or raw wiki markup with format=wikitext

ParameterAllowed / rangeDescription
titlerequiredExact article title (case-sensitive first letter aside).
lang = enoptionalWikipedia language edition code (en, de, fr, ja, … 360+ editions). Default en.
format = htmloptionalhtml · wikitextOutput flavour: rendered 'html' (default) or raw 'wikitext' source.
Try in playground →