WikipediaData

WikipediaData[article]

gives the plain text of the specified Wikipedia article.

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 the English-language Wikipedia.
  • 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
    "RandomArticle"random article
  • 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:
  • MaxItems500number of results to return
  • Properties that return article links support the following properties:
  • "MaxLevel"1number of levels to search outward from the specified page
    "MaxLevelItems"500number of links to follow at each level
  • "GeoNearby" properties also support the following options, but they cannot be used at the same time:
  • GeoDistancesearch radius in meters around a given point (minimum 10 meters, maximum 10000 meters); also allows Quantity objects
    GeoDisk Noneuses the radius and GeoPosition information from a GeoDisk and searches around it (minimum 10 meters, maximum 10000 meters)

Examples

Basic Examples  (6)

Get the text of a Wikipedia article:

In[1]:=
Click for copyable input
Out[1]=

Retrieve articles associated with Wolfram Language entities:

In[2]:=
Click for copyable input
Out[2]=

Retrieve articles by Wikipedia page ID:

In[3]:=
Click for copyable input
Out[3]=

Retrieve raw Wikicode markup for an article:

In[4]:=
Click for copyable input
In[5]:=
Click for copyable input
Out[5]=

Get a list of Wikipedia articles linked from or linking back to a given article:

In[1]:=
Click for copyable input
Out[1]//Shallow=
In[2]:=
Click for copyable input
Out[2]//Shallow=

Get lists of rules representing links between pages:

In[3]:=
Click for copyable input
In[4]:=
Click for copyable input
Out[4]=

Get a list of Wikipedia language versions that contain a corresponding article:

In[1]:=
Click for copyable input
Out[1]=

Get article titles in other versions of Wikipedia:

In[2]:=
Click for copyable input
Out[2]=

Get URLs for corresponding articles in other versions of Wikipedia:

In[3]:=
Click for copyable input
Out[3]=

Get the primary GeoPosition associated with a page or pages:

In[1]:=
Click for copyable input
Out[1]=

Get a Dataset of articles whose primary coordinates are near a given page:

In[2]:=
Click for copyable input
Out[2]=

Find Wikipedia articles whose primary coordinates are located within a GeoDisk:

In[3]:=
Click for copyable input
Out[3]=

Get a list of thumbnail images on a Wikipedia page:

In[1]:=
Click for copyable input
Out[1]=
In[2]:=
Click for copyable input
Out[2]=

Get a list of articles in a given Wikipedia category:

In[1]:=
Click for copyable input
Out[1]//Shallow=

Get a list of articles, subcategories, and other pages in a given category:

In[2]:=
Click for copyable input
Out[2]//Shallow=

Get a list of rules representing links between categories:

In[3]:=
Click for copyable input
In[4]:=
Click for copyable input
Out[4]=

Find out to what categories a given page belongs:

In[5]:=
Click for copyable input
Out[5]//Shallow=

Get the title of a Wikipedia article from its Wolfram Language entity:

In[6]:=
Click for copyable input
Out[6]=

Get the PageID of a Wikipedia article:

In[7]:=
Click for copyable input
Out[7]=
In[8]:=
Click for copyable input
Out[8]=

See Also

WikipediaSearch  EntityValue  WordData  ExampleData  ResourceData  WebSearch

Introduced in 2015
(10.1)