Description Usage Arguments Value Examples
View source: R/get_hospital_metadata.R
This function provides a wrapper to the 'api.php/institution' endpoint from the following domain: http://tempos.min-saude.pt.
Crucial for extracting the wait times, see get_wait_times
has it contains the "hospital id"s as well as logical variables for the data available per website
1 2 | get_hospital_metadata(output_format = c("json", "data_frame"),
request_headers = "")
|
output_format |
Character which defines the format of the final output resulting form the API call. Two options:
(1) |
request_headers |
named character vector with the HTTP headers to be added to |
json string or tibble containing the relevant metadata.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 | ## Not run:
library(esperaR)
library(jsonlite)
## pull the metadata as a json file
hospital_meta_json <- get_hospital_metadata(output_format = "json")
prettify(hospital_meta_json)
## Adding a user-agent header to the get request and returning a tibble
hospital_meta_df <- get_hospital_metadata(output_format = "data_frame", request_headers = list("User-Agent" = "Mozilla/5.0 (X11; Linux x86_64; rv:74.0) Gecko/20100101 Firefox/74.0"))
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.