All the tags used on the Guardian website. See the API docs on this endpoint for more details.

gu_tags(query = NULL, tag_type = NULL, section = NULL,
  references = NULL, reference_type = NULL, show_references = "all",
  ..., verbose = TRUE, tidy = TRUE, tidy_style = "snake_case")

Arguments

query

A string, which will return all tags containing that string.

tag_type

One of "keyword", "series", "contributor", "tone", "type" or "blog". Defaults to NULL and does not filter by tag type.

section

Return only tags of a given section.

references

Return only tags with those references

reference_type

Return only tags with those reference types.

show_references

Show associated reference data such as ISBNs. Defaults to "all" and shows all available references. Accepts character vectors of one or more references (see details for options).

...

Use to pass any other parameters to the API. See the docs for a full list of options.

verbose

Prints messages to console. Defaults to TRUE.

tidy

Convert variable names to snake_case, remove some "<NA>" strings. Defaults to TRUE.

tidy_style

Style to variable names with.

Value

A tibble with details on tags.

References options

The following are the options for the show_references parameter:

  • "all" Includes all the fields (default)

  • "author"

  • "bisac-prefix"

  • "esa-cricket-match"

  • "esa-football-match"

  • "esa-football-team"

  • "esa-football-tournament"

  • "isbn"

  • "imdb"

  • "musicbrainz"

  • "musicbrainzgenre"

  • "opta-cricket-match"

  • "opta-football-match"

  • "opta-football-team"

  • "opta-football-tournament"

  • "pa-football-competition"

  • "pa-football-match"

  • "pa-football-team"

  • "r1-film"

  • "reuters-index-ric"

  • "reuters-stock-ric"

  • "witness-assignment"

Examples

if (FALSE) {
# Return all tags containing "apple"
apple1 <- gu_tags(query = "apple")

# Return all tags containing "apple" in the technology section
apple2 <- gu_tags(query = "apple", section = "technology")

# Return all contributor tags in the life and style section
tag_sec_type <- gu_tags(section = "lifeandstyle", tag_type = "contributor")
}