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

Playlist API Tracks endpoint does not using a Paging object for more than 100 results

Solved!

Playlist API Tracks endpoint does not using a Paging object for more than 100 results

Plan

Premium Family

Country

Switzerland

Device

PC, iPhone

Operating System

Windows 10 2004, iOS 13.5.1

 

My Question or Issue

According to https://developer.spotify.com/documentation/web-api/reference-beta/#endpoint-get-playlists-tracks, the /tracks endpoint of the Playlists API returns a limit of 100 items, wrapped in a Paging object.


On success, the response body contains an array of track objects and episode objects (depends on the additional_types parameter), wrapped in a paging object in JSON format and the HTTP status code in the response header is 200 OK.

 

However, if you try it out in the Web Console, you will see that the response body does not use a Paging object, even if there are more than 100 items on the playlist.

https://developer.spotify.com/console/get-playlist-tracks/

 

Instead, a simple JSON object is returned that contains an Items array of the first 100 tracks on the playlist (or whatever limit is specified).

 

You can use the offset parameter to get the next tracks, but you need to build the URI yourself and keep requesting more until you get an empty array back.

Reply

Accepted Solutions
Marked as solution

You've explitly asked to only return certain fields and you've not included the paging fields.

View solution in original post

4 Replies

I can't reproduce this, I receive the expected paging object. I've verified this in my code (my code uses the paging object and still works as it always has) and also in the developer console at the link you provided.

Hello there! Thanks for replying.

 

I just re-tried it in the web console, I am still seeing the tracks returned in a flat array, no paging object.

 

Screenshot from the web console:

 

DaveCodesTunes_4-1593973190351.png

 

 

 

 

 

Screenshot from the docs:

DaveCodesTunes_1-1593973049579.png

 

Marked as solution

You've explitly asked to only return certain fields and you've not included the paging fields.

Ahhh, thank you!

 

So, I need to tell it that I want the paging fields, otherwise I will not get them.

 

Thank you for the insight!

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

Type a product name