Skip to contents

See API:Properties for a list of available properties. Many have additional parameters to control their behavior, which can be passed to this function as named arguments.

Usage

query_page_properties(.req, property, ...)

list_all_property_modules()

Arguments

.req

A httr2_request, e.g. generated by wiki_action_request

property

The property to request

...

<dynamic-dots> Additional parameters to pass, e.g. to modify what is returned by the property request

Value

An HTTP response: an S3 list with class httr2_request

Details

query_page_properties is not useful on its own. It must be combined with a query_by_ function or query_generate_pages to specify which pages properties are to be returned. It should be noted that many of the API:Properties modules can themselves be used as generators. If you wish to use a property module in this way, then you must use query_generate_pages, passing the name of the property module as the genenerator.

See also

Examples

# Search for articles about seagulls and retrieve their number of
# watchers

resp <- wiki_action_request() %>%
  query_generate_pages("search", gsrsearch = "seagull") %>%
  query_page_properties("info", inprop = "watchers") %>%
  gracefully(next_batch) %>%
  dplyr::select(pageid, ns, title, watchers)
resp
#> <complete/query_tbl>
#> # A tibble: 10 × 4
#>      pageid    ns title                       watchers
#>       <int> <int> <chr>                          <int>
#>  1    45232     0 Jonathan Livingston Seagull      153
#>  2   210481     0 Gull                             184
#>  3   210492     0 Seagull (disambiguation)          NA
#>  4   474370     0 The Seagull                       79
#>  5   887152     0 Barbara Hershey                  152
#>  6  6386157     0 Seagull management                34
#>  7 12811837     0 Seagull Camera                    NA
#>  8 24071169     0 Tianjin Seagull                   NA
#>  9 58723600     0 Bobby Seagull                     NA
#> 10 73546753     0 BYD Seagull                       NA
#>  There are more results on the server. Retrieve them with `next_batch()` or `retrieve_all()`
#>  Data complete for all records