Announcements

Help Wizard

Step 1

NEXT STEP

FAQs

Please see below the most popular frequently asked questions.

Loading article...

Loading faqs...

VIEW ALL

Ongoing Issues

Please see below the current ongoing issues which are under investigation.

Loading issue...

Loading ongoing issues...

VIEW ALL

Inconsistent results on playlists endpoint

Solved!

Inconsistent results on playlists endpoint

Plan

Premium

Country

Spain

Device

-

Operating System

-

 

My Question or Issue

I was considering a small personal project using the Web API, and as a proof of concept I tried to fetch my own user's playlists via API. The thing is that when I try the endpoint (Get User's Playlists) from the documentation, the API returns all my playlists correctly (total: 38), but when I do it from Postman or code, with the same exact URL parameters, it juts returns a fraction of them (total: 6). I though that it may be due to having used the 'Client credentials' auth method, but turns out that using 'Authorization code' auth method and calling the Get Current User's Playlists has the same result.

 

A diff of the JSON of a playlist that shows with my credentials and one that does not doesn't shed any light, as they seem to be almos identical characteristics wise. I also tried creating a new App, but the same happens with the new credentials.

 

Could this be a bug on the API? Or am I missing something on my part? I doubt that this only happens with my user, but it turns out that is difficult to reproduce, please let me know and I'll provide some

Reply

Accepted Solutions
Marked as solution

Hello, welcome to the Spotify Community, it's great to help you!

 

It's great to see you exploring the Spotify API for personal projects! I understand that this difference in results can be quite confusing.

 

What you described is usually related to the type of permission (scope) that is used in authentication. To get all playlists — including private and collaborative playlists — your application must request the playlist-read-private scope when authenticating via Authorization Code.

 

If this scope is not included, the API will only return public playlists, which would explain why you see fewer results using Postman or code, even with OAuth authentication.

 

Regarding the question of whether this would be a bug: it is unlikely, since this behavior is related to the permission settings required by the API.

 

I suggest confirming that you are including the playlist-read-private scope and, if necessary, also playlist-read-collaborative when requesting the access token.

 

Here is an official reference for authorization scopes: Spotify Authorization Scopes.

 

If you want, I can also help you put together an example of how to set this up correctly!

 

Keep me updated!

Cheers, ribezaz.

ribezazSpotify Star
Help others find this answer and click "Accept as Solution".
If you appreciate my answer, maybe give me a Like.
Note: I'm not a Spotify employee.

View solution in original post

3 Replies
Marked as solution

Hello, welcome to the Spotify Community, it's great to help you!

 

It's great to see you exploring the Spotify API for personal projects! I understand that this difference in results can be quite confusing.

 

What you described is usually related to the type of permission (scope) that is used in authentication. To get all playlists — including private and collaborative playlists — your application must request the playlist-read-private scope when authenticating via Authorization Code.

 

If this scope is not included, the API will only return public playlists, which would explain why you see fewer results using Postman or code, even with OAuth authentication.

 

Regarding the question of whether this would be a bug: it is unlikely, since this behavior is related to the permission settings required by the API.

 

I suggest confirming that you are including the playlist-read-private scope and, if necessary, also playlist-read-collaborative when requesting the access token.

 

Here is an official reference for authorization scopes: Spotify Authorization Scopes.

 

If you want, I can also help you put together an example of how to set this up correctly!

 

Keep me updated!

Cheers, ribezaz.

ribezazSpotify Star
Help others find this answer and click "Accept as Solution".
If you appreciate my answer, maybe give me a Like.
Note: I'm not a Spotify employee.

Yes, that was definitely the issue. Just adding both playlist-read-private and playlist-read-collaborative scopes allowed me to get the same response on my code & postman as I see using the tester at the documentation. Thank you very much for the quick response!

You're welcome @AsierZunzu ! I'm happy to help you 🙂

ribezazSpotify Star
Help others find this answer and click "Accept as Solution".
If you appreciate my answer, maybe give me a Like.
Note: I'm not a Spotify employee.

Suggested posts