Announcements

Help Wizard

Step 1

NEXT STEP

Get many playlists

Get many playlists

My Question or Issue

 

We are looking to add a feature in our application that can show playlist data after gathering playlist context from recently played tracks. We end up having many playlistIds and want to be able to get information about each of the ids. We would not be able to use the user playlists call since tracks aren't always streamed from playlists that you follow or create.

 

We want to be able to request for many playlists at one time to help avoid rate limiting for our spotify client. Otherwise we'd be required to call the api for each playlist individually which is certainly not ideal. 

 

Any help or guidance on how would could accomplish this would be greatly  appreciated.

Reply
3 Replies

Nice to sniff you, I mean meet you lucaswong!
One solution to this problem would be to use the Spotify Web API's  '
Get Several Playlists endpoint' . This endpoint allows you to retrieve multiple playlists in a single call by providing a comma-separated list of playlist IDs. Here's an example request:

 

GET https://api.spotify.com/v1/playlists?ids=37i9dQZF1DX3WvGXE8FqYX,37i9dQZF1DWTwnEm1IYyoj,37i9dQZF1DXcBWIGoYBM5M

 

In this example, we're requesting three playlists with the IDs '37i9dQZF1DX3WvGXE8FqYX', '37i9dQZF1DWTwnEm1IYyoj', and '37i9dQZF1DXcBWIGoYBM5M'. The response will include information about all three playlists.

 

By using this endpoint, you can retrieve information about multiple playlists in a single API call, which can help you avoid rate limiting issues.
Pawssibly misunderstood you, if so bark more orders at me!

 

-Prague the Dog

 

Hey Prague,

I've attempted to make a request formatted as you suggested, but am getting a 404 not found error. I attempted this request using postman and curl commands with a valid bearer token.
(double checked it by using the GET playlist endpoint, https://api.spotify.com/v1/playlists/{playlist_id} ) 

Example:
Making a request to:
https://api.spotify.com/v1/playlists?ids=1DXllt7ad0rpeeWmFtMzvs,4n70p7z44vW4V4rd3Serdm
results in 404.

I also did not come across an api endpoint which returns information regarding multiple playlists in the Spotify web api docs. Unless there is, in which case, could you provide me the link to them?

Thanks,

There is no 'Get Several Playlists' endpoint.

Suggested posts

Let's introduce ourselves!

Hey there you, Ā  Yeah, you!Ā 😁 Ā  Welcome - we're glad you joined the Spotify Community! Ā  While you here, let's have a fun game and get…

ModeratorStaff / Moderator/ 4 years ago  in Social & Random