# Get the html of the 'Earth' article on English Wikipedia
response <- core_rest_request("page", "Earth", "html") %>%
gracefully(httr2::req_perform)
response <- wikimedia_rest_request("page", "html", "Earth") %>%
gracefully(httr2::req_perform)
# Some REST requests take query parameters. Pass these as named arguments.
# To search German Wikipedia for articles about Goethe
response <- core_rest_request("search/page", q = "Goethe", limit = 2, language = "de") %>%
gracefully(httr2::req_perform)
if (!is_wikkitidy_failure(response)) {
httr2::resp_body_json(response)
}
Run the code above in your browser using DataLab