Query the MediaWiki Action API using a vector of Wikipedia pages
Source:R/prop-query-type.R
query_by_.Rd
These functions help you to build a query for the MediaWiki Action API if you already have a set of pages that you wish to investigate. These functions can be combined with query_page_properties to choose which properties to return for the passed pages.
Arguments
- .req
A wiki_action_request query to modify
- title
A character vector of page titles
- pageid
A character or numeric vector of page ids
- revid
A character or numeric vector of revision ids
Value
A request object of type pages/query/action_api/httr2_request
. To
perform the query, pass the object to next_batch or retrieve_all
Details
If you don't already know which pages you wish to examine, you can build a query to find pages that meet certain criteria using query_list_pages or query_generate_pages.
Examples
# Retrieve the categories for Charles Harpur's Wikipedia page
resp <- wiki_action_request() %>%
query_by_title("Charles Harpur") %>%
query_page_properties("categories") %>%
gracefully(next_batch)