Skip to contents

A convenience wrapper around trud_items() and get_item_metadata(), retrieving metadata for only items that the user is subscribed to. This is particularly useful for seeing what data you can download with download_item(). If you need access to additional items, browse available options with trud_items(), then subscribe through the NHS TRUD website.

Usage

get_subscribed_metadata(release_scope = c("all", "latest"))

Arguments

release_scope

Which releases to retrieve metadata for. Use "all" to get all releases, or "latest" to get only the most recent release.

Value

A tibble, with item metadata stored in the list column metadata. Use the item_number column values with download_item().

See also

Examples

if (FALSE) { # identical(Sys.getenv("IN_PKGDOWN"), "true") & Sys.getenv("TRUD_API_KEY") != ""
  # Get metadata for all subscribed items
  subscribed <- get_subscribed_metadata()

  # Show structure without exposing API keys in URLs
  subscribed$metadata[[1]] |>
    purrr::map_at("releases", \(release) purrr::map(release, names))
}