Learn R Programming

wikiTools

Tools to obtain info from Wikidata or Wikipedia

Copy Link

Version

Install

install.packages('wikiTools')

Version

1.2.14

License

GPL-3

Maintainer

Modesto Escobar

Last Published

July 11th, 2025

Functions in wikiTools (1.2.14)

urltoFrame

Convert an URL link to an HTML iframe.
urltoHtml

Convert a Wikipedia URL to an HTML link
v_AutoSuggest

Suggests VIAF id from a name
user_agent

See https://meta.wikimedia.org/wiki/User-Agent_policy https://www.mediawiki.org/wiki/API:Etiquette
v_Extract

Gets information from a VIAF record
v_GetRecord

Gets record clusters
w_LabelDesc

Return label and/or descriptions of Wikidata entities
reqWDQS

Get responses from Wikidata Query Service
w_Geoloc

Get Latitude and Longitude coordinates, and Country of places
reqMediaWiki

Uses httr package to retrieve responses using the MediaWiki API.
w_query

Response from Wikidata Query Service
w_isValid

Check if Wikidata entities are valid
w_EntityInfo

Get information about a Wikimedia entity (human or film)
w_Property

Get properties of Wikidata entities
normalizedTitle

Return the normalized and redirect title from the response
preName

Reverse the order of the first and last names of every element of a vector.
w_Exhibit

Extract the first paragraph of a Wikipedia article with a maximum of characters.
selectLang

Convert names of a wikiTools data frame to English or Spanish
pop_up

Create a drop-down vignette for nodes from different items (for galleries).
searchWiki

Find if there is a Wikipedia page of a name(s) in the selected language.
w_SearchByIdentifiers

Search for entities that may match identifiers in a database or authorities' catalog.
w_SearchByInstanceof

Get entities which are instance of a Wikidata entity
w_SearchByAuthority

Get entities that have identifier in a database or authorities' catalog.
w_SearchByLabel

Search Wikidata entities by string (usually labels)
validUrl

Find if an URL link is valid.
w_isInstanceOf

Check if a Wikidata entity is an instance of a class
w_Wikipedias

Get Wikipedia pages of Wikidata entities
v_Search

Run a CQL Query in VIAF
w_SearchByOccupation

Get Wikidata entities with a certain occupation
doChunks

Execute a function in chunks.
checkTitles

checkTitles(titles) Check if titles are valid. Return TRUE is all titles are valid, else FALSE. See https://en.wikipedia.org/wiki/Wikipedia:Page_name#Technical_restrictions_and_limitations
checkEntities

Check if all Wikidata entities in entity_list have valid values
extractWiki

Extract the first paragraph of a Wikipedia article with a maximum of characters.
nametoWikiURL

Create the Wikipedia URL of a name or entry.
m_XtoolsInfo

Gets various information from a Wikimedia page
m_reqMediaWiki

Retrieve responses using the MediaWiki API.
m_Opensearch

Open search of a string
getWikiInf

Create a data.frame with Q's and descriptions of a vector of names.
getWikiFiles

Downloads a list of Wikipedia pages in a specified path of the computer, and return a vector of the no-found names (if any).
filext

Extract the extension of a file
cc

Converts a text separated by commas into a character vector.
limitRequester

Limits the rate at which a function will execute
getFiles

Downloads a list of files in a specified path of the computer, and return a vector of the no-found names (if any).
httrGetJSON

httrGetJSON Retrieve responses in JSON format using httr::GET. It is a generic function to use for request these Wikimedia metrics API: https://wikimedia.org/api/rest_v1/ https://www.mediawiki.org/wiki/XTools/API/Page (xtools.wmflabs.org)
getWikiData

Create a data.frame with Wikidata of a vector of names.
m_Pageviews

Get number of views of a Wikipedia article
nametoWikiFrame

Convert names into a Wikipedia's iframe
nametoWikiHtml

Create the Wikipedia link of a name or entry.