Can I create an Android app that uses the Spotify Web API without having the user install Spotify?

36 Views Asked by At

It looks like to use the Spotify API on android, I need to use the Spotify Android SDK. This requires the user of my app to have Spotify installed! I just want to get small things like genres and user playlists for my app, I don't want playback capabilities. Is there a way to do this using the Spotify web API instead?

I tried using the Spotify web API, and was expecting it to work as it was, but all the documentation asks you to use the Android SDK.

1

There are 1 best solutions below

0
Affan Minhas On

Yes, you can indeed use the Spotify Web API to access data such as genres and user playlists without requiring the user to have the Spotify app installed.

var response = await http.get(
    Uri.parse('https://api.spotify.com/v1/me/playlists'),
    headers: {
      'Authorization': 'Bearer $accessToken',
    },
  );

Provide the access token that you can get from spotify developer. Handle rest of the behaviour of success or failure of response.