Announcements

Help Wizard

Step 1

NEXT STEP

Bug with offset for method "Get User's Top Artists and Tracks"

Bug with offset for method "Get User's Top Artists and Tracks"

How can I get 150 items from method "Get User's Top Artists and Tracks" with 3 request? My queries found a bug with the offset value and couldn't get more than 100 items.

 

- If set limit 50 and offset 0 - response with 50 items
https://api.spotify.com/v1/me/top/tracks?limit=50&offset=0&time_range=medium_term

 

- If set limit 50 and offset 50 - response with 0 items

https://api.spotify.com/v1/me/top/tracks?limit=50&offset=50&time_range=medium_term

 

- If set limit 50 and offset 49 - response with 50 items

https://api.spotify.com/v1/me/top/tracks?limit=50&offset=49&time_range=medium_term

 

- If set limit 50 and offset 0-49-98 - response with 100 items

https://api.spotify.com/v1/me/top/tracks?limit=50&offset=0&time_range=medium_term

https://api.spotify.com/v1/me/top/tracks?limit=50&offset=49&time_range=medium_term

https://api.spotify.com/v1/me/top/tracks?limit=50&offset=98&time_range=medium_term

Reply
3 Replies

I found the same issue, and would love to see it fixed. It's kinda strange how offset=50 returns nothing, but offset=49 returns 50 artists. 

 

For any Spotify developers reading interested in knowing why I need this: I'm working on getting a list of all the user's played artists within the given period, so they can keep track of how diverse their listening habits are. 

I also see the same issue. Any offset greater than or equal to 50 returns nothing. I tried with limits of 1, 2, 5, 10, 20, 49, and 50, always the same thing. It seems the max amount of values you can get is 99 (using a limit of 50 with offsets of 0 and 49). Is this expected? Spotify's API documentation doesn't mention anything about this. Definitely a bug in the API, or missing documentation.

@Chimildic did you ever figure out an alternative for getting 150 items? I'm guessing from how long it's been that this bug might not be fixed, which is a shame. 

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