#'Search for playlists
#'function to search for playlists given a name
#'@param playlistName Name of the playlist being searched for
#'@param offset The index of the first Playlist to return. Default: 0 (the first object). Maximum offset: 100.000.
#'@param token An OAuth token created with \code{spotifyOAuth}.

#function to search for playlists given a name
searchPlaylist<-function(playlistName,offset=0, token = token){
                                      gsub(" ", "+", playlistName),
                               httr::config(token = token)))
  playlist.df<- dplyr::bind_rows(
    lapply(playlist, function(x) data.frame(
      id = x$id, name = x$name, tracks = x$tracks$total,
      owner = x$owner$id, stringsAsFactors = FALSE)))

Try the Rspotify package in your browser

Any scripts or data that you put into this service are public.

Rspotify documentation built on May 2, 2019, 2:41 a.m.