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

Bug when using offset greater than 49 when pulling top tracks

Bug when using offset greater than 49 when pulling top tracks

When using the endpoint https://api.spotify.com/v1/me/top/tracks with the offset parameter greater than 49, the response is returned with an offset of 50 and a limit of 0. It is possible to get more than the 50 top tracks, for example by using an offset of 49 and a limit of 50, however, even using an offset of 50 and a limit of 49 (which should return all but one of the same songs) will return a completely empty response. The issue persists for all time ranges specified in the parameters as well.

 

This occurs when using my WebAPI app with Authorization Code OAuth.

 

Request: https://api.spotify.com/v1/me/top/tracks (with parameters offset=50, limit=49)

Expected: The 50-99 songs with the greatest affinity for the user

Response: 200 response with the following JSON: {'items': [], 'total': 0, 'limit': 0, 'offset': 50, 'href': 'https://api.spotify.com/v1/me/top/tracks?limit=0&offset=50', 'next': None, 'previous': 'https://api.spotify.com/v1/me/top/tracks?limit=0&offset=50'}

Reply
2 Replies

Thank you for sharing this bug. It seems like the function you provided could be useful for a project I'm working on. I decided to test it out. When I sent a request with a limit of 50 and an offset of 0, I obtained 50 unique IDs. Then, when I sent another request with the same limit of 50 and an offset of 50, I obtained an additional 50 unique IDs. In total, I got 100 unique IDs.

XimzendSpotify 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.

Interesting, thanks for sharing! I have seen older forum posts where people seem to be having the same issue as me, so I know that the issue goes beyond just my machine, however, I'm curious what differences there are between our code that could help narrow down the issue. Are you also using the same endpoint, Oauth flow, and app type as me? Also I'm coding my project in Python. 

Suggested posts

Staff
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…

Staff
ModeratorStaff / Moderator/ 3 years ago  in Social & Random

Type a product name