Learn R Programming

spotifyr (version 1.0.0)

get_track_popularity: Get popularity of one or more tracks on Spotify

Description

This function returns the popularity of tracks on Spotify

Usage

get_track_popularity(tracks, access_token = get_spotify_access_token())

Arguments

tracks

Dataframe containing a column `track_uri`, corresponding to Spotify Album URIs. Can be output from spotifyr::get_album_tracks or spotifyr::get_playlist_tracks()

access_token

Spotify Web API token. Defaults to spotifyr::get_spotify_access_token()

Examples

Run this code
# NOT RUN {
artists <- get_artists('radiohead')
albums <- get_albums(artists$artist_uri[1])
tracks <- get_album_tracks(albums)
track_popularity <- get_track_popularity(tracks)
# }

Run the code above in your browser using DataLab