Wikipedia Article API Documentation
The Wikipedia Article API returns one Wikipedia page by its title, page id, Wikipedia URL or Wikidata id, in any of 348 editions. The article comes with its page id, the id of the latest revision and the time of the last edit, the Wikidata id, the short description, the lead section as plain text, the lead image, the categories readers see and the links to the same subject in other editions, when the page has them.
Set text_format to add the whole page as plain text, as HTML with its sections, or as wikitext. A title that redirects returns the page it redirects to, with redirect_title naming the title you gave, and is_disambiguation marks a page that lists topics of the same name. is_featured_article and is_good_article mark the pages the edition rates as its featured and good articles. Watch revision_id to tell when a page is edited.
A page Wikipedia doesn't have, including a deleted one, a title Wikipedia doesn't accept, a special page, and a Wikidata item that is unknown or has no page in the edition return an error instead of the article.
API Parameters
Page
-
- Name
-
title - Required
- Optional
- Description
-
The title of the page, as Wikipedia shows it, such as
Albert Einstein, up to 255 bytes. Underscores count as spaces, and Wikipedia capitalizes the first letter. A title that redirects returns the page it redirects to.
Note: You must provide exactly one oftitle,page_id,urlorwikidata_id.
-
- Name
-
page_id - Required
- Optional
- Description
-
The Wikipedia page id, such as
604727. Ids are unique within one edition, so use the samelanguagethe id came from, such as thepage_idof a Wikipedia Search API result.
-
- Name
-
url - Required
- Optional
- Description
-
A link to a Wikipedia page, such as
https://en.wikipedia.org/wiki/Coffee. The desktop and mobile addresses of every edition work, with/wiki/followed by the title, or/w/index.phpwithcuridortitle. Chinese and Serbian variant paths such as/zh-tw/and/sr-el/also work. The link's address sets the edition. A link witholdidreturns the page's latest revision. The reported URL preserves the script variant, while article content uses the script returned by Wikipedia's API.
-
- Name
-
wikidata_id - Required
- Optional
- Description
-
A Wikidata item id, such as
Q937. Returns the item's page in the editionlanguagesets, and an error when the item has no page there.
Localization
-
- Name
-
language - Required
- Optional
- Description
-
The default parameter
endefines the Wikipedia edition, by the code in its address, such asdefor de.wikipedia.org. Check the full list of supported Wikipedialanguageeditions.
Text
-
- Name
-
text_format - Required
- Optional
- Description
-
Adds the whole page to the article. Without it, the article carries the lead section in
summary. Options are:plain- plain text intext, with each section heading written as== Heading ==. Tables are omitted. Thetextfield is omitted when Wikipedia returns an empty plain-text extract.html- HTML inhtml, with the page'ssectionswikitext- the wikitext source inwikitext
Engine
-
- Name
-
engine - Required
- Required
- Description
-
Parameter defines an engine that will be used to retrieve real-time data. It must be set to
wikipedia_article.
API key
-
- Name
-
api_key - Required
- Required
- Description
-
The
api_keyauthenticates your requests. Use it as a query parameter (https://www.searchapi.io/api/v1/search?api_key=YOUR_API_KEY) or in the Authorization header (Bearer YOUR_API_KEY).
Zero Data Retention
-
- Name
-
zero_retention - Enterprise Only
- Enterprise Only
- Required
- Optional
- Description
-
Set this parameter to
trueto disable all logging and persistent storage. No request parameters, HTML, or JSON responses are stored or logged. Suitable for high-compliance use cases. Debugging and support may be limited while enabled.
API Examples
Full Response
https://www.searchapi.io/api/v1/search?engine=wikipedia_article&title=Coffee
- Python
- Node
- Ruby
- Java
- Go
- PHP
- Bash
- R
- Kotlin
- Swift
- C#
- C
- C++
- requests
import requests
url = "https://www.searchapi.io/api/v1/search"
params = {
"engine": "wikipedia_article",
"title": "Coffee"
}
response = requests.get(url, params=params)
print(response.text)
{
"search_metadata": {
"id": "search_1ACbw1ajAJ7Dg7sqyTSabUEJ",
"status": "Success",
"created_at": "2026-11-26T21:18:12Z",
"request_time_taken": 2.97,
"parsing_time_taken": 0.02,
"total_time_taken": 2.99,
"request_url": "https://en.wikipedia.org/wiki/Coffee",
"html_url": "https://www.searchapi.io/api/v1/searches/search_1ACbw1ajAJ7Dg7sqyTSabUEJ.html",
"json_url": "https://www.searchapi.io/api/v1/searches/search_1ACbw1ajAJ7Dg7sqyTSabUEJ"
},
"search_parameters": {
"engine": "wikipedia_article",
"title": "Coffee",
"language": "en"
},
"article": {
"page_id": 604727,
"title": "Coffee",
"link": "https://en.wikipedia.org/wiki/Coffee",
"language": "en",
"text_direction": "ltr",
"namespace": 0,
"wikidata_id": "Q8486",
"description": "Brewed beverage",
"revision_id": 1386713577,
"updated_at": "2026-11-20T03:10:18Z",
"size_bytes": 147086,
"summary": "Coffee is a beverage brewed from roasted, ground coffee beans. Dark-colored and bitter, coffee has a stimulating effect on humans due to its caffeine content; however decaffeinated coffee is also commercially available. There are also various coffee substitutes.\nCoffee production begins when the see...",
"thumbnail": "https://thumb.wikimedia.org/wikipedia/commons/thumb/e/e4/Latte_and_dark_coffee.jpg/960px-Latte_and_d...",
"image": {
"link": "https://upload.wikimedia.org/wikipedia/commons/e/e4/Latte_and_dark_coffee.jpg?utm_source=en.wikipedi...",
"width": 3200,
"height": 2000
},
"categories": [
{
"title": "Coffee",
"link": "https://en.wikipedia.org/wiki/Category:Coffee"
},
"..."
],
"language_links": [
{
"language": "af",
"title": "Koffie",
"link": "https://af.wikipedia.org/wiki/Koffie"
},
"..."
]
}
}
Wikidata Id in the Japanese Edition
https://www.searchapi.io/api/v1/search?engine=wikipedia_article&language=ja&wikidata_id=Q937
- Python
- Node
- Ruby
- Java
- Go
- PHP
- Bash
- R
- Kotlin
- Swift
- C#
- C
- C++
- requests
import requests
url = "https://www.searchapi.io/api/v1/search"
params = {
"engine": "wikipedia_article",
"wikidata_id": "Q937",
"language": "ja"
}
response = requests.get(url, params=params)
print(response.text)
{
"article": {
"page_id": 4008,
"title": "アルベルト・アインシュタイン",
"link": "https://ja.wikipedia.org/wiki/%E3%82%A2%E3%83%AB%E3%83%99%E3%83%AB%E3%83%88%E3%83%BB%E3%82%A2%E3%82%...",
"language": "ja",
"text_direction": "ltr",
"namespace": 0,
"wikidata_id": "Q937",
"description": "ドイツ出身の理論物理学者 (1879–1955)",
"revision_id": 111705139,
"updated_at": "2026-11-09T11:58:54Z",
"size_bytes": 126317,
"summary": "アルベルト・アインシュタイン(ドイツ語: Albert Einstein、1879年3月14日 - 1955年4月18日)は、ドイツ生まれの理論物理学者。\n特殊相対性理論、一般相対性理論、相対論的宇宙論、ブラウン運動に関する揺動散逸定理、光量子仮説、アインシュタイン模型、零点エネルギーの導入、半古典型のシュレディンガー方程式、ボース=アインシュタイン凝縮等多数の業績で知られる。\nそれまでの物理学の認識を根本から変え、「20世紀最大の物理学者」とも評される。",
"thumbnail": "https://thumb.wikimedia.org/wikipedia/commons/thumb/2/28/Albert_Einstein_Head_cleaned.jpg/960px-Albe...",
"image": {
"link": "https://upload.wikimedia.org/wikipedia/commons/2/28/Albert_Einstein_Head_cleaned.jpg?utm_source=ja.w...",
"width": 4530,
"height": 5607
},
"categories": [
{
"title": "1879年生",
"link": "https://ja.wikipedia.org/wiki/Category:1879%E5%B9%B4%E7%94%9F"
},
"..."
],
"language_links": [
{
"language": "ab",
"title": "Еинштеин, Алберт",
"link": "https://ab.wikipedia.org/wiki/%D0%95%D0%B8%D0%BD%D1%88%D1%82%D0%B5%D0%B8%D0%BD,_%D0%90%D0%BB%D0%B1%D..."
},
"..."
]
}
}
Redirected Title
https://www.searchapi.io/api/v1/search?engine=wikipedia_article&title=Einstein
- Python
- Node
- Ruby
- Java
- Go
- PHP
- Bash
- R
- Kotlin
- Swift
- C#
- C
- C++
- requests
import requests
url = "https://www.searchapi.io/api/v1/search"
params = {
"engine": "wikipedia_article",
"title": "Einstein"
}
response = requests.get(url, params=params)
print(response.text)
{
"article": {
"page_id": 736,
"title": "Albert Einstein",
"link": "https://en.wikipedia.org/wiki/Albert_Einstein",
"language": "en",
"text_direction": "ltr",
"namespace": 0,
"wikidata_id": "Q937",
"description": "German-born theoretical physicist (1879–1955)",
"revision_id": 1387775702,
"updated_at": "2026-11-25T11:10:54Z",
"size_bytes": 240585,
"is_good_article": true,
"redirect_title": "Einstein",
"summary": "Albert Einstein (14 March 1879 – 18 April 1955) was a German-born theoretical physicist best known for developing the theory of relativity. Einstein also made important contributions to quantum theory. His mass–energy equivalence formula E = mc2, which arises from special relativity, has been called...",
"thumbnail": "https://thumb.wikimedia.org/wikipedia/commons/thumb/2/28/Albert_Einstein_Head_cleaned.jpg/960px-Albe...",
"image": {
"link": "https://upload.wikimedia.org/wikipedia/commons/2/28/Albert_Einstein_Head_cleaned.jpg?utm_source=en.w...",
"width": 4530,
"height": 5607
},
"categories": [
{
"title": "1879 births",
"link": "https://en.wikipedia.org/wiki/Category:1879_births"
},
"..."
],
"language_links": [
{
"language": "ab",
"title": "Еинштеин, Алберт",
"link": "https://ab.wikipedia.org/wiki/%D0%95%D0%B8%D0%BD%D1%88%D1%82%D0%B5%D0%B8%D0%BD,_%D0%90%D0%BB%D0%B1%D..."
},
"..."
]
}
}
Disambiguation Page
https://www.searchapi.io/api/v1/search?engine=wikipedia_article&title=Mercury
- Python
- Node
- Ruby
- Java
- Go
- PHP
- Bash
- R
- Kotlin
- Swift
- C#
- C
- C++
- requests
import requests
url = "https://www.searchapi.io/api/v1/search"
params = {
"engine": "wikipedia_article",
"title": "Mercury"
}
response = requests.get(url, params=params)
print(response.text)
{
"article": {
"page_id": 19007,
"title": "Mercury",
"link": "https://en.wikipedia.org/wiki/Mercury",
"language": "en",
"text_direction": "ltr",
"namespace": 0,
"wikidata_id": "Q48397",
"description": "Topics referred to by the same term",
"revision_id": 1387325808,
"updated_at": "2026-11-23T12:17:32Z",
"size_bytes": 8299,
"is_disambiguation": true,
"summary": "Mercury most commonly refers to:\n\nMercury (planet), the closest planet to the Sun\nMercury (element), a chemical element\nMercury (mythology), a Roman deity\nMercury or The Mercury may also refer to:",
"categories": [
{
"title": "Disambiguation pages",
"link": "https://en.wikipedia.org/wiki/Category:Disambiguation_pages"
},
"..."
],
"language_links": [
{
"language": "anp",
"title": "पारा",
"link": "https://anp.wikipedia.org/wiki/%E0%A4%AA%E0%A4%BE%E0%A4%B0%E0%A4%BE"
},
"..."
]
}
}
HTML With Sections, by URL
https://www.searchapi.io/api/v1/search?engine=wikipedia_article&text_format=html&url=https%3A%2F%2Fde.wikipedia.org%2Fwiki%2FBerlin
- Python
- Node
- Ruby
- Java
- Go
- PHP
- Bash
- R
- Kotlin
- Swift
- C#
- C
- C++
- requests
import requests
url = "https://www.searchapi.io/api/v1/search"
params = {
"engine": "wikipedia_article",
"url": "https://de.wikipedia.org/wiki/Berlin",
"text_format": "html"
}
response = requests.get(url, params=params)
print(response.text)
{
"article": {
"page_id": 2552494,
"title": "Berlin",
"link": "https://de.wikipedia.org/wiki/Berlin",
"language": "de",
"text_direction": "ltr",
"namespace": 0,
"wikidata_id": "Q64",
"description": "Hauptstadt und bevölkerungsreichste Stadt der Bundesrepublik Deutschland",
"revision_id": 272507625,
"updated_at": "2026-11-26T18:06:08Z",
"size_bytes": 277890,
"is_good_article": true,
"summary": "Berlin ([bɛr'li:n] ) ist die Hauptstadt und ein Land der Bundesrepublik Deutschland. Die Großstadt ist mit rund 3,7 Millionen Einwohnern die bevölkerungsreichste und mit 891 Quadratkilometern die flächengrößte Gemeinde Deutschlands sowie die bevölkerungsreichste Stadt der Europäischen Union. In der ...",
"thumbnail": "https://thumb.wikimedia.org/wikipedia/commons/thumb/e/ec/Flag_of_Berlin.svg/960px-Flag_of_Berlin.svg...",
"image": {
"link": "https://upload.wikimedia.org/wikipedia/commons/e/ec/Flag_of_Berlin.svg?utm_source=de.wikipedia.org&u...",
"width": 1000,
"height": 600
},
"categories": [
{
"title": "Berlin",
"link": "https://de.wikipedia.org/wiki/Kategorie:Berlin"
},
"..."
],
"language_links": [
{
"language": "ab",
"title": "Берлин",
"link": "https://ab.wikipedia.org/wiki/%D0%91%D0%B5%D1%80%D0%BB%D0%B8%D0%BD"
},
"..."
],
"html": "<div class=\"mw-content-ltr mw-parser-output\" lang=\"de\" dir=\"ltr\"><div class=\"hintergrundfarbe1 rahmenfarbe1 navigation-not-searchable noprint hatnote navigation-not-searchable\" style=\"border-bottom-style: solid; border-bottom-width: 1px; font-size:95%; margin-bottom:1em; padding: 0.25em; overflow: h...",
"sections": [
{
"level": 2,
"number": "1",
"title": "Geographie",
"anchor": "Geographie",
"link": "https://de.wikipedia.org/wiki/Berlin#Geographie"
},
"..."
]
}
}
Plain Text
https://www.searchapi.io/api/v1/search?engine=wikipedia_article&language=ja&text_format=plain&wikidata_id=Q937
- Python
- Node
- Ruby
- Java
- Go
- PHP
- Bash
- R
- Kotlin
- Swift
- C#
- C
- C++
- requests
import requests
url = "https://www.searchapi.io/api/v1/search"
params = {
"engine": "wikipedia_article",
"wikidata_id": "Q937",
"language": "ja",
"text_format": "plain"
}
response = requests.get(url, params=params)
print(response.text)
{
"article": {
"page_id": 4008,
"title": "アルベルト・アインシュタイン",
"link": "https://ja.wikipedia.org/wiki/%E3%82%A2%E3%83%AB%E3%83%99%E3%83%AB%E3%83%88%E3%83%BB%E3%82%A2%E3%82%...",
"language": "ja",
"text_direction": "ltr",
"namespace": 0,
"wikidata_id": "Q937",
"description": "ドイツ出身の理論物理学者 (1879–1955)",
"revision_id": 111705139,
"updated_at": "2026-11-09T11:58:54Z",
"size_bytes": 126317,
"summary": "アルベルト・アインシュタイン(ドイツ語: Albert Einstein、1879年3月14日 - 1955年4月18日)は、ドイツ生まれの理論物理学者。\n特殊相対性理論、一般相対性理論、相対論的宇宙論、ブラウン運動に関する揺動散逸定理、光量子仮説、アインシュタイン模型、零点エネルギーの導入、半古典型のシュレディンガー方程式、ボース=アインシュタイン凝縮等多数の業績で知られる。\nそれまでの物理学の認識を根本から変え、「20世紀最大の物理学者」とも評される。",
"thumbnail": "https://thumb.wikimedia.org/wikipedia/commons/thumb/2/28/Albert_Einstein_Head_cleaned.jpg/960px-Albe...",
"image": {
"link": "https://upload.wikimedia.org/wikipedia/commons/2/28/Albert_Einstein_Head_cleaned.jpg?utm_source=ja.w...",
"width": 4530,
"height": 5607
},
"categories": [
{
"title": "1879年生",
"link": "https://ja.wikipedia.org/wiki/Category:1879%E5%B9%B4%E7%94%9F"
},
"..."
],
"language_links": [
{
"language": "ab",
"title": "Еинштеин, Алберт",
"link": "https://ab.wikipedia.org/wiki/%D0%95%D0%B8%D0%BD%D1%88%D1%82%D0%B5%D0%B8%D0%BD,_%D0%90%D0%BB%D0%B1%D..."
},
"..."
],
"text": "アルベルト・アインシュタイン(ドイツ語: Albert Einstein、1879年3月14日 - 1955年4月18日)は、ドイツ生まれの理論物理学者。\n特殊相対性理論、一般相対性理論、相対論的宇宙論、ブラウン運動に関する揺動散逸定理、光量子仮説、アインシュタイン模型、零点エネルギーの導入、半古典型のシュレディンガー方程式、ボース=アインシュタイン凝縮等多数の業績で知られる。\nそれまでの物理学の認識を根本から変え、「20世紀最大の物理学者」とも評される。\n\n\n== 業績 ==\n1905年に特殊相対性理論を発表した。以前から論理的に展開されていた相対性原理(アンリ・ポアンカレ、ジョゼフ・ラーモ..."
}
}
Page Not Found
https://www.searchapi.io/api/v1/search?engine=wikipedia_article&title=Searchapi+research+missing+page+8bb14a7a
- Python
- Node
- Ruby
- Java
- Go
- PHP
- Bash
- R
- Kotlin
- Swift
- C#
- C
- C++
- requests
import requests
url = "https://www.searchapi.io/api/v1/search"
params = {
"engine": "wikipedia_article",
"title": "Searchapi research missing page 8bb14a7a"
}
response = requests.get(url, params=params)
print(response.text)
{
"error": "Wikipedia has no page titled `Searchapi research missing page 8bb14a7a` in the en edition."
}