Announcements

Help Wizard

Step 1

NEXT STEP

API paging issue, 'next' page is incorrect

Solved!

API paging issue, 'next' page is incorrect

My Question or Issue

I'm using the Spotify API to pull back a list of liked tracks.

 

This has been working fine until today, but it got stuck where the `next` page is actually the previous page.

 

For example, I'm calling 

 

 
Which returns my second page of liked tracks (offset of 50)
 
But in the response to this, the `next` element of the JSON response has this
 

 

 

    "limit" : 50,
    "next" : "https://api.spotify.com/v1/me/tracks?offset=0&limit=50",
    "offset" : 50,
    "previous" : null,
    "total" : 188

 

 

This indicates that the next page has an offset of 0 (so starting at the beginning again)
 
Which takes me back to the first page.
 
This causes an endless loop where my code was constantly loading the first and second pages.
Reply

Accepted Solutions
Marked as solution

Thanks for the clear and detailed bug report @Knifevillage @rsouthward! We looked into it on our side and I think the problem is now fixed. Would you mind letting me know if you are still experiencing the problem?

View solution in original post

6 Replies

Same issue here, endpoint has been functioning correctly till about 12:00 local time, now seeing the same behaviour where next parameter is stuck / toggling between the 'first page' and 'second page'.

Also, if you try to load the 3rd page manually, by passing in offset=100, limit=50, the 'next' page comes back with offset=50, so it seems that the next page is always the 'previous' page, and 'previous' is never populated.

FYI: Issue is not reproducible in the use case of getting all tracks of a 'regular' user playlist, i.e. the following endpoint:
https://api.spotify.com/v1/playlists/playlist_id/etc

Marked as solution

Thanks for the clear and detailed bug report @Knifevillage @rsouthward! We looked into it on our side and I think the problem is now fixed. Would you mind letting me know if you are still experiencing the problem?

@rsouthward, @spotifyjosh Checked it, seems like it is working properly again. Thank you!

im having this same issue, its driving me mad at this point

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