R/get_list.R

Defines functions get_list

Documented in get_list

#' List possible series or groups.
#'
#' \code{get_list} returns metadata about all Bank of Canada series or series
#' groups.
#'
#' @param type Either \code{series} or \code{groups}.
#'
#' @return A \code{tibble} of series or group information.
#'
#' @importFrom httr modify_url
#' @importFrom readr read_csv cols
#'
#' @export
get_list <- function(type = c("series", "groups")) {

  url <- modify_url("https://www.bankofcanada.ca/", path = paste0("valet/lists/", match.arg(type, c("series", "groups")), "/csv"))

  readr::read_csv(url, skip = 4, col_types = cols())

}

Try the valet package in your browser

Any scripts or data that you put into this service are public.

valet documentation built on June 8, 2025, 1:03 p.m.