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:
  • 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)
  • 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:
  • Languagelangretrieve 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 allclose all

Basic Examples  (8)

Get the text of a Wikipedia article:

Retrieve articles associated with Wolfram Language entities:

Retrieve articles by Wikipedia page ID:

Retrieve raw Wikicode markup for an article:

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

Get lists of rules representing links between pages:

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

Get article titles in other versions of Wikipedia:

Get URLs for corresponding articles in other versions of Wikipedia:

Get the primary GeoPosition associated with a page or pages:

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

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

Get a list of thumbnail images on a Wikipedia page:

Get a list of articles in a given Wikipedia category:

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

Get a list of rules representing links between categories:

Find out to what categories a given page belongs:

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

Get the PageID of a Wikipedia article:

Retrieve daily page hits for a Wikipedia article:

Compare page hits for two Wikipedia articles:

Options  (5)

Languages  (3)

Retrieve an article from the Spanish-language Wikipedia:

Retrieve the article in the Spanish-language Wikipedia that corresponds to a specified English Wikipedia article:

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:

Metrics  (2)

Compare page hits from web apps and mobile web browsers for a given article:

Compare traffic to the English and Spanish versions of a Wikipedia article:

Wolfram Research (2015), WikipediaData, Wolfram Language function, https://reference.wolfram.com/language/ref/WikipediaData.html (updated 2018).

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_2024_wikipediadata, author="Wolfram Research", title="{WikipediaData}", year="2018", howpublished="\url{https://reference.wolfram.com/language/ref/WikipediaData.html}", note=[Accessed: 05-December-2024 ]}

BibLaTeX

@online{reference.wolfram_2024_wikipediadata, organization={Wolfram Research}, title={WikipediaData}, year={2018}, url={https://reference.wolfram.com/language/ref/WikipediaData.html}, note=[Accessed: 05-December-2024 ]}