Retrieve a the last limit
items a user has watched, including the method by
which it was logged (e.g. scrobble or checkin).
Source
user_history()
wraps endpoint users/:id/history/:type/:item_id?start_at=&end_at=.
Arguments
- user
character(1)
: Target username (orslug
). Defaults togetOption("trakt_username")
. Can also be of length greater than 1, in which case the function is called on alluser
values separately and the result is combined.- type
character(1)
: Either"shows"
or"movies"
. For season/episode-specific functions, valuesseasons
orepisodes
are also allowed.- limit
integer(1) [10L]
: Number of items to return. Must be greater than0
and will be coerced viaas.integer()
.- start_at, end_at
character(1)
: A time-window to filter by. Must be coercible to a datetime object of classPOSIXct
. See ISOdate for further information.- extended
character(1)
: Either"min"
(API default) or"full"
. The latter returns more variables and should generally only be used if required. Seevignette("finding-things")
for more details.
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.
Details
This function wraps the API method
/users/:id/history/:type
.
Note
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.
See also
Other user data:
user_collection()
,
user_comments()
,
user_likes()
,
user_network()
,
user_profile()
,
user_ratings()
,
user_stats()
,
user_watched()
,
user_watchlist()