This is a generalized function for downloading metadata from the Kolada API. The function parameters closely mask the names specified in the original API. For further information about the Kolada API specification, please see the official documentation on GitHub.
get_metadata(
entity = "kpi",
title = NULL,
id = NULL,
municipality = NULL,
max_results = NULL,
cache = FALSE,
cache_location = tempdir,
verbose = FALSE
)
Any allowed metadata entity. Check allowed_entities()
to
see an updated list.
A free-form search term or the exact title of any entry in the current entity. Case insensitive.
The ID of any entry in the current entity.
If entity is "ou"
, the municipality parameter can
be added to narrow the search.
(Optional) Specify the maximum number of results returned by the query.
Logical. If TRUE, downloaded data are stored to the local disk
in the place specified by cache_location
. If data is already present
on the local disk, this data is returned instead of downloading data from the
API.
Where to store and search for cached data. Can be a
path to a directory or the name of any function that returns the path to a
directory when called, like getwd
. Defaults to
tempdir
.
Whether to print the call to the Kolada API as a message to the R console.
Returns a tibble with metadata for the specified entity. In rKolada
terminology, a table returned by e.g. entity = "kpi"
is referred to
as a kpi_df
and can be passed to functions starting with "kpi" such
as kpi_bind_keywords
.