Skip to contents

This function fetches data from the GBD API. To use this function, you need to have an API key. You can get the key by registering on the IHME-API website.

Usage

gbd_get_data(url, key, endpoint, ...)

Arguments

url

The base URL of the API.

key

The API key for authorization.

endpoint

The specific endpoint to retrieve data from.

...

Additional query parameters such as location_id, year, etc.

Value

A data frame or list of results from the API.

Examples

if (FALSE) { # \dontrun{
# This is a dontrun example because it requires an API KEY.
url <- "https://api.healthdata.org/sdg/v1"
key <- "YOUR-KEY"
endpoint <- "GetResultsByIndicator"

data <- gbd_get_data(url,
                    key,
                    endpoint,
                    indicator_id="1001",
                    location_id= c("29","86","102"),
                    year="2019",
                    limit = 10)
} # }