Get the category details for a category ID.

The /categories/{categoryId} request returns all the groups to which the category belongs. You must supply a category ID to use this request. Note: Query parameters are case-sensitive.

Usage

category_details(
  category_id,
  icon = NULL,
  language = NULL,
  token = arc_token(),
  .progress = TRUE
)

Arguments

category_id

Default NULL. A character vector which filters places to those that match the category IDs.

icon

Default NULL. Must be one of "svg", "png" "cim". Determines whether icons are returned and the type of icon to use with a place or category.

language

Optional case-sensitive parameter to specify the preferred language to.

token

an object of class httr2_token as generated by auth_code() or related function

.progress

Default TRUE. Whether a progress bar should be provided.

Value

A data.frame with columns:

  • category_id

  • full_label: a list of character vectors

  • icon_url: a character vector of the URL to an icon, if available

  • parents: a list of character vectors indicating the parent category ID

Details

Language Codes

The language codes use the CLDR (Common Locale Data Repository) format string that uses a two letter language code (e.g. "fr" for French) optionally followed by a two letter country code (e.g. "fr-CA" for French in Canada).

If an unsupported language code is used, then the service will attempt to fall-back to the closest available language. This is done by stripping regional and extension subtags to find a known language code. For example, French Canadian (fr-CA) is unsupported so this falls back to French fr.

Should the fallback fail, then the service will return category names in the default language en for English.

References

API Documentation

Examples

if (FALSE) {
categories <- c(
  "12015", "11172", "15015", "19027", "13309", "16069", "19004",
  "13131", "18046", "15048"
)
category_details(categories)
}

Your browser is no longer supported. Please upgrade your browser for the best experience. See our browser deprecation post for more details.