Title: | Get Data from 'trakt.tv' |
---|---|
Description: | A wrapper for the <https://trakt.tv> API to retrieve data about shows and movies, including user ratings, credits and related metadata. Additional functions retrieve user-specific information including collections and history of watched items. A full API reference is available at <https://trakt.docs.apiary.io>. |
Authors: | Lukas Burk [aut, cre] |
Maintainer: | Lukas Burk <[email protected]> |
License: | MIT + file LICENSE |
Version: | 0.16.9000 |
Built: | 2024-10-31 05:36:30 UTC |
Source: | https://github.com/jemus42/tRakt |
These functions return the most anticipated movies/shows on trakt.tv.
movies_anticipated( limit = 10, extended = c("min", "full"), query = NULL, years = NULL, genres = NULL, languages = NULL, countries = NULL, runtimes = NULL, ratings = NULL, certifications = NULL ) shows_anticipated( limit = 10, extended = c("min", "full"), query = NULL, years = NULL, genres = NULL, languages = NULL, countries = NULL, runtimes = NULL, ratings = NULL, certifications = NULL, networks = NULL, status = NULL )
movies_anticipated( limit = 10, extended = c("min", "full"), query = NULL, years = NULL, genres = NULL, languages = NULL, countries = NULL, runtimes = NULL, ratings = NULL, certifications = NULL ) shows_anticipated( limit = 10, extended = c("min", "full"), query = NULL, years = NULL, genres = NULL, languages = NULL, countries = NULL, runtimes = NULL, ratings = NULL, certifications = NULL, networks = NULL, status = NULL )
limit |
|
extended |
|
query |
|
years |
|
genres |
|
languages |
|
countries |
|
runtimes |
|
ratings |
|
certifications |
|
networks |
|
status |
|
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.
These functions access the automatically updated lists provided by trakt.tv. Each function comes in two flavors: Shows or movies. The following descriptions are adapted directly from the API reference.
Popular: Popularity is calculated using the rating percentage and the number of ratings.
Trending: Returns all movies/shows being watched right now. Movies/shows with the most users are returned first.
Played: Returns the most played (a single user can watch multiple times)
movies/shows in the specified time period
.
Watched: Returns the most watched (unique users) movies/shows in the specified
time period
.
Collected: Returns the most collected (unique users) movies/shows in the
specified time period
.
Anticipated: Returns the most anticipated movies/shows based on the number of
lists a movie/show appears on.
The functions for Played, Watched, Collected and Played each return
the same additional variables besides the media information: watcher_count
,
play_count
, collected_count
, collector_count
.
movies_anticipated()
wraps endpoint movies/anticipated.
shows_anticipated()
wraps endpoint shows/anticipated.
Other movie data:
collected_media
,
media_aliases
,
media_comments
,
media_lists
,
media_people
,
media_ratings()
,
media_stats()
,
media_translations
,
media_watching
,
movies_boxoffice()
,
movies_related()
,
movies_releases()
,
movies_summary()
,
people_media()
,
played_media
,
popular_media
,
trending_media
,
watched_media
Other dynamic lists:
collected_media
,
lists_popular()
,
played_media
,
popular_media
,
trending_media
,
watched_media
Other shows data:
popular_media
,
trending_media
,
watched_media
Other dynamic lists:
collected_media
,
lists_popular()
,
played_media
,
popular_media
,
trending_media
,
watched_media
## Not run: # Get 15 the most anticipated upcoming shows on Netflix that air this year current_year <- format(Sys.Date(), "%Y") shows_anticipated(limit = 15, networks = "Netflix", years = current_year) ## End(Not run)
## Not run: # Get 15 the most anticipated upcoming shows on Netflix that air this year current_year <- format(Sys.Date(), "%Y") shows_anticipated(limit = 15, networks = "Netflix", years = current_year) ## End(Not run)
build_trakt_url
assembles a trakt.tv API URL from different arguments.
The result should be fine for use with trakt_get, since that's what this
function was created for.
build_trakt_url(..., validate = FALSE)
build_trakt_url(..., validate = FALSE)
... |
Unnamed arguments will be concatenated with |
validate |
|
A URL: character
of length 1. If validate = TRUE
, also a message
including the HTTP status code return by a HEAD
request.
Please be aware that the result of this function is not verified to be
a working trakt.tv API URL unless validate = TRUE
, in which case a HEAD
request is performed that does not actually receive any data, but from its
returned status code the validity of the URL can be inferred.
Other utility functions:
pad_episode()
build_trakt_url("shows", "breaking-bad", extended = "full") build_trakt_url("shows", "popular", page = 3, limit = 5) # Path can also be partially assembled already build_trakt_url("users/jemus42", "ratings") # Validate a URL works build_trakt_url("shows", "popular", page = 1, limit = 5, validate = TRUE)
build_trakt_url("shows", "breaking-bad", extended = "full") build_trakt_url("shows", "popular", page = 3, limit = 5) # Path can also be partially assembled already build_trakt_url("users/jemus42", "ratings") # Validate a URL works build_trakt_url("shows", "popular", page = 1, limit = 5, validate = TRUE)
These functions return the most collected movies/shows on trakt.tv.
movies_collected( limit = 10, extended = c("min", "full"), period = c("weekly", "monthly", "yearly", "all"), query = NULL, years = NULL, genres = NULL, languages = NULL, countries = NULL, runtimes = NULL, ratings = NULL, certifications = NULL ) shows_collected( limit = 10, extended = c("min", "full"), period = c("weekly", "monthly", "yearly", "all"), query = NULL, years = NULL, genres = NULL, languages = NULL, countries = NULL, runtimes = NULL, ratings = NULL, certifications = NULL, networks = NULL, status = NULL )
movies_collected( limit = 10, extended = c("min", "full"), period = c("weekly", "monthly", "yearly", "all"), query = NULL, years = NULL, genres = NULL, languages = NULL, countries = NULL, runtimes = NULL, ratings = NULL, certifications = NULL ) shows_collected( limit = 10, extended = c("min", "full"), period = c("weekly", "monthly", "yearly", "all"), query = NULL, years = NULL, genres = NULL, languages = NULL, countries = NULL, runtimes = NULL, ratings = NULL, certifications = NULL, networks = NULL, status = NULL )
limit |
|
extended |
|
period |
|
query |
|
years |
|
genres |
|
languages |
|
countries |
|
runtimes |
|
ratings |
|
certifications |
|
networks |
|
status |
|
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.
These functions access the automatically updated lists provided by trakt.tv. Each function comes in two flavors: Shows or movies. The following descriptions are adapted directly from the API reference.
Popular: Popularity is calculated using the rating percentage and the number of ratings.
Trending: Returns all movies/shows being watched right now. Movies/shows with the most users are returned first.
Played: Returns the most played (a single user can watch multiple times)
movies/shows in the specified time period
.
Watched: Returns the most watched (unique users) movies/shows in the specified
time period
.
Collected: Returns the most collected (unique users) movies/shows in the
specified time period
.
Anticipated: Returns the most anticipated movies/shows based on the number of
lists a movie/show appears on.
The functions for Played, Watched, Collected and Played each return
the same additional variables besides the media information: watcher_count
,
play_count
, collected_count
, collector_count
.
movies_collected()
wraps endpoint movies/collected/:period.
shows_collected()
wraps endpoint shows/collected/:period.
Other movie data:
anticipated_media
,
media_aliases
,
media_comments
,
media_lists
,
media_people
,
media_ratings()
,
media_stats()
,
media_translations
,
media_watching
,
movies_boxoffice()
,
movies_related()
,
movies_releases()
,
movies_summary()
,
people_media()
,
played_media
,
popular_media
,
trending_media
,
watched_media
Other dynamic lists:
anticipated_media
,
lists_popular()
,
played_media
,
popular_media
,
trending_media
,
watched_media
Other show data:
media_aliases
,
media_comments
,
media_lists
,
media_people
,
media_ratings()
,
media_stats()
,
media_translations
,
media_watching
,
people_media()
,
played_media
,
shows_next_episode()
,
shows_related()
,
shows_summary()
Other dynamic lists:
anticipated_media
,
lists_popular()
,
played_media
,
popular_media
,
trending_media
,
watched_media
Get a single comment
comments_comment(id, extended = c("min", "full")) comments_replies(id, extended = c("min", "full")) comments_likes(id, extended = c("min", "full")) comments_item(id, extended = c("min", "full"))
comments_comment(id, extended = c("min", "full")) comments_replies(id, extended = c("min", "full")) comments_likes(id, extended = c("min", "full")) comments_item(id, extended = c("min", "full"))
id |
|
extended |
|
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.
comments_replies()
: Get a comment's replies
comments_likes()
: Get users who liked a comment.
comments_item()
: Get the media item attached to the comment.
comments_comment()
wraps endpoint comments/:id.
comments_replies()
wraps endpoint comments/:id/replies.
comments_likes()
wraps endpoint comments/:id/likes.
comments_item()
wraps endpoint comments/:id/item.
Other comment methods:
comments_trending()
,
comments_updates()
,
media_comments
,
user_comments()
,
user_list_comments()
Other summary methods:
episodes_summary()
,
movies_summary()
,
people_summary()
,
seasons_summary()
,
shows_summary()
,
user_profile()
Other comment methods:
comments_trending()
,
comments_updates()
,
media_comments
,
user_comments()
,
user_list_comments()
Other comment methods:
comments_trending()
,
comments_updates()
,
media_comments
,
user_comments()
,
user_list_comments()
Other comment methods:
comments_trending()
,
comments_updates()
,
media_comments
,
user_comments()
,
user_list_comments()
# A single comment comments_comment("236397") # Multiple comments comments_comment(c("236397", "112561")) ## Not run: comments_replies("236397") ## End(Not run) ## Not run: comments_likes("236397") ## End(Not run) ## Not run: # A movie comments_item("236397") comments_item("236397", extended = "full") # A show comments_item("120768") comments_item("120768", extended = "full") # A season comments_item("140265") comments_item("140265", extended = "full") # An episode comments_item("136632") comments_item("136632", extended = "full") ## End(Not run)
# A single comment comments_comment("236397") # Multiple comments comments_comment(c("236397", "112561")) ## Not run: comments_replies("236397") ## End(Not run) ## Not run: comments_likes("236397") ## End(Not run) ## Not run: # A movie comments_item("236397") comments_item("236397", extended = "full") # A show comments_item("120768") comments_item("120768", extended = "full") # A season comments_item("140265") comments_item("140265", extended = "full") # An episode comments_item("136632") comments_item("136632", extended = "full") ## End(Not run)
Get trending or recently made comments
comments_trending( comment_type = c("all", "reviews", "shouts"), type = c("all", "movies", "shows", "seasons", "episodes", "lists"), include_replies = FALSE, limit = 10L ) comments_recent( comment_type = c("all", "reviews", "shouts"), type = c("all", "movies", "shows", "seasons", "episodes", "lists"), include_replies = FALSE, limit = 10L )
comments_trending( comment_type = c("all", "reviews", "shouts"), type = c("all", "movies", "shows", "seasons", "episodes", "lists"), include_replies = FALSE, limit = 10L ) comments_recent( comment_type = c("all", "reviews", "shouts"), type = c("all", "movies", "shows", "seasons", "episodes", "lists"), include_replies = FALSE, limit = 10L )
comment_type |
|
type |
|
include_replies |
|
limit |
|
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.
comments_trending()
wraps endpoint comments/trending/:comment_type/:type?include_replies=.
comments_recent()
wraps endpoint comments/recent/:comment_type/:type?include_replies=.
Other comment methods:
comments_comment()
,
comments_updates()
,
media_comments
,
user_comments()
,
user_list_comments()
Other comment methods:
comments_comment()
,
comments_updates()
,
media_comments
,
user_comments()
,
user_list_comments()
## Not run: # Trending reviews comments_trending("reviews") # Recent shouts (short comments) comments_recent("shouts") ## End(Not run)
## Not run: # Trending reviews comments_trending("reviews") # Recent shouts (short comments) comments_recent("shouts") ## End(Not run)
Get recently updated/edited comments
comments_updates( comment_type = c("all", "reviews", "shouts"), type = c("all", "movies", "shows", "seasons", "episodes", "lists"), include_replies = FALSE, limit = 10L )
comments_updates( comment_type = c("all", "reviews", "shouts"), type = c("all", "movies", "shows", "seasons", "episodes", "lists"), include_replies = FALSE, limit = 10L )
comment_type |
|
type |
|
include_replies |
|
limit |
|
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.
comments_updates()
wraps endpoint comments/updates/:comment_type/:type?include_replies=.
Other comment methods:
comments_comment()
,
comments_trending()
,
media_comments
,
user_comments()
,
user_list_comments()
# Recently updated comments comments_updates()
# Recently updated comments comments_updates()
This retrieves a single episode. See seasons_season for a whole season, and seasons_summary for (potentially) all episodes of a show.
episodes_summary(id, season = 1L, episode = 1L, extended = c("min", "full"))
episodes_summary(id, season = 1L, episode = 1L, extended = c("min", "full"))
id |
|
season , episode
|
|
extended |
|
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.
episodes_summary()
wraps endpoint shows/:id/seasons/:season/episodes/:episode.
Other episode data:
media_comments
,
media_lists
,
media_people
,
media_ratings()
,
media_stats()
,
media_translations
,
media_watching
,
seasons_season()
,
seasons_summary()
,
shows_next_episode()
Other summary methods:
comments_comment()
,
movies_summary()
,
people_summary()
,
seasons_summary()
,
shows_summary()
,
user_profile()
# Get just this one episode with its ratings, votes, etc. episodes_summary("breaking-bad", season = 1, episode = 1, extended = "full")
# Get just this one episode with its ratings, votes, etc. episodes_summary("breaking-bad", season = 1, episode = 1, extended = "full")
This data comes from https://trakt.tv and serves as an example of episode data output.
futurama
futurama
A tibble() with 124 rows and 18 variables:
Episode within each season and season number
Episode title
Overall episode number
Episode summary
Rating (1-10) on trakt.tv
Number of votes ontrakt.tv
Number of comments on episode page
Original air date and last update in UTC as POSIXct
Runtime in minutes
Episode IDs for trakt.tv, TVDb, and TMDb
List-column of available translation on trakt.tv
Other Episode datasets:
gameofthrones
futurama
futurama
This data comes from https://trakt.tv and https://en.wikipedia.org/wiki/List_of_Game_of_Thrones_episodes.
gameofthrones
gameofthrones
A tibble() with 67 rows and 17 variables:
Overall episode number
Episode within each season and season number
Episode title
Episode summary
Rating (1-10) on trakt.tv
Number of votes ontrakt.tv
Viewers according to Wikipedia
Directing and writing credits
Number of comments on episode page
Original air date and last update in UTC as POSIXct
Runtime in minutes
Episode IDs for trakt.tv, TVDb, and TMDb
Year of first airing
Episode ID in s00e00
format
Other Episode datasets:
futurama
gameofthrones
gameofthrones
Get popular / trending lists
lists_popular(limit = 10) lists_trending(limit = 10)
lists_popular(limit = 10) lists_trending(limit = 10)
limit |
|
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.
lists_popular()
wraps endpoint lists/popular.
lists_trending()
wraps endpoint lists/trending.
user_list_items()
For the actual content of a list.
Other list methods:
media_lists
,
user_list()
,
user_list_comments()
,
user_list_items()
,
user_lists()
Other dynamic lists:
anticipated_media
,
collected_media
,
played_media
,
popular_media
,
trending_media
,
watched_media
Other list methods:
media_lists
,
user_list()
,
user_list_comments()
,
user_list_items()
,
user_lists()
Other dynamic lists:
anticipated_media
,
collected_media
,
played_media
,
popular_media
,
trending_media
,
watched_media
## Not run: lists_popular() lists_trending() ## End(Not run)
## Not run: lists_popular() lists_trending() ## End(Not run)
Get all movie / show aliases
movies_aliases(id) shows_aliases(id)
movies_aliases(id) shows_aliases(id)
id |
|
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.
movies_aliases()
wraps endpoint movies/:id/aliases.
shows_aliases()
wraps endpoint shows/:id/aliases.
Other movie data:
anticipated_media
,
collected_media
,
media_comments
,
media_lists
,
media_people
,
media_ratings()
,
media_stats()
,
media_translations
,
media_watching
,
movies_boxoffice()
,
movies_related()
,
movies_releases()
,
movies_summary()
,
people_media()
,
played_media
,
popular_media
,
trending_media
,
watched_media
Other show data:
collected_media
,
media_comments
,
media_lists
,
media_people
,
media_ratings()
,
media_stats()
,
media_translations
,
media_watching
,
people_media()
,
played_media
,
shows_next_episode()
,
shows_related()
,
shows_summary()
movies_aliases(190430) shows_aliases(104439)
movies_aliases(190430) shows_aliases(104439)
Get all comments of a thing
movies_comments( id, sort = c("newest", "oldest", "likes", "replies"), extended = c("min", "full"), limit = 10L ) shows_comments( id, sort = c("newest", "oldest", "likes", "replies"), extended = c("min", "full"), limit = 10L ) seasons_comments( id, season = 1L, sort = c("newest", "oldest", "likes", "replies"), extended = c("min", "full"), limit = 10L ) episodes_comments( id, season = 1L, episode = 1L, sort = c("newest", "oldest", "likes", "replies"), extended = c("min", "full"), limit = 10L )
movies_comments( id, sort = c("newest", "oldest", "likes", "replies"), extended = c("min", "full"), limit = 10L ) shows_comments( id, sort = c("newest", "oldest", "likes", "replies"), extended = c("min", "full"), limit = 10L ) seasons_comments( id, season = 1L, sort = c("newest", "oldest", "likes", "replies"), extended = c("min", "full"), limit = 10L ) episodes_comments( id, season = 1L, episode = 1L, sort = c("newest", "oldest", "likes", "replies"), extended = c("min", "full"), limit = 10L )
id |
|
sort |
|
extended |
|
limit |
|
season , episode
|
|
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.
movies_comments()
: Get comments for a movie
shows_comments()
: Get comments for a movie
seasons_comments()
: Get comments for a season
episodes_comments()
: Get comments for an episode
movies_comments()
wraps endpoint movies/:id/comments/:sort.
shows_comments()
wraps endpoint shows/:id/comments/:sort.
seasons_comments()
wraps endpoint shows/:id/seasons/:season/comments/:sort.
episodes_comments()
wraps endpoint shows/:id/seasons/:season/episodes/:episode/comments/:sort.
Other comment methods:
comments_comment()
,
comments_trending()
,
comments_updates()
,
user_comments()
,
user_list_comments()
Other movie data:
anticipated_media
,
collected_media
,
media_aliases
,
media_lists
,
media_people
,
media_ratings()
,
media_stats()
,
media_translations
,
media_watching
,
movies_boxoffice()
,
movies_related()
,
movies_releases()
,
movies_summary()
,
people_media()
,
played_media
,
popular_media
,
trending_media
,
watched_media
Other show data:
collected_media
,
media_aliases
,
media_lists
,
media_people
,
media_ratings()
,
media_stats()
,
media_translations
,
media_watching
,
people_media()
,
played_media
,
shows_next_episode()
,
shows_related()
,
shows_summary()
Other season data:
media_lists
,
media_people
,
media_ratings()
,
media_stats()
,
seasons_season()
,
seasons_summary()
Other episode data:
episodes_summary()
,
media_lists
,
media_people
,
media_ratings()
,
media_stats()
,
media_translations
,
media_watching
,
seasons_season()
,
seasons_summary()
,
shows_next_episode()
## Not run: movies_comments(193972) shows_comments(46241, sort = "likes") seasons_comments(46241, season = 1, sort = "likes") episodes_comments(46241, season = 1, episode = 2, sort = "likes") ## End(Not run)
## Not run: movies_comments(193972) shows_comments(46241, sort = "likes") seasons_comments(46241, season = 1, sort = "likes") episodes_comments(46241, season = 1, episode = 2, sort = "likes") ## End(Not run)
Get lists containing a movie, show, season, episode or person
movies_lists( id, type = c("all", "personal", "official", "watchlists"), sort = c("popular", "likes", "comments", "items", "added", "updated"), limit = 10L, extended = c("min", "full") ) shows_lists( id, type = c("all", "personal", "official", "watchlists"), sort = c("popular", "likes", "comments", "items", "added", "updated"), limit = 10L, extended = c("min", "full") ) seasons_lists( id, season, type = c("all", "personal", "official", "watchlists"), sort = c("popular", "likes", "comments", "items", "added", "updated"), limit = 10L, extended = c("min", "full") ) episodes_lists( id, season, episode, type = c("all", "personal", "official", "watchlists"), sort = c("popular", "likes", "comments", "items", "added", "updated"), limit = 10L, extended = c("min", "full") ) people_lists( id, type = c("all", "personal", "official", "watchlists"), sort = c("popular", "likes", "comments", "items", "added", "updated"), limit = 10L, extended = c("min", "full") )
movies_lists( id, type = c("all", "personal", "official", "watchlists"), sort = c("popular", "likes", "comments", "items", "added", "updated"), limit = 10L, extended = c("min", "full") ) shows_lists( id, type = c("all", "personal", "official", "watchlists"), sort = c("popular", "likes", "comments", "items", "added", "updated"), limit = 10L, extended = c("min", "full") ) seasons_lists( id, season, type = c("all", "personal", "official", "watchlists"), sort = c("popular", "likes", "comments", "items", "added", "updated"), limit = 10L, extended = c("min", "full") ) episodes_lists( id, season, episode, type = c("all", "personal", "official", "watchlists"), sort = c("popular", "likes", "comments", "items", "added", "updated"), limit = 10L, extended = c("min", "full") ) people_lists( id, type = c("all", "personal", "official", "watchlists"), sort = c("popular", "likes", "comments", "items", "added", "updated"), limit = 10L, extended = c("min", "full") )
id |
|
type |
|
sort |
|
limit |
|
extended |
|
season , episode
|
|
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.
movies_lists()
: Lists containing a movie.
shows_lists()
: Lists containing a show.
seasons_lists()
: Lists containing a season.
episodes_lists()
: Lists containing an episode.
people_lists()
: Lists containing a person.
movies_lists()
wraps endpoint movies/:id/lists/:type/:sort.
shows_lists()
wraps endpoint shows/:id/lists/:type/:sort.
seasons_lists()
wraps endpoint shows/:id/seasons/:season/lists/:type/:sort.
episodes_lists()
wraps endpoint shows/:id/seasons/:season/episodes/:episode/lists/:type/:sort.
Other list methods:
lists_popular()
,
user_list()
,
user_list_comments()
,
user_list_items()
,
user_lists()
Other movie data:
anticipated_media
,
collected_media
,
media_aliases
,
media_comments
,
media_people
,
media_ratings()
,
media_stats()
,
media_translations
,
media_watching
,
movies_boxoffice()
,
movies_related()
,
movies_releases()
,
movies_summary()
,
people_media()
,
played_media
,
popular_media
,
trending_media
,
watched_media
Other list methods:
lists_popular()
,
user_list()
,
user_list_comments()
,
user_list_items()
,
user_lists()
Other show data:
collected_media
,
media_aliases
,
media_comments
,
media_people
,
media_ratings()
,
media_stats()
,
media_translations
,
media_watching
,
people_media()
,
played_media
,
shows_next_episode()
,
shows_related()
,
shows_summary()
Other list methods:
lists_popular()
,
user_list()
,
user_list_comments()
,
user_list_items()
,
user_lists()
Other season data:
media_comments
,
media_people
,
media_ratings()
,
media_stats()
,
seasons_season()
,
seasons_summary()
Other list methods:
lists_popular()
,
user_list()
,
user_list_comments()
,
user_list_items()
,
user_lists()
Other episode data:
episodes_summary()
,
media_comments
,
media_people
,
media_ratings()
,
media_stats()
,
media_translations
,
media_watching
,
seasons_season()
,
seasons_summary()
,
shows_next_episode()
Other list methods:
lists_popular()
,
user_list()
,
user_list_comments()
,
user_list_items()
,
user_lists()
Other people data:
media_people
,
people_media()
,
people_summary()
## Not run: movies_lists("190430", type = "personal", limit = 5) ## End(Not run) ## Not run: shows_lists("46241") ## End(Not run) ## Not run: seasons_lists("46241", season = 1) ## End(Not run) ## Not run: episodes_lists("46241", season = 1, episode = 1) ## End(Not run) ## Not run: people_lists("david-tennant") people_lists("emilia-clarke", sort = "items") ## End(Not run)
## Not run: movies_lists("190430", type = "personal", limit = 5) ## End(Not run) ## Not run: shows_lists("46241") ## End(Not run) ## Not run: seasons_lists("46241", season = 1) ## End(Not run) ## Not run: episodes_lists("46241", season = 1, episode = 1) ## End(Not run) ## Not run: people_lists("david-tennant") people_lists("emilia-clarke", sort = "items") ## End(Not run)
Returns all cast and crew for a show/movie, depending on how much data is available.
movies_people(id, extended = c("min", "full")) shows_people(id, guest_stars = FALSE, extended = c("min", "full")) seasons_people( id, season = 1L, guest_stars = FALSE, extended = c("min", "full") ) episodes_people( id, season = 1L, episode = 1L, guest_stars = FALSE, extended = c("min", "full") )
movies_people(id, extended = c("min", "full")) shows_people(id, guest_stars = FALSE, extended = c("min", "full")) seasons_people( id, season = 1L, guest_stars = FALSE, extended = c("min", "full") ) episodes_people( id, season = 1L, episode = 1L, guest_stars = FALSE, extended = c("min", "full") )
id |
|
extended |
|
guest_stars |
|
season , episode
|
|
A list
of one or more tibbles for cast
and/or crew
. The latter tibble
objects are as flat as possible.
As of 2019-09-30, there are two representations of character[s]
and
job[s]
:
One is a regular character variable, and the other is a list-column. The former is
deprecated and only included for
compatibility reasons.
movies_people()
wraps endpoint movies/:id/people.
shows_people()
wraps endpoint shows/:id/people.
seasons_people()
wraps endpoint shows/:id/seasons/:season/people.
episodes_people()
wraps endpoint shows/:id/seasons/:season/episodes/:episode/people.
people_media, for the other direction: People that have credits in shows/movies.
Other people data:
media_lists
,
people_media()
,
people_summary()
Other movie data:
anticipated_media
,
collected_media
,
media_aliases
,
media_comments
,
media_lists
,
media_ratings()
,
media_stats()
,
media_translations
,
media_watching
,
movies_boxoffice()
,
movies_related()
,
movies_releases()
,
movies_summary()
,
people_media()
,
played_media
,
popular_media
,
trending_media
,
watched_media
Other people data:
media_lists
,
people_media()
,
people_summary()
Other show data:
collected_media
,
media_aliases
,
media_comments
,
media_lists
,
media_ratings()
,
media_stats()
,
media_translations
,
media_watching
,
people_media()
,
played_media
,
shows_next_episode()
,
shows_related()
,
shows_summary()
Other people data:
media_lists
,
people_media()
,
people_summary()
Other season data:
media_comments
,
media_lists
,
media_ratings()
,
media_stats()
,
seasons_season()
,
seasons_summary()
Other people data:
media_lists
,
people_media()
,
people_summary()
Other episode data:
episodes_summary()
,
media_comments
,
media_lists
,
media_ratings()
,
media_stats()
,
media_translations
,
media_watching
,
seasons_season()
,
seasons_summary()
,
shows_next_episode()
Other people data:
media_lists
,
people_media()
,
people_summary()
## Not run: movies_people("deadpool-2016") shows_people("breaking-bad") seasons_people("breaking-bad", season = 1) episodes_people("breaking-bad", season = 1, episode = 1) ## End(Not run)
## Not run: movies_people("deadpool-2016") shows_people("breaking-bad") seasons_people("breaking-bad", season = 1) episodes_people("breaking-bad", season = 1, episode = 1) ## End(Not run)
Returns a movie's or show's (or season's, or episode's) rating and ratings distribution.
If you do not want the full ratings distribution, it is highly advised to
just use *_summary
functions or seasons_season for episode ratings.
shows_ratings(id) movies_ratings(id) seasons_ratings(id, season = 1L) episodes_ratings(id, season = 1L, episode = 1L)
shows_ratings(id) movies_ratings(id) seasons_ratings(id, season = 1L) episodes_ratings(id, season = 1L, episode = 1L)
id |
|
season , episode
|
|
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.
Since this function is able to work on multi-length inputs for
id
, season
and episode
, it is possible to get a lot of data, but at the cost
of one API call per element in each argument. Please be kind to the API.
shows_ratings()
wraps endpoint shows/:ids/ratings.
movies_ratings()
wraps endpoint movies/:id/ratings.
seasons_ratings()
wraps endpoint shows/:id/seasons/:season/ratings.
episodes_ratings()
wraps endpoint shows/:id/seasons/:season/episodes/:episode/ratings.
Other show data:
collected_media
,
media_aliases
,
media_comments
,
media_lists
,
media_people
,
media_stats()
,
media_translations
,
media_watching
,
people_media()
,
played_media
,
shows_next_episode()
,
shows_related()
,
shows_summary()
Other movie data:
anticipated_media
,
collected_media
,
media_aliases
,
media_comments
,
media_lists
,
media_people
,
media_stats()
,
media_translations
,
media_watching
,
movies_boxoffice()
,
movies_related()
,
movies_releases()
,
movies_summary()
,
people_media()
,
played_media
,
popular_media
,
trending_media
,
watched_media
Other season data:
media_comments
,
media_lists
,
media_people
,
media_stats()
,
seasons_season()
,
seasons_summary()
Other episode data:
episodes_summary()
,
media_comments
,
media_lists
,
media_people
,
media_stats()
,
media_translations
,
media_watching
,
seasons_season()
,
seasons_summary()
,
shows_next_episode()
# A movie's ratings movies_ratings("tron-legacy-2010") # A show's ratings shows_ratings("game-of-thrones") ## Not run: # Ratings for seasons 1 through 5 seasons_ratings("futurama", season = 1:5) # Ratings for episodes 1 through 7 of season 1 episodes_ratings("futurama", season = 1, episode = 1:7) ## End(Not run)
# A movie's ratings movies_ratings("tron-legacy-2010") # A show's ratings shows_ratings("game-of-thrones") ## Not run: # Ratings for seasons 1 through 5 seasons_ratings("futurama", season = 1:5) # Ratings for episodes 1 through 7 of season 1 episodes_ratings("futurama", season = 1, episode = 1:7) ## End(Not run)
The data contains watchers, playes, collectors, comments, lists, and votes.
shows_stats(id) movies_stats(id) seasons_stats(id, season = 1L) episodes_stats(id, season = 1L, episode = 1L)
shows_stats(id) movies_stats(id) seasons_stats(id, season = 1L) episodes_stats(id, season = 1L, episode = 1L)
id |
|
season , episode
|
|
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.
shows_stats()
wraps endpoint shows/:id/stats.
movies_stats()
wraps endpoint movies/:id/stats.
seasons_stats()
wraps endpoint shows/:id/seasons/:season/stats.
episodes_stats()
wraps endpoint shows/:id/seasons/:season/episodes/:episode/stats.
Other show data:
collected_media
,
media_aliases
,
media_comments
,
media_lists
,
media_people
,
media_ratings()
,
media_translations
,
media_watching
,
people_media()
,
played_media
,
shows_next_episode()
,
shows_related()
,
shows_summary()
Other movie data:
anticipated_media
,
collected_media
,
media_aliases
,
media_comments
,
media_lists
,
media_people
,
media_ratings()
,
media_translations
,
media_watching
,
movies_boxoffice()
,
movies_related()
,
movies_releases()
,
movies_summary()
,
people_media()
,
played_media
,
popular_media
,
trending_media
,
watched_media
Other season data:
media_comments
,
media_lists
,
media_people
,
media_ratings()
,
seasons_season()
,
seasons_summary()
Other episode data:
episodes_summary()
,
media_comments
,
media_lists
,
media_people
,
media_ratings()
,
media_translations
,
media_watching
,
seasons_season()
,
seasons_summary()
,
shows_next_episode()
# Stats for a movie movies_stats("inception-2010") ## Not run: # Stats for multiple shows at once shows_stats(c("breaking-bad", "game-of-thrones")) # Stats for multiple episodes episodes_stats("futurama", season = 1, episode = 1:7) ## End(Not run)
# Stats for a movie movies_stats("inception-2010") ## Not run: # Stats for multiple shows at once shows_stats(c("breaking-bad", "game-of-thrones")) # Stats for multiple episodes episodes_stats("futurama", season = 1, episode = 1:7) ## End(Not run)
Get translations for a movie, show or episode
movies_translations(id, languages = NULL) shows_translations(id, languages = NULL) episodes_translations(id, season = 1L, episode = 1L, languages = NULL)
movies_translations(id, languages = NULL) shows_translations(id, languages = NULL) episodes_translations(id, season = 1L, episode = 1L, languages = NULL)
id |
|
languages |
|
season , episode
|
|
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.
movies_translations()
wraps endpoint movies/:id/translations/:language.
shows_translations()
wraps endpoint shows/:id/translations/:language.
episodes_translations()
wraps endpoint shows/:id/seasons/:season/episodes/:episode/translations/:language.
Other movie data:
anticipated_media
,
collected_media
,
media_aliases
,
media_comments
,
media_lists
,
media_people
,
media_ratings()
,
media_stats()
,
media_watching
,
movies_boxoffice()
,
movies_related()
,
movies_releases()
,
movies_summary()
,
people_media()
,
played_media
,
popular_media
,
trending_media
,
watched_media
Other show data:
collected_media
,
media_aliases
,
media_comments
,
media_lists
,
media_people
,
media_ratings()
,
media_stats()
,
media_watching
,
people_media()
,
played_media
,
shows_next_episode()
,
shows_related()
,
shows_summary()
Other episode data:
episodes_summary()
,
media_comments
,
media_lists
,
media_people
,
media_ratings()
,
media_stats()
,
media_watching
,
seasons_season()
,
seasons_summary()
,
shows_next_episode()
# Get all translations movies_translations("193972") # Only get a specific language movies_translations("193972", "de")
# Get all translations movies_translations("193972") # Only get a specific language movies_translations("193972", "de")
Get who's watching a thing right now
movies_watching(id, extended = c("min", "full")) shows_watching(id, extended = c("min", "full")) seasons_watching(id, season = 1L, extended = c("min", "full")) episodes_watching(id, season = 1L, episode = 1L, extended = c("min", "full"))
movies_watching(id, extended = c("min", "full")) shows_watching(id, extended = c("min", "full")) seasons_watching(id, season = 1L, extended = c("min", "full")) episodes_watching(id, season = 1L, episode = 1L, extended = c("min", "full"))
id |
|
extended |
|
season , episode
|
|
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.
movies_watching()
: Who's watching a movie.
shows_watching()
: Who's watching a show.
seasons_watching()
: Who's watching a season.
episodes_watching()
: Who's watching an episode.
movies_watching()
wraps endpoint movies/:id/watching.
shows_watching()
wraps endpoint shows/:id/watching.
episodes_watching()
wraps endpoint shows/:id/seasons/:season/episodes/:episode/watching.
Other movie data:
anticipated_media
,
collected_media
,
media_aliases
,
media_comments
,
media_lists
,
media_people
,
media_ratings()
,
media_stats()
,
media_translations
,
movies_boxoffice()
,
movies_related()
,
movies_releases()
,
movies_summary()
,
people_media()
,
played_media
,
popular_media
,
trending_media
,
watched_media
Other show data:
collected_media
,
media_aliases
,
media_comments
,
media_lists
,
media_people
,
media_ratings()
,
media_stats()
,
media_translations
,
people_media()
,
played_media
,
shows_next_episode()
,
shows_related()
,
shows_summary()
Other episode data:
episodes_summary()
,
media_comments
,
media_lists
,
media_people
,
media_ratings()
,
media_stats()
,
media_translations
,
seasons_season()
,
seasons_summary()
,
shows_next_episode()
## Not run: movies_watching("deadpool-2016") shows_watching("the-simpsons") seasons_watching("the-simpsons", season = 6) episodes_watching("the-simpsons", season = 6, episode = 12) ## End(Not run)
## Not run: movies_watching("deadpool-2016") shows_watching("the-simpsons") seasons_watching("the-simpsons", season = 6) episodes_watching("the-simpsons", season = 6, episode = 12) ## End(Not run)
Returns the top 10 grossing movies in the U.S. box office last weekend. Updated every Monday morning.
movies_boxoffice(extended = c("min", "full"))
movies_boxoffice(extended = c("min", "full"))
extended |
|
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.
movies_boxoffice()
wraps endpoint movies/boxoffice.
Other movie data:
anticipated_media
,
collected_media
,
media_aliases
,
media_comments
,
media_lists
,
media_people
,
media_ratings()
,
media_stats()
,
media_translations
,
media_watching
,
movies_related()
,
movies_releases()
,
movies_summary()
,
people_media()
,
played_media
,
popular_media
,
trending_media
,
watched_media
movies_boxoffice()
movies_boxoffice()
Retrieve one or more movie's release information,
including the release date, country code (two letter, e.g. us
), and
the certification (e.g. PG
).
movies_releases(id, country = NULL)
movies_releases(id, country = NULL)
id |
|
country |
Optional two letter country code to filter by. See trakt_countries for a table of country codes. |
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.
movies_releases()
wraps endpoint movies/:id/releases/:country.
Other movie data:
anticipated_media
,
collected_media
,
media_aliases
,
media_comments
,
media_lists
,
media_people
,
media_ratings()
,
media_stats()
,
media_translations
,
media_watching
,
movies_boxoffice()
,
movies_related()
,
movies_summary()
,
people_media()
,
played_media
,
popular_media
,
trending_media
,
watched_media
## Not run: movies_releases("tron-legacy-2010") ## End(Not run)
## Not run: movies_releases("tron-legacy-2010") ## End(Not run)
Get a single movie
movies_summary(id, extended = c("min", "full"))
movies_summary(id, extended = c("min", "full"))
id |
|
extended |
|
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.
movies_summary()
wraps endpoint movies/:id.
Other movie data:
anticipated_media
,
collected_media
,
media_aliases
,
media_comments
,
media_lists
,
media_people
,
media_ratings()
,
media_stats()
,
media_translations
,
media_watching
,
movies_boxoffice()
,
movies_related()
,
movies_releases()
,
people_media()
,
played_media
,
popular_media
,
trending_media
,
watched_media
Other summary methods:
comments_comment()
,
episodes_summary()
,
people_summary()
,
seasons_summary()
,
shows_summary()
,
user_profile()
# Minimal info by default movies_summary("inception-2010") ## Not run: # Full information, multiple movies movies_summary(c("inception-2010", "the-dark-knight-2008"), extended = "full") ## End(Not run)
# Minimal info by default movies_summary("inception-2010") ## Not run: # Full information, multiple movies movies_summary(c("inception-2010", "the-dark-knight-2008"), extended = "full") ## End(Not run)
Simple function to ease the creation of sXXeYY
episode ids.
Note that s
and e
must have the same length.
pad_episode(s = "0", e = "0", s_width = 2, e_width = 2)
pad_episode(s = "0", e = "0", s_width = 2, e_width = 2)
s |
Input season number, coerced to |
e |
Input episode number, coerced to |
s_width |
The length of the season number padding. Defaults to 2. |
e_width |
The length of the episode number padding. Defaults to 2. |
A character
in the common sXXeYY
format
I like my sXXeYY format, okay?
Other utility functions:
build_trakt_url()
# Season 2, episode 4 pad_episode(2, 4) pad_episode(1, 85, e_width = 3)
# Season 2, episode 4 pad_episode(2, 4) pad_episode(1, 85, e_width = 3)
Returns all movies or shows where this person is in the cast or crew.
people_movies(id, extended = c("min", "full")) people_shows(id, extended = c("min", "full"))
people_movies(id, extended = c("min", "full")) people_shows(id, extended = c("min", "full"))
id |
|
extended |
|
Note that as of 2019-09-30, there are two representations of character[s]
and job[s]
:
One is a regular character variable, and the other is a list-column. The singular is
deprecated and only included for compatibility reasons.
A list
of one or more tibbles for cast
and crew
. The latter tibble
objects are as flat as possible.
people_movies()
wraps endpoint people/:id/movies.
people_shows()
wraps endpoint people/:id/shows.
media_people, for the other direction: Media that has people.
Other movie data:
anticipated_media
,
collected_media
,
media_aliases
,
media_comments
,
media_lists
,
media_people
,
media_ratings()
,
media_stats()
,
media_translations
,
media_watching
,
movies_boxoffice()
,
movies_related()
,
movies_releases()
,
movies_summary()
,
played_media
,
popular_media
,
trending_media
,
watched_media
Other people data:
media_lists
,
media_people
,
people_summary()
Other show data:
collected_media
,
media_aliases
,
media_comments
,
media_lists
,
media_people
,
media_ratings()
,
media_stats()
,
media_translations
,
media_watching
,
played_media
,
shows_next_episode()
,
shows_related()
,
shows_summary()
Other people data:
media_lists
,
media_people
,
people_summary()
## Not run: people_movies("christopher-nolan") people_shows("kit-harington") ## End(Not run)
## Not run: people_movies("christopher-nolan") people_shows("kit-harington") ## End(Not run)
Get a single person's details, like their various IDs. If extended
is
"full"
, there will also be biographical data if available, e.g. their
birthday.
people_summary(id, extended = c("min", "full"))
people_summary(id, extended = c("min", "full"))
id |
|
extended |
|
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.
people_summary()
wraps endpoint people/:id.
Other people data:
media_lists
,
media_people
,
people_media()
Other summary methods:
comments_comment()
,
episodes_summary()
,
movies_summary()
,
seasons_summary()
,
shows_summary()
,
user_profile()
# A single person's extended information people_summary("bryan-cranston", "full") # Multiple people people_summary(c("kit-harington", "emilia-clarke"))
# A single person's extended information people_summary("bryan-cranston", "full") # Multiple people people_summary(c("kit-harington", "emilia-clarke"))
These functions return the most played movies/shows on trakt.tv.
movies_played( limit = 10, extended = c("min", "full"), period = c("weekly", "monthly", "yearly", "all"), query = NULL, years = NULL, genres = NULL, languages = NULL, countries = NULL, runtimes = NULL, ratings = NULL, certifications = NULL ) shows_played( limit = 10, extended = c("min", "full"), period = c("weekly", "monthly", "yearly", "all"), query = NULL, years = NULL, genres = NULL, languages = NULL, countries = NULL, runtimes = NULL, ratings = NULL, certifications = NULL, networks = NULL, status = NULL )
movies_played( limit = 10, extended = c("min", "full"), period = c("weekly", "monthly", "yearly", "all"), query = NULL, years = NULL, genres = NULL, languages = NULL, countries = NULL, runtimes = NULL, ratings = NULL, certifications = NULL ) shows_played( limit = 10, extended = c("min", "full"), period = c("weekly", "monthly", "yearly", "all"), query = NULL, years = NULL, genres = NULL, languages = NULL, countries = NULL, runtimes = NULL, ratings = NULL, certifications = NULL, networks = NULL, status = NULL )
limit |
|
extended |
|
period |
|
query |
|
years |
|
genres |
|
languages |
|
countries |
|
runtimes |
|
ratings |
|
certifications |
|
networks |
|
status |
|
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.
These functions access the automatically updated lists provided by trakt.tv. Each function comes in two flavors: Shows or movies. The following descriptions are adapted directly from the API reference.
Popular: Popularity is calculated using the rating percentage and the number of ratings.
Trending: Returns all movies/shows being watched right now. Movies/shows with the most users are returned first.
Played: Returns the most played (a single user can watch multiple times)
movies/shows in the specified time period
.
Watched: Returns the most watched (unique users) movies/shows in the specified
time period
.
Collected: Returns the most collected (unique users) movies/shows in the
specified time period
.
Anticipated: Returns the most anticipated movies/shows based on the number of
lists a movie/show appears on.
The functions for Played, Watched, Collected and Played each return
the same additional variables besides the media information: watcher_count
,
play_count
, collected_count
, collector_count
.
movies_played()
wraps endpoint movies/played/:period.
shows_played()
wraps endpoint shows/played/:period.
Other movie data:
anticipated_media
,
collected_media
,
media_aliases
,
media_comments
,
media_lists
,
media_people
,
media_ratings()
,
media_stats()
,
media_translations
,
media_watching
,
movies_boxoffice()
,
movies_related()
,
movies_releases()
,
movies_summary()
,
people_media()
,
popular_media
,
trending_media
,
watched_media
Other dynamic lists:
anticipated_media
,
collected_media
,
lists_popular()
,
popular_media
,
trending_media
,
watched_media
Other show data:
collected_media
,
media_aliases
,
media_comments
,
media_lists
,
media_people
,
media_ratings()
,
media_stats()
,
media_translations
,
media_watching
,
people_media()
,
shows_next_episode()
,
shows_related()
,
shows_summary()
Other dynamic lists:
anticipated_media
,
collected_media
,
lists_popular()
,
popular_media
,
trending_media
,
watched_media
These functions return the popular movies/shows on trakt.tv.
movies_popular( limit = 10, extended = c("min", "full"), query = NULL, years = NULL, genres = NULL, languages = NULL, countries = NULL, runtimes = NULL, ratings = NULL, certifications = NULL ) shows_popular( limit = 10, extended = c("min", "full"), query = NULL, years = NULL, genres = NULL, languages = NULL, countries = NULL, runtimes = NULL, ratings = NULL, certifications = NULL, networks = NULL, status = NULL )
movies_popular( limit = 10, extended = c("min", "full"), query = NULL, years = NULL, genres = NULL, languages = NULL, countries = NULL, runtimes = NULL, ratings = NULL, certifications = NULL ) shows_popular( limit = 10, extended = c("min", "full"), query = NULL, years = NULL, genres = NULL, languages = NULL, countries = NULL, runtimes = NULL, ratings = NULL, certifications = NULL, networks = NULL, status = NULL )
limit |
|
extended |
|
query |
|
years |
|
genres |
|
languages |
|
countries |
|
runtimes |
|
ratings |
|
certifications |
|
networks |
|
status |
|
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.
These functions access the automatically updated lists provided by trakt.tv. Each function comes in two flavors: Shows or movies. The following descriptions are adapted directly from the API reference.
Popular: Popularity is calculated using the rating percentage and the number of ratings.
Trending: Returns all movies/shows being watched right now. Movies/shows with the most users are returned first.
Played: Returns the most played (a single user can watch multiple times)
movies/shows in the specified time period
.
Watched: Returns the most watched (unique users) movies/shows in the specified
time period
.
Collected: Returns the most collected (unique users) movies/shows in the
specified time period
.
Anticipated: Returns the most anticipated movies/shows based on the number of
lists a movie/show appears on.
The functions for Played, Watched, Collected and Played each return
the same additional variables besides the media information: watcher_count
,
play_count
, collected_count
, collector_count
.
movies_popular()
wraps endpoint movies/popular.
shows_popular()
wraps endpoint shows/popular.
Other movie data:
anticipated_media
,
collected_media
,
media_aliases
,
media_comments
,
media_lists
,
media_people
,
media_ratings()
,
media_stats()
,
media_translations
,
media_watching
,
movies_boxoffice()
,
movies_related()
,
movies_releases()
,
movies_summary()
,
people_media()
,
played_media
,
trending_media
,
watched_media
Other dynamic lists:
anticipated_media
,
collected_media
,
lists_popular()
,
played_media
,
trending_media
,
watched_media
Other shows data:
anticipated_media
,
trending_media
,
watched_media
Other dynamic lists:
anticipated_media
,
collected_media
,
lists_popular()
,
played_media
,
trending_media
,
watched_media
## Not run: # Get the most popular German-language movies between 2000 and 2010 movies_popular(languages = "de", years = c(2000, 2010)) ## End(Not run)
## Not run: # Get the most popular German-language movies between 2000 and 2010 movies_popular(languages = "de", years = c(2000, 2010)) ## End(Not run)
Search for a show or movie with a keyword (e.g. "Breaking Bad"
) and receive
basic info of the first search result. It's main use is to retrieve
the IDs or proper show/movie title for further use, as well
as receiving a quick overview of a show/movie.
search_query( query, type = "show", n_results = 1L, extended = c("min", "full"), years = NULL, genres = NULL, languages = NULL, countries = NULL, runtimes = NULL, ratings = NULL, certifications = NULL, networks = NULL, status = NULL ) search_id( id, id_type = c("trakt", "imdb", "tmdb", "tvdb"), type = "show", n_results = 1L, extended = c("min", "full") )
search_query( query, type = "show", n_results = 1L, extended = c("min", "full"), years = NULL, genres = NULL, languages = NULL, countries = NULL, runtimes = NULL, ratings = NULL, certifications = NULL, networks = NULL, status = NULL ) search_id( id, id_type = c("trakt", "imdb", "tmdb", "tvdb"), type = "show", n_results = 1L, extended = c("min", "full") )
query |
|
type |
|
n_results |
|
extended |
|
years |
|
genres |
|
languages |
|
countries |
|
runtimes |
|
ratings |
|
certifications |
|
networks |
|
status |
|
id |
|
id_type |
|
The amount of information returned is equal to *_summary
API methods and
in turn depends on the value of extended
.
See also the
API reference here for
which fields of the item metadata are searched by default.
A tibble containing n_results
results.
Variable type
is equivalent to the value of the type
argument, and
variable score
indicates the search match, where 1000
is a perfect
match.
If no results are found, the tibble
has 0 rows.
If more than one type
is specified, e.g. c("movie", "show")
,
there will be n_results
results per type.
search_query()
wraps endpoint search/:type?query=.
search_id()
wraps endpoint search/:id_type/:id?type=.
# A show search_query("Breaking Bad", type = "show", n_results = 3) ## Not run: # A show by its trakt id, and now with more information search_id(1388, "trakt", type = "show", extended = "full") # A person search_query("J. K. Simmons", type = "person", extended = "full") # A movie or a show, two of each search_query("Tron", type = c("movie", "show"), n_results = 2) ## End(Not run)
# A show search_query("Breaking Bad", type = "show", n_results = 3) ## Not run: # A show by its trakt id, and now with more information search_id(1388, "trakt", type = "show", extended = "full") # A person search_query("J. K. Simmons", type = "person", extended = "full") # A movie or a show, two of each search_query("Tron", type = c("movie", "show"), n_results = 2) ## End(Not run)
Similar to seasons_summary, but this function returns full data for a single season, i.e. all the episodes of the season
seasons_season(id, seasons = 1L, extended = c("min", "full"))
seasons_season(id, seasons = 1L, extended = c("min", "full"))
id |
|
seasons |
|
extended |
|
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.
If you want to quickly gather episode data of all available seasons,
see seasons_summary and use the episodes = TRUE
parameter.
seasons_season()
wraps endpoint shows/id/seasons/season.
Other season data:
media_comments
,
media_lists
,
media_people
,
media_ratings()
,
media_stats()
,
seasons_summary()
Other episode data:
episodes_summary()
,
media_comments
,
media_lists
,
media_people
,
media_ratings()
,
media_stats()
,
media_translations
,
media_watching
,
seasons_summary()
,
shows_next_episode()
## Not run: seasons_season("breaking-bad", 1) # Including all episode data: seasons_season("breaking-bad", 1, extended = "full") ## End(Not run)
## Not run: seasons_season("breaking-bad", 1) # Including all episode data: seasons_season("breaking-bad", 1, extended = "full") ## End(Not run)
Get details for a show's seasons, e.g. how many seasons there are and how many epsiodes
each season has. With episodes == TRUE
and extended == "full"
, this function
is also suitable to retrieve all episode data for all seasons of a show with
just a single API call.
seasons_summary( id, episodes = FALSE, drop_specials = TRUE, drop_unaired = TRUE, extended = c("min", "full") )
seasons_summary( id, episodes = FALSE, drop_specials = TRUE, drop_unaired = TRUE, extended = c("min", "full") )
id |
|
episodes |
|
drop_specials |
|
drop_unaired |
|
extended |
|
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.
seasons_summary()
wraps endpoint shows/:id/seasons.
Other season data:
media_comments
,
media_lists
,
media_people
,
media_ratings()
,
media_stats()
,
seasons_season()
Other episode data:
episodes_summary()
,
media_comments
,
media_lists
,
media_people
,
media_ratings()
,
media_stats()
,
media_translations
,
media_watching
,
seasons_season()
,
shows_next_episode()
Other summary methods:
comments_comment()
,
episodes_summary()
,
movies_summary()
,
people_summary()
,
shows_summary()
,
user_profile()
# Get just the season numbers and their IDs seasons_summary("breaking-bad", extended = "min") ## Not run: # Get season numbers, ratings, votes, titles and other metadata as well as # a list-column containing all episode data seasons_summary("utopia", extended = "full", episodes = TRUE) ## End(Not run)
# Get just the season numbers and their IDs seasons_summary("breaking-bad", extended = "min") ## Not run: # Get season numbers, ratings, votes, titles and other metadata as well as # a list-column containing all episode data seasons_summary("utopia", extended = "full", episodes = TRUE) ## End(Not run)
Get a shows next or latest episode
shows_next_episode(id, extended = c("min", "full")) shows_last_episode(id, extended = c("min", "full"))
shows_next_episode(id, extended = c("min", "full")) shows_last_episode(id, extended = c("min", "full"))
id |
|
extended |
|
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.
shows_next_episode()
wraps endpoint shows/:id/next_episode.
shows_last_episode()
wraps endpoint shows/:id/last_episode.
Other show data:
collected_media
,
media_aliases
,
media_comments
,
media_lists
,
media_people
,
media_ratings()
,
media_stats()
,
media_translations
,
media_watching
,
people_media()
,
played_media
,
shows_related()
,
shows_summary()
Other episode data:
episodes_summary()
,
media_comments
,
media_lists
,
media_people
,
media_ratings()
,
media_stats()
,
media_translations
,
media_watching
,
seasons_season()
,
seasons_summary()
Other show data:
collected_media
,
media_aliases
,
media_comments
,
media_lists
,
media_people
,
media_ratings()
,
media_stats()
,
media_translations
,
media_watching
,
people_media()
,
played_media
,
shows_related()
,
shows_summary()
Other episode data:
episodes_summary()
,
media_comments
,
media_lists
,
media_people
,
media_ratings()
,
media_stats()
,
media_translations
,
media_watching
,
seasons_season()
,
seasons_summary()
shows_next_episode("one-piece") shows_last_episode("one-piece", extended = "full")
shows_next_episode("one-piece") shows_last_episode("one-piece", extended = "full")
Get a single show
shows_summary(id, extended = c("min", "full"))
shows_summary(id, extended = c("min", "full"))
id |
|
extended |
|
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.
shows_summary()
wraps endpoint shows/:id.
Other show data:
collected_media
,
media_aliases
,
media_comments
,
media_lists
,
media_people
,
media_ratings()
,
media_stats()
,
media_translations
,
media_watching
,
people_media()
,
played_media
,
shows_next_episode()
,
shows_related()
Other summary methods:
comments_comment()
,
episodes_summary()
,
movies_summary()
,
people_summary()
,
seasons_summary()
,
user_profile()
# Minimal info by default shows_summary("breaking-bad") ## Not run: # More information shows_summary("breaking-bad", extended = "full") ## End(Not run)
# Minimal info by default shows_summary("breaking-bad") ## Not run: # More information shows_summary("breaking-bad", extended = "full") ## End(Not run)
trakt_credentials
searches for your credentials and stores them
in the appropriate environment variables of the same name.
To make this work automatically, place your key as environment variables in
~/.Renviron
(see Details
).
Arguments to this function take precedence over any configuration file.
trakt_credentials(username, client_id, client_secret, silent = TRUE)
trakt_credentials(username, client_id, client_secret, silent = TRUE)
username |
|
client_id |
|
client_secret |
|
silent |
|
This function is called automatically when the package is loaded via library(tRakt)
or tRakt::fun
function calls – you basically never have to use it if you have
stored your credentials as advised.
Additionally, for regular (non-authenticated) API interaction, you do not have to
set any credentials at all because the package's client_secret
is used as a fallback,
which allows you to use most functions out of the box.
Set appropriate values in your ~/.Renviron
like this:
# tRakt trakt_username=jemus42 trakt_client_id=12[...]f2 trakt_client_secret=f23[...]2nkjb
If (and only if) the environment option trakt_client_secret
is set to a non-empty
string (i.e. it's not ""
), then all requests will be made using authentication.
Invisibly: A list
with elements username
, client_id
and client_secret
,
where values are TRUE
if the corresponding value is non-empty.
Other API-basics:
trakt_get()
,
trakt_get_token()
## Not run: # Use a values set in ~/.Renviron in an R session: # (This is automatically executed when calling library(tRakt)) trakt_credentials(silent = FALSE) # Explicitly set values in an R session, overriding .Renviron values trakt_credentials( username = "jemus42", client_id = "totallylegitclientsecret", silent = FALSE ) ## End(Not run)
## Not run: # Use a values set in ~/.Renviron in an R session: # (This is automatically executed when calling library(tRakt)) trakt_credentials(silent = FALSE) # Explicitly set values in an R session, overriding .Renviron values trakt_credentials( username = "jemus42", client_id = "totallylegitclientsecret", silent = FALSE ) ## End(Not run)
These datasets are used internally to check the optional filter parameters for certain functions (see search_query or the dynamic lists like shows_popular). They are unlikely to change often and are therefore included as package datasets.
trakt_genres trakt_languages trakt_networks trakt_countries trakt_certifications
trakt_genres trakt_languages trakt_networks trakt_countries trakt_certifications
Every dataset is a tibble(). The following list includes the dataset topic with a link to the API documentation, a short description and a list of variables with example values:
Genres: Genres for shows and movies (with their two-letter codes) trakt.tv knows.
3 Variables: name
("Action"), slug
("action"), type
("movies")
Languages: Languages (and two-letter codes) trakt.tv knows.
3 Variables: name
("Arabic"), code
("ar"), type
("movies")
Networks: TV networks trakt.tv knows.
2 Variables: name
("TBS"), name_clean
("tbs") (lower-case, no trailing whitespaces)
Countries: Country names (and two-letter codes).
3 Variables: name
("Belarus"), code
("by"), type
("movies")
Certifications: TV and movie certifications (e.g. "PG-13" and the likes).
5 Variables: country
("us" only), name
("TV-PG"),
slug
("tv-pg"), description
("Parental Guidance Suggested"), type
("shows")
An object of class tbl_df
(inherits from tbl
, data.frame
) with 64 rows and 3 columns.
An object of class tbl_df
(inherits from tbl
, data.frame
) with 244 rows and 3 columns.
An object of class tbl_df
(inherits from tbl
, data.frame
) with 3081 rows and 2 columns.
An object of class tbl_df
(inherits from tbl
, data.frame
) with 350 rows and 3 columns.
An object of class tbl_df
(inherits from tbl
, data.frame
) with 12 rows and 5 columns.
The datasets are prefixed with trakt_
purely to avoid confusion or masking for
filter arguments of the same name.
Currently only US certifications are available.
head(trakt_genres) head(trakt_languages) head(trakt_networks) head(trakt_countries) trakt_certifications
head(trakt_genres) head(trakt_languages) head(trakt_networks) head(trakt_countries) trakt_certifications
The most basic form of API interaction: Querying a specific URL and getting
its parsed result. If the response is empty, the function returns an empty
tibble(), and if there are date-time variables
present in the response, they are converted to POSIXct
via
lubridate::ymd_hms()
or to Date
via lubridate::as_date()
if the
variable only contains date information.
trakt_get(url, client_id = Sys.getenv("trakt_client_id"), HEAD = FALSE)
trakt_get(url, client_id = Sys.getenv("trakt_client_id"), HEAD = FALSE)
url |
|
client_id |
|
HEAD |
|
See the official API reference for a detailed overview of available methods. Most methods of potential interest for data collection have dedicated functions in this package.
The parsed (jsonlite::fromJSON()
) content of the API response.
An empty tibble() if the response is an empty
JSON
array.
No OAuth2 methods are supported yet, meaning you don't have access to
POST
methods or user information of non-public profiles.
Other API-basics:
trakt_credentials()
,
trakt_get_token()
# A simple request to a direct URL trakt_get("https://api.trakt.tv/shows/breaking-bad") # A HEAD-only request # useful for validating a URL exists or the API is accessible trakt_get("https://api.trakt.tv/users/jemus42", HEAD = TRUE) # Optionally be lazy about URL specification by dropping the hostname: trakt_get("shows/game-of-thrones")
# A simple request to a direct URL trakt_get("https://api.trakt.tv/shows/breaking-bad") # A HEAD-only request # useful for validating a URL exists or the API is accessible trakt_get("https://api.trakt.tv/users/jemus42", HEAD = TRUE) # Optionally be lazy about URL specification by dropping the hostname: trakt_get("shows/game-of-thrones")
These functions return the trending movies/shows on trakt.tv.
movies_trending( limit = 10, extended = c("min", "full"), query = NULL, years = NULL, genres = NULL, languages = NULL, countries = NULL, runtimes = NULL, ratings = NULL, certifications = NULL ) shows_trending( limit = 10, extended = c("min", "full"), query = NULL, years = NULL, genres = NULL, languages = NULL, countries = NULL, runtimes = NULL, ratings = NULL, certifications = NULL, networks = NULL, status = NULL )
movies_trending( limit = 10, extended = c("min", "full"), query = NULL, years = NULL, genres = NULL, languages = NULL, countries = NULL, runtimes = NULL, ratings = NULL, certifications = NULL ) shows_trending( limit = 10, extended = c("min", "full"), query = NULL, years = NULL, genres = NULL, languages = NULL, countries = NULL, runtimes = NULL, ratings = NULL, certifications = NULL, networks = NULL, status = NULL )
limit |
|
extended |
|
query |
|
years |
|
genres |
|
languages |
|
countries |
|
runtimes |
|
ratings |
|
certifications |
|
networks |
|
status |
|
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.
These functions access the automatically updated lists provided by trakt.tv. Each function comes in two flavors: Shows or movies. The following descriptions are adapted directly from the API reference.
Popular: Popularity is calculated using the rating percentage and the number of ratings.
Trending: Returns all movies/shows being watched right now. Movies/shows with the most users are returned first.
Played: Returns the most played (a single user can watch multiple times)
movies/shows in the specified time period
.
Watched: Returns the most watched (unique users) movies/shows in the specified
time period
.
Collected: Returns the most collected (unique users) movies/shows in the
specified time period
.
Anticipated: Returns the most anticipated movies/shows based on the number of
lists a movie/show appears on.
The functions for Played, Watched, Collected and Played each return
the same additional variables besides the media information: watcher_count
,
play_count
, collected_count
, collector_count
.
movies_trending()
wraps endpoint movies/trending.
shows_trending()
wraps endpoint shows/trending.
Other movie data:
anticipated_media
,
collected_media
,
media_aliases
,
media_comments
,
media_lists
,
media_people
,
media_ratings()
,
media_stats()
,
media_translations
,
media_watching
,
movies_boxoffice()
,
movies_related()
,
movies_releases()
,
movies_summary()
,
people_media()
,
played_media
,
popular_media
,
watched_media
Other dynamic lists:
anticipated_media
,
collected_media
,
lists_popular()
,
played_media
,
popular_media
,
watched_media
Other shows data:
anticipated_media
,
popular_media
,
watched_media
Other dynamic lists:
anticipated_media
,
collected_media
,
lists_popular()
,
played_media
,
popular_media
,
watched_media
Get a user's collected shows or movies
user_collection( user = getOption("trakt_username"), type = c("shows", "movies"), unnest_episodes = FALSE, extended = c("min", "full") )
user_collection( user = getOption("trakt_username"), type = c("shows", "movies"), unnest_episodes = FALSE, extended = c("min", "full") )
user |
|
type |
|
unnest_episodes |
|
extended |
|
This function wraps the API method
/users/:user_id/collection/:type
.
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.
The extended = "metadata"
API parameter is not implemented. This would
add media information media_type
, resolution
, audio
, audio_channels
and 3D
to the output, which may or may not be available. If this feature is important to
you, please open an issue on GitHub.
user_collection()
wraps endpoint users/:id/collection/:type.
Other user data:
user_comments()
,
user_history()
,
user_likes()
,
user_network()
,
user_profile()
,
user_ratings()
,
user_stats()
,
user_watched()
,
user_watchlist()
## Not run: user_collection(user = "sean", type = "movies") user_collection(user = "sean", type = "shows") ## End(Not run)
## Not run: user_collection(user = "sean", type = "movies") user_collection(user = "sean", type = "shows") ## End(Not run)
Get a user's comments
user_comments( user = getOption("trakt_username"), comment_type = c("all", "reviews", "shouts"), type = c("all", "movies", "shows", "seasons", "episodes", "lists"), include_replies = FALSE )
user_comments( user = getOption("trakt_username"), comment_type = c("all", "reviews", "shouts"), type = c("all", "movies", "shows", "seasons", "episodes", "lists"), include_replies = FALSE )
user |
|
comment_type |
|
type |
|
include_replies |
|
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.
user_comments()
wraps endpoint users/:id/comments/:comment_type/:type?include_replies=.
Other user data:
user_collection()
,
user_history()
,
user_likes()
,
user_network()
,
user_profile()
,
user_ratings()
,
user_stats()
,
user_watched()
,
user_watchlist()
Other comment methods:
comments_comment()
,
comments_trending()
,
comments_updates()
,
media_comments
,
user_list_comments()
## Not run: user_comments("jemus42") ## End(Not run)
## Not run: user_comments("jemus42") ## End(Not run)
Retrieve a the last limit
items a user has watched, including the method by
which it was logged (e.g. scrobble or checkin).
user_history( user = getOption("trakt_username"), type = c("shows", "movies"), limit = 10L, start_at = NULL, end_at = NULL, extended = c("min", "full") )
user_history( user = getOption("trakt_username"), type = c("shows", "movies"), limit = 10L, start_at = NULL, end_at = NULL, extended = c("min", "full") )
user |
|
type |
|
limit |
|
start_at , end_at
|
|
extended |
|
This function wraps the API method
/users/:id/history/:type
.
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.
For type = "shows"
, the
original output contains a nested object with show
and episode
data,
which are unnested by this function. Due to duplicate variable names,
all episode-related variables are prefixed with episode_
. This results in the
episode number having the name episode_episode
, which is quite silly. Sorry.
user_history()
wraps endpoint users/:id/history/:type/:item_id?start_at=&end_at=.
Other user data:
user_collection()
,
user_comments()
,
user_likes()
,
user_network()
,
user_profile()
,
user_ratings()
,
user_stats()
,
user_watched()
,
user_watchlist()
## Not run: # Shows user "jemus42" watched around christmas 2016 user_history( user = "jemus42", type = "shows", limit = 5, start_at = "2015-12-24", end_at = "2015-12-28" ) ## End(Not run)
## Not run: # Shows user "jemus42" watched around christmas 2016 user_history( user = "jemus42", type = "shows", limit = 5, start_at = "2015-12-24", end_at = "2015-12-28" ) ## End(Not run)
Get items (comments, lists) a user likes
user_likes(type = c("comments", "lists"))
user_likes(type = c("comments", "lists"))
type |
|
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.
user_likes()
wraps endpoint users/likes/:type (Authentication required).
Other user data:
user_collection()
,
user_comments()
,
user_history()
,
user_network()
,
user_profile()
,
user_ratings()
,
user_stats()
,
user_watched()
,
user_watchlist()
# Get liked lists (only if there's a client secret set) # See ?trakt_credentials if (trakt_credentials()[["client_secret"]]) { user_likes("lists") }
# Get liked lists (only if there's a client secret set) # See ?trakt_credentials if (trakt_credentials()[["client_secret"]]) { user_likes("lists") }
Retrieve a single list a user has created together with information about the user.
Use extended = "full"
to retrieve all user profile data, similiar to user_profile.
The returned variables trakt
(list ID) or slug
(list slug) can be used to
retrieve the list's items via user_list_items.
user_list( user = getOption("trakt_username"), list_id, extended = c("min", "full") )
user_list( user = getOption("trakt_username"), list_id, extended = c("min", "full") )
user |
|
list_id |
The list identifier, either |
extended |
|
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.
In the embedded user data, name
is renamed to user_name
due
to duplication with e.g. list names,
and slug
is renamed to user_slug
for the same reason.
user_list for only a single list.
user_list_items For the actual content of a list.
Other list methods:
lists_popular()
,
media_lists
,
user_list_comments()
,
user_list_items()
,
user_lists()
## Not run: user_list("jemus42", list_id = 2121308) ## End(Not run)
## Not run: user_list("jemus42", list_id = 2121308) ## End(Not run)
Get comments on a user-created list
user_list_comments( user = getOption("trakt_username"), list_id, sort = c("newest", "oldest", "likes", "replies"), extended = c("min", "full") )
user_list_comments( user = getOption("trakt_username"), list_id, sort = c("newest", "oldest", "likes", "replies"), extended = c("min", "full") )
user |
|
list_id |
The list identifier, either |
sort |
|
extended |
|
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.
user_list_comments()
wraps endpoint users/:id/lists/:list_id/comments/:sort.
Other comment methods:
comments_comment()
,
comments_trending()
,
comments_updates()
,
media_comments
,
user_comments()
Other list methods:
lists_popular()
,
media_lists
,
user_list()
,
user_list_items()
,
user_lists()
## Not run: user_list_comments("donxy", "1248149") ## End(Not run)
## Not run: user_list_comments("donxy", "1248149") ## End(Not run)
Get a user's list's items
user_list_items( user = getOption("trakt_username"), list_id, type = NULL, extended = c("min", "full") )
user_list_items( user = getOption("trakt_username"), list_id, type = NULL, extended = c("min", "full") )
user |
|
list_id |
The list identifier, either |
type |
|
extended |
|
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.
user_list_items()
wraps endpoint users/:id/lists/:list_id/items/:type.
Other list methods:
lists_popular()
,
media_lists
,
user_list()
,
user_list_comments()
,
user_lists()
## Not run: # A large list with various media types # All items user_list_items("sp1ti", list_id = "5615781", extended = "min") # Movies only user_list_items("sp1ti", list_id = "5615781", extended = "min", type = "movie") # Shows... user_list_items("sp1ti", list_id = "5615781", extended = "min", type = "shows") # Only seasons user_list_items("sp1ti", list_id = "5615781", extended = "min", type = "season") # Only episodes user_list_items("sp1ti", list_id = "5615781", extended = "min", type = "episodes") ## End(Not run)
## Not run: # A large list with various media types # All items user_list_items("sp1ti", list_id = "5615781", extended = "min") # Movies only user_list_items("sp1ti", list_id = "5615781", extended = "min", type = "movie") # Shows... user_list_items("sp1ti", list_id = "5615781", extended = "min", type = "shows") # Only seasons user_list_items("sp1ti", list_id = "5615781", extended = "min", type = "season") # Only episodes user_list_items("sp1ti", list_id = "5615781", extended = "min", type = "episodes") ## End(Not run)
Retrieve all lists a user has created together with information about the user.
Use extended = "full"
to retrieve all user profile data, similiar to user_profile.
The returned variables trakt
(list ID) or slug
(list slug) can be used to
retrieve the list's items via user_list_items.
user_lists(user = getOption("trakt_username"), extended = c("min", "full"))
user_lists(user = getOption("trakt_username"), extended = c("min", "full"))
user |
|
extended |
|
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.
In the embedded user data, name
is renamed to user_name
due
to duplication with e.g. list names,
and slug
is renamed to user_slug
for the same reason.
user_lists()
wraps endpoint users/:id/lists.
user_lists for all lists a user has.
user_list_items For the actual content of a list.
Other list methods:
lists_popular()
,
media_lists
,
user_list()
,
user_list_comments()
,
user_list_items()
## Not run: user_lists("jemus42") ## End(Not run)
## Not run: user_lists("jemus42") ## End(Not run)
Get followers, followings or friends (the two-way relationship).
user_followers(user = getOption("trakt_user"), extended = "min") user_following(user = getOption("trakt_user"), extended = "min") user_friends(user = getOption("trakt_user"), extended = "min")
user_followers(user = getOption("trakt_user"), extended = "min") user_following(user = getOption("trakt_user"), extended = "min") user_friends(user = getOption("trakt_user"), extended = "min")
user |
|
extended |
|
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.
If the specified user is private, you need to be able to make an authenticated request and be friends with the user.
user_followers()
wraps endpoint users/:id/followers.
user_following()
wraps endpoint users/:id/following.
user_friends()
wraps endpoint users/:id/friends.
Other user data:
user_collection()
,
user_comments()
,
user_history()
,
user_likes()
,
user_profile()
,
user_ratings()
,
user_stats()
,
user_watched()
,
user_watchlist()
## Not run: user_followers(user = "sean") ## End(Not run) ## Not run: user_following(user = "sean") ## End(Not run) ## Not run: user_friends(user = "sean") ## End(Not run)
## Not run: user_followers(user = "sean") ## End(Not run) ## Not run: user_following(user = "sean") ## End(Not run) ## Not run: user_friends(user = "sean") ## End(Not run)
Get a user's profile
user_profile(user = getOption("trakt_username"), extended = c("min", "full"))
user_profile(user = getOption("trakt_username"), extended = c("min", "full"))
user |
|
extended |
|
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.
If the specified user is private, you need to be able to make an authenticated request and be friends with the user.
user_profile()
wraps endpoint users/:id.
Other user data:
user_collection()
,
user_comments()
,
user_history()
,
user_likes()
,
user_network()
,
user_ratings()
,
user_stats()
,
user_watched()
,
user_watchlist()
Other summary methods:
comments_comment()
,
episodes_summary()
,
movies_summary()
,
people_summary()
,
seasons_summary()
,
shows_summary()
## Not run: user_profile("sean") ## End(Not run)
## Not run: user_profile("sean") ## End(Not run)
Retrieve a user's media ratings
user_ratings( user = getOption("trakt_username"), type = c("movies", "seasons", "shows", "episodes"), rating = NULL, extended = c("min", "full") )
user_ratings( user = getOption("trakt_username"), type = c("movies", "seasons", "shows", "episodes"), rating = NULL, extended = c("min", "full") )
user |
|
type |
|
rating |
|
extended |
|
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.
user_ratings()
wraps endpoint users/:id/ratings/:type/:rating.
Other user data:
user_collection()
,
user_comments()
,
user_history()
,
user_likes()
,
user_network()
,
user_profile()
,
user_stats()
,
user_watched()
,
user_watchlist()
## Not run: user_ratings(user = "jemus42", "shows") user_ratings(user = "sean", type = "movies") ## End(Not run)
## Not run: user_ratings(user = "jemus42", "shows") user_ratings(user = "sean", type = "movies") ## End(Not run)
Data about a user's interactions with movies, shows, seasons, episodes, as well as their social network (friends, followings, followers) and a frequency table of the user's media ratings so far.
user_stats(user = getOption("trakt_username"))
user_stats(user = getOption("trakt_username"))
user |
|
A list
of tibbles containing the following elements:
"movies"
"shows"
"seasons"
"episodes"
"network"
"ratings"
user_stats()
wraps endpoint users/:id/stats.
Other user data:
user_collection()
,
user_comments()
,
user_history()
,
user_likes()
,
user_network()
,
user_profile()
,
user_ratings()
,
user_watched()
,
user_watchlist()
## Not run: user_stats(user = "sean") ## End(Not run)
## Not run: user_stats(user = "sean") ## End(Not run)
For private users, an authenticated request is required.
user_watched( user = getOption("trakt_username"), type = c("shows", "movies"), noseasons = TRUE, extended = c("min", "full") )
user_watched( user = getOption("trakt_username"), type = c("shows", "movies"), noseasons = TRUE, extended = c("min", "full") )
user |
|
type |
|
noseasons |
|
extended |
|
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.
user_watched()
wraps endpoint users/:id/watched/:type.
Other user data:
user_collection()
,
user_comments()
,
user_history()
,
user_likes()
,
user_network()
,
user_profile()
,
user_ratings()
,
user_stats()
,
user_watchlist()
## Not run: # Use noseasons = TRUE to avoid receiving detailed season/episode data user_watched(user = "sean", noseasons = TRUE) ## End(Not run)
## Not run: # Use noseasons = TRUE to avoid receiving detailed season/episode data user_watched(user = "sean", noseasons = TRUE) ## End(Not run)
Get a user's watchlist
user_watchlist( user = getOption("trakt_username"), type = c("movies", "shows"), extended = c("min", "full") )
user_watchlist( user = getOption("trakt_username"), type = c("movies", "shows"), extended = c("min", "full") )
user |
|
type |
|
extended |
|
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.
user_watchlist()
wraps endpoint users/:id/watchlist/:type.
Other user data:
user_collection()
,
user_comments()
,
user_history()
,
user_likes()
,
user_network()
,
user_profile()
,
user_ratings()
,
user_stats()
,
user_watched()
## Not run: # Defaults to movie watchlist and minimal info user_watchlist(user = "sean") ## End(Not run)
## Not run: # Defaults to movie watchlist and minimal info user_watchlist(user = "sean") ## End(Not run)
These functions return the most watched movies/shows on trakt.tv.
movies_watched( limit = 10, extended = c("min", "full"), period = c("weekly", "monthly", "yearly", "all"), query = NULL, years = NULL, genres = NULL, languages = NULL, countries = NULL, runtimes = NULL, ratings = NULL, certifications = NULL ) shows_watched( limit = 10, extended = c("min", "full"), period = c("weekly", "monthly", "yearly", "all"), query = NULL, years = NULL, genres = NULL, languages = NULL, countries = NULL, runtimes = NULL, ratings = NULL, certifications = NULL, networks = NULL, status = NULL )
movies_watched( limit = 10, extended = c("min", "full"), period = c("weekly", "monthly", "yearly", "all"), query = NULL, years = NULL, genres = NULL, languages = NULL, countries = NULL, runtimes = NULL, ratings = NULL, certifications = NULL ) shows_watched( limit = 10, extended = c("min", "full"), period = c("weekly", "monthly", "yearly", "all"), query = NULL, years = NULL, genres = NULL, languages = NULL, countries = NULL, runtimes = NULL, ratings = NULL, certifications = NULL, networks = NULL, status = NULL )
limit |
|
extended |
|
period |
|
query |
|
years |
|
genres |
|
languages |
|
countries |
|
runtimes |
|
ratings |
|
certifications |
|
networks |
|
status |
|
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.
These functions access the automatically updated lists provided by trakt.tv. Each function comes in two flavors: Shows or movies. The following descriptions are adapted directly from the API reference.
Popular: Popularity is calculated using the rating percentage and the number of ratings.
Trending: Returns all movies/shows being watched right now. Movies/shows with the most users are returned first.
Played: Returns the most played (a single user can watch multiple times)
movies/shows in the specified time period
.
Watched: Returns the most watched (unique users) movies/shows in the specified
time period
.
Collected: Returns the most collected (unique users) movies/shows in the
specified time period
.
Anticipated: Returns the most anticipated movies/shows based on the number of
lists a movie/show appears on.
The functions for Played, Watched, Collected and Played each return
the same additional variables besides the media information: watcher_count
,
play_count
, collected_count
, collector_count
.
movies_watched()
wraps endpoint movies/watched/:period.
shows_watched()
wraps endpoint shows/watched/:period.
Other movie data:
anticipated_media
,
collected_media
,
media_aliases
,
media_comments
,
media_lists
,
media_people
,
media_ratings()
,
media_stats()
,
media_translations
,
media_watching
,
movies_boxoffice()
,
movies_related()
,
movies_releases()
,
movies_summary()
,
people_media()
,
played_media
,
popular_media
,
trending_media
Other dynamic lists:
anticipated_media
,
collected_media
,
lists_popular()
,
played_media
,
popular_media
,
trending_media
Other shows data:
anticipated_media
,
popular_media
,
trending_media
Other dynamic lists:
anticipated_media
,
collected_media
,
lists_popular()
,
played_media
,
popular_media
,
trending_media