WikipediaData[article]
gives the plain text of the specified Wikipedia article.
WikipediaData[{article1,article2,...}]
gives the texts for each of the articles.
WikipediaData[article,property,options]
gives the value of the specified property, modified by optional parameters, for the given Wikipedia article.
WikipediaData["Category"category,property,options]
gives the value of the specified property, modified by optional parameters, for the given Wikipedia category.
WikipediaData["PageID"pageid,property,options]
gives the value of the specified property, modified by optional parameters, for the article corresponding to the given numerical Wikipedia page ID.
WikipediaData
WikipediaData[article]
gives the plain text of the specified Wikipedia article.
WikipediaData[{article1,article2,...}]
gives the texts for each of the articles.
WikipediaData[article,property,options]
gives the value of the specified property, modified by optional parameters, for the given Wikipedia article.
WikipediaData["Category"category,property,options]
gives the value of the specified property, modified by optional parameters, for the given Wikipedia category.
WikipediaData["PageID"pageid,property,options]
gives the value of the specified property, modified by optional parameters, for the article corresponding to the given numerical Wikipedia page ID.
Details and Options
- WikipediaData utilizes MediaWiki's API to retrieve article and category contents and metadata from Wikipedia.
- An article may be specified as a string or a Wolfram Language entity. The string "RandomArticle" will select a random Wikipedia article.
- Properties related to article content and metadata include:
-
"ArticlePlaintext" plain text version of article content "ArticleWikicode" article content in Wikicode "ArticleContributors" list of article contributors "PageID" Wikipedia page ID number "SummaryPlaintext" brief article summary in plain text "SummaryWikicode" brief article summary in Wikicode "Title" article title - Properties about linked articles and websites include:
-
"LinksList" list of Wikipedia articles referenced in the specified article "LinksRules" list of rules representing links out from the specified article "BacklinksList" list of Wikipedia articles that reference the specified article "BacklinksRules" list of rules representing links into the specified article "SeeAlsoList" list of Wikipedia pages referenced in the specified article's See Also section "SeeAlsoRules" list of rules of Wikipedia pages referenced in the specified article's See Also section "ExternalLinks" list of external URLs referenced in the specified article - Properties about categories include:
-
"CategoryLinks" list of rules representing links between a specified category and its subcategories "CategoryMembers" list of subcategory and article titles contained in a given category "CategoryMemberIDs" list of subcategory and article page IDs contained in a given category "CategoryArticles" list of article titles contained in a given category "CategoryArticleIDs" list of article page IDs contained in a given category "ParentCategories" list of categories in which a given page is contained - Properties about corresponding pages in other Wikipedia language versions include:
-
"LanguagesList" list of Wikipedia language versions that have a corresponding article "LanguagesURLs" list of URLs to corresponding articles in other Wikipedia language versions "LanguagesURLRules" list of language-URL rules for corresponding articles in other Wikipedia language versions "TitleTranslation" list of pairs of language and title rules for corresponding articles in other Wikipedia language versions "TitleTranslationRules" list of language-title rules for corresponding articles in other Wikipedia language versions - Properties that return GeoLocation information associated with a given page include:
-
"GeoPosition" primary GeoPosition associated with a page "GeoNearbyArticles" list of article titles whose primary GeoPosition is within a given radius of a page "GeoNearbyDataset" dataset of information about articles whose primary GeoPosition is within a given radius of a page - Properties that return images and image metadata include:
-
"ImageList" list of thumbnail images from a given page "ImageDataset" dataset of information about images from a given page - Most WikipediaData properties support a MaxItems option:
-
MaxItems 500 number of results to return - Properties that return article links support the following properties:
-
"MaxLevel" 1 number of levels to search outward from the specified page "MaxLevelItems" 500 number of links to follow at each level - "GeoNearby" properties also support the following options, but they cannot be used at the same time:
-
GeoDistance 
search radius in meters around a given point (minimum 10 meters, maximum 10000 meters); also allows Quantity objects GeoDisk None uses the radius and GeoPosition information from a GeoDisk and searches around it (minimum 10 meters, maximum 10000 meters) - Most WikipediaData properties support a Language option:
-
Language "English" version of Wikipedia to use (may be a string or "Language" entity) - Possible specifications for Language include:
-
Languagelang retrieve the specified article(s) from the version of Wikipedia represented by lang Language{lang1lang2} given a specified article in the version of Wikipedia represented by lang1, retrieve the corresponding article from the lang2 version of Wikipedia - Properties that return metrics data include:
-
{"DailyPageHits",propval} time series of daily page views {"MonthlyPageHits",propval} time series of monthly page views - Properties that return metrics data support the following qualifiers:
-
"Access" client or platform used to access a given page "Project" Wikimedia project hosting a given page "Agent" type of agent accessing a given page - Possible values for the "Access" qualifier include:
-
"AllAccess" page views from all platforms "Desktop" page views from desktop clients "MobileApp" page views from mobile apps "MobileWeb" page views from mobile web clients - Possible values for the "Agent" qualifier include:
-
"AllAgents" page views from all user agents "User" page views from regular users "Spider" page views from spiders "Bot" page views from bots - The value of the "Project" qualifier should be the base URL of a specific Wikimedia project, e.g. commons.wikimedia.org.
Examples
open all close allBasic Examples (4)
Get the text of a Wikipedia article:
TextSentences[WikipediaData["Moon"]][[ ;; 5]]Retrieve text from multiple Wikipedia articles:
TextSentences[WikipediaData[{"Mercury (planet)", "Venus", "Earth", "Mars"}]][[All, ;; 1]]Retrieve articles associated with Wolfram Language entities:
TextSentences[WikipediaData[Entity["Person", "NeilArmstrong::368kz"]]][[ ;; 2]]Retrieve articles by Wikipedia page ID:
TextSentences[WikipediaData["PageID" -> "5094570", "ArticlePlaintext"]][[1]]Get the title of a Wikipedia article from its Wolfram Language entity:
WikipediaData[{Entity["Person", "BarackObama::7yj6w"], Entity["Person", "JenniferLawrence::k8f6z"]}, "Title"]Get the PageID of a Wikipedia article:
WikipediaData[Entity["Person", "BarackObama::7yj6w"], "PageID"]Retrieve raw Wikicode markup for an article:
code = WikipediaData["Apollo 11", "ArticleWikicode"];StringSplit[code, "
"][[ ;; 10]]Get a list of Wikipedia articles linked from or linking back to a given article:
WikipediaData["Bill Gates", "LinksList"]//ShallowWikipediaData["Bill Gates", "BacklinksList"]//ShallowScope (5)
Get a list of Wikipedia language versions that contain a corresponding article:
WikipediaData["Dracula", "LanguagesList"]Get URLs for corresponding articles in other versions of Wikipedia:
WikipediaData["Dracula", "LanguagesURLRules"][[ ;; 5]]Get article titles in other versions of Wikipedia:
WikipediaData["Dracula", "TitleTranslationRules"]Get a list of articles in a given Wikipedia category:
WikipediaData["Category" -> "sports cars"]//ShallowGet a list of articles, subcategories, and other pages in a given category:
WikipediaData["Category" -> "Chemistry", "CategoryMembers"]//ShallowGet a list of rules representing links between categories:
links = WikipediaData["Category" -> "Physics", "CategoryLinks", "MaxLevelItems" -> 10, "MaxLevel" -> 2];Graph[links, VertexLabels -> Placed["Name", Tooltip], VertexStyle -> {"Physics" -> Red}]Find out to what categories a given page belongs:
WikipediaData["Koala", "ParentCategories"]//ShallowOptions (6)
Languages (3)
Retrieve an article from the Spanish-language Wikipedia:
WikipediaData["Día de la Independencia de los Estados Unidos", "SummaryPlaintext", Language -> Entity["Language", "Spanish"]]Retrieve the article in the Spanish-language Wikipedia that corresponds to a specified English Wikipedia article:
WikipediaData["Independence Day (United States)", "SummaryPlaintext", Language -> {Entity["Language", "English"] -> Entity["Language", "Spanish"]}]Given an article in the English-language Wikipedia, find articles whose primary coordinates are near those of the corresponding article in the Spanish-language Wikipedia:
WikipediaData["White House", "GeoNearbyDataset", Language -> {Entity["Language", "English"] -> Entity["Language", "Spanish"]}]Metrics (3)
Compare page hits for two Wikipedia articles:
data = WikipediaData[{"James McAvoy", "Patrick Stewart"}, "DailyPageHits"];
DateListPlot[data, PlotRange -> All, PlotLegends -> {"McAvoy", "Stewart"}, ImageSize -> 400]Compare page hits from web apps and mobile web browsers for a given article:
dpagehitsWeb = WikipediaData["White House", {"DailyPageHits", "Access" -> "MobileWeb"}];
dpagehitsApp = WikipediaData["White House", {"DailyPageHits", "Access" -> "MobileApp"}];DateListPlot[{dpagehitsWeb, dpagehitsApp}, PlotRange -> All, PlotLegends -> {"Mobile web", "Mobile app"}, ImageSize -> 400]Compare traffic to the English and Spanish versions of a Wikipedia article:
articleEn = WikipediaData["Luis Fonsi", "DailyPageHits"];
articleEs = WikipediaData["Luis Fonsi", "DailyPageHits", Language -> "Spanish"];DateListPlot[{articleEn, articleEs}, PlotRange -> All, PlotLegends -> {"English", "Spanish"}, ImageSize -> 400]Neat Examples (3)
Get lists of rules representing links between pages:
links = WikipediaData["Graph theory", "BacklinksRules", "MaxLevelItems" -> 20, "MaxLevel" -> 2];Graph[links, VertexLabels -> Placed["Name", Tooltip], VertexStyle -> {"Graph theory" -> Red}]Get a list of thumbnail images on a Wikipedia page:
WikipediaData["Mare Tranquillitatis", "ImageList"]WikipediaData["Mare Tranquillitatis", "ImageDataset"][[All, {"Thumbnail", "User", "Date"}]]Get the primary GeoPosition associated with a page or pages:
WikipediaData[{"Mount Everest", "Mare Tranquillitatis", "Olympus Mons"}, "GeoPosition"]Get a Dataset of articles whose primary coordinates are near a given page:
WikipediaData["Eiffel Tower", "GeoNearbyDataset", MaxItems -> 10]Find Wikipedia articles whose primary coordinates are located within a GeoDisk:
WikipediaData["GeoNearbyArticles", {GeoDisk -> GeoDisk[{40.0971, -88.2457}, Quantity[1000, "Meters"]]}]Related Workflows
- Import Text for Computation
Text
Wolfram Research (2015), WikipediaData, Wolfram Language function, https://reference.wolfram.com/language/ref/WikipediaData.html (updated 2018).
CMS
Wolfram Language. 2015. "WikipediaData." Wolfram Language & System Documentation Center. Wolfram Research. Last Modified 2018. https://reference.wolfram.com/language/ref/WikipediaData.html.
APA
Wolfram Language. (2015). WikipediaData. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/WikipediaData.html
BibTeX
@misc{reference.wolfram_2026_wikipediadata, author="Wolfram Research", title="{WikipediaData}", year="2018", howpublished="\url{https://reference.wolfram.com/language/ref/WikipediaData.html}", note=[Accessed: 13-June-2026]}
BibLaTeX
@online{reference.wolfram_2026_wikipediadata, organization={Wolfram Research}, title={WikipediaData}, year={2018}, url={https://reference.wolfram.com/language/ref/WikipediaData.html}, note=[Accessed: 13-June-2026]}