Skip to contents

Get similiar(ish) movies

Usage

movies_related(id, limit = 10L, extended = "min")

Source

movies_related() wraps endpoint /movies/:id/related.

Arguments

id

character(1): The ID of the item requested. Preferably the trakt ID (e.g. 1429). Other options are the trakt.tv slug (e.g. "the-wire") or imdb ID (e.g. "tt0306414"). Can also be of length greater than 1, in which case the function is called on all id values separately and the result is combined. See vignette("tRakt") for more details.

limit

integer(1) [10L]: Number of items to return. Must be greater than 0 and will be coerced via as.integer().

extended

character: Level of detail for the API response.

  • "min" (default): Minimal info (title, year, IDs). Omits the extended query param.

  • "full": Complete info including overview, ratings, runtime, etc.

  • "images": Minimal info plus image URLs (returned as a list-column).

  • "full,images": Complete info plus images.

  • "metadata": Collection endpoints only; adds video/audio metadata.

Multiple values can be combined as a comma-separated string (e.g. "full,images") or a character vector (e.g. c("full", "images")).

Value

A tibble(). If the function has a limit parameter (defaulting to 10), this will be the (maximum) number of rows of the tibble. If there are no results (or the API is unreachable), an empty tibble() is returned.

Examples

movies_related("the-avengers-2012", limit = 5)
#> # A tibble: 5 × 30
#>   related_to      year title  votes genres rating status country runtime tagline
#>   <chr>          <int> <chr>  <int> <list>  <dbl> <chr>  <chr>     <int> <chr>  
#> 1 the-avengers-…  2011 Capt…  47078 <chr>    7.40 relea… us          124 We are…
#> 2 the-avengers-…  2008 Iron…  62948 <chr>    8.08 relea… us          126 Heroes…
#> 3 the-avengers-…  2011 Thor   45227 <chr>    7.15 relea… us          115 Courag…
#> 4 the-avengers-…  2014 Guar… 108103 <chr>    8.26 relea… us          121 When t…
#> 5 the-avengers-…  2000 X-Men  26669 <chr>    7.47 relea… us          104 Trust …
#> # ℹ 20 more variables: trailer <chr>, homepage <chr>, language <chr>,
#> #   overview <chr>, released <date>, languages <list>, subgenres <list>,
#> #   updated_at <dttm>, after_credits <lgl>, certification <chr>,
#> #   comment_count <int>, during_credits <lgl>, original_title <chr>,
#> #   available_translations <list>, imdb <chr>, slug <chr>, tmdb <chr>,
#> #   trakt <chr>, plex_guid <chr>, plex_slug <chr>