Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

get_my_top_artists_or_tracks

Get the current user’s top artists or tracks based on calculated affinity.


Description

Get the current user’s top artists or tracks based on calculated affinity.

Usage

get_my_top_artists_or_tracks(
  type = NULL,
  limit = 20,
  offset = 0,
  time_range = "medium_term",
  authorization = get_spotify_authorization_code(),
  include_meta_info = FALSE
)

Arguments

type

Required. The type of entity to return. Valid values: artists or tracks.

limit

Optional.
Maximum number of results to return.
Default: 20
Minimum: 1
Maximum: 50

offset

Optional.
The index of the first entity to return.
Default: 0 (i.e., the first track).
Use with limit to get the next set of entities.

time_range

Optional. Over what time frame the affinities are computed. Valid values: long_term (calculated from several years of data and including all new data as it becomes available), medium_term (approximately last 6 months), short_term (approximately last 4 weeks). Default: medium_term.

authorization

Required. A valid access token from the Spotify Accounts service. See the Web API authorization Guide for more details. Defaults to spotifyr::get_spotify_access_token()

include_meta_info

Optional. Boolean indicating whether to include full result, with meta information such as "total", and "limit". Defaults to FALSE.

Value

Returns a data frame of results containing track or album data. See the official API documentation for more information.


tinyspotifyr

Tinyverse R Wrapper for the 'Spotify' Web API

v0.2.2
MIT + file LICENSE
Authors
Troy Hernandez [aut, cre], Charlie Thompson [aut], Josiah Parry [aut], Donal Phipps [aut], Tom Wolff [aut]
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.