Skip to contents

Query Wikipedia using the Action API

Build a query

Compose a complex query to Wikipedia’s Action API, combining list, property, and generator endpoints.

wiki_action_request()
Query Wikipedia using the MediaWiki Action API
query_generate_pages() list_all_generators()
Generate pages that meet certain criteria, or which are related to a set of known pages by certain properties
query_list_pages() list_all_list_modules()
List pages that meet certain criteria
query_page_properties() list_all_property_modules()
Choose properties to return for pages from the action API
query_by_title() query_by_pageid() query_by_revid()
Query the MediaWiki Action API using a vector of Wikipedia pages
next_result() next_batch() retrieve_all()
Perform a query using the MediaWiki Action API

Common queries

query_category_members() build_category_tree()
Explore Wikipedia's category system

Low-level API

new_generator_query()
Constructor for generator query type
new_list_query()
Constructor for list queries
new_prop_query()
Constructor for the property query type

Get page data

Functions to retrieve additional data about pages. These functions typically rely on one of Wikipedia’s REST APIs, and work on a vector of page ids, titles or revision ids.

Vector functions

get_latest_revision() get_page_html() get_page_summary() get_page_related() get_page_talk() get_page_langlinks()
Get data about pages from their titles
get_diff()
Search for insertions, deletions or relocations of text between two versions of a Wikipedia page
get_history_count()
Count how many times Wikipedia articles have been edited
get_xtools_page_info() get_xtools_page_prose() get_xtools_page_links() get_xtools_page_top_editors() get_xtools_page_assessment()
Access page-level statistics from the XTools Page API endpoint

Low-level API

core_rest_request() wikimedia_rest_request()
Build a REST request to one of Wikipedia's specific REST APIs
wikimedia_org_rest_request() xtools_rest_request()
Build a REST request to one of the Wikimedia Foundation's central APIs
get_rest_resource()
Get resources from one of Wikipedia's two REST APIs

Use WikiMedia XML dumps

verify_xml_integrity()
Check that a Wikimedia XML file has not been corrupted

Data types

Data types returned by wikkitidy functions.

query_tbl()
Representation of Wikipedia data returned from an Action API Query module as tibble, with request metadata stored as attributes.

Utilities

wikkitidy_example()
Get path to wikkitidy example