1

Using the advice in this post I have been able to access the spotify users data for their playlists with

sp = getSpotifyApi(1);
console.log (sp.core.library.getAlbums());                

I want to access the spotify user data for the user logged into the app, specifically the spotify uri for the user.

sp = getSpotifyApi(1);
console.log (sp.core.user);        // is undefined
console.log (sp.social.relations); // is undefined

How can I do this?

Community
  • 1
  • 1
Ben
  • 1,030
  • 10
  • 23

1 Answers1

2

This information is not available in the Spotify Apps API for privacy reasons. There is a unique user ID, but it is not the user's username.

If you need the user's friends list, you'll need to connect to (say) Facebook yourself and get it that way.

iKenndac
  • 18,730
  • 3
  • 35
  • 51
  • At the moment, there's `sp.core.getAnonymousUserId()`, but that's unsupported (as is everything in `sp.core`). A "real" API is coming soon. – iKenndac Dec 20 '11 at 15:20