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

get_recommendations_all

Get Recommendations for Unlimited Vector of Track IDs


Description

Get recommendations for a submitted vector of track IDs, with no limit on the number of seed tracks

Usage

get_recommendations_all(track_ids, valence = NULL)

Arguments

track_ids

A vector containing the IDs of the tracks you'd like recommendations for

valence

The target valence for the recommendations

Details

This is a wrapper for the get_recommendations function, which provides a workaround for the limit of 5 seed tracks per recommendation call. The function splits a supplied vector of track IDs into subsets of length 5, then applies a get_recommendations call, 5 tracks at a time. This should generate a data frame of recommended tracks, with length equal to the supplied vector of track ids.

Value

Returns a data frame containing binded recommendations from the Spotify API in a single data frame.

See Also

Other personalization functions: get_my_top_artists_or_tracks(), get_recommendations()

Examples

get_recommendations_all(
   track_ids = c("5VIpLopHgolKcSSj7JPCMA", "3QRGYDFFUVb4qneE4DX1gR")
   )

spotifyr

R Wrapper for the 'Spotify' Web API

v2.2.1
MIT + file LICENSE
Authors
Charlie Thompson [aut], Daniel Antal [aut, cre] (<https://orcid.org/0000-0001-7513-6760>), Josiah Parry [aut] (<https://orcid.org/0000-0001-9910-865X>), Donal Phipps [aut], Tom Wolff [aut]
Initial release
2021-06-09

We don't support your browser anymore

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