Spotifyr Error: INVALID_CLIENT: Invalid redirect URI

Viewed 3529

I am trying to use the spotifyr package to extract the data from Spotify however any function that requires an access token is not working (e.g. get_my_recently_played(limit = 5)). I get the following error when I run it: INVALID_CLIENT: Invalid redirect URI.

I have even tried going to My Application and changing the Redirect URIs to 'http://localhost:8888/callback/' but it still gives the same error. What might I be missing here? Thank you!

2 Answers

Have you tried:

Sys.setenv(SPOTIFY_CLIENT_ID = 'xxxxxxxxxxxxxxxxxxxxx')
Sys.setenv(SPOTIFY_CLIENT_SECRET = 'xxxxxxxxxxxxxxxxxxxxx')

access_token <- get_spotify_access_token()

per the readme at https://github.com/charlie86/spotifyr?

UPDATE:

This works for me with the version of `spotifyr` available on CRAN
Sys.setenv(SPOTIFY_CLIENT_ID = 'your_client_id_here')
Sys.setenv(SPOTIFY_CLIENT_SECRET = 'your_client_secret_here')

access_token <- get_spotify_access_token()

library(spotifyr)

get_artist_audio_features('the beatles')

Try to set this redirect URL in Spotify API Client settings to http://localhost:1410/

I had the same issue and this URL works for me now

Related