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

Get Artist's Albums Offset not working as expected

Get Artist's Albums Offset not working as expected

Plan

Free

Country

GB

Device

Lenovo Thinkpad

Operating System

Windows 10

 

My Question or Issue

Trying to get the second page of albums using limit and offset on the endpoint:

https://api.spotify.com/v1/artists/{artist_id}/albums

results in an invalid response with no data.

 

This behaviour happens on all artists that have more than 50 albums total and therefore require the offset to be set to 50. For example, the artist: 

 

07CimrZi5vs9iEao47TNQ4

 

has 53 albums but when I try to access the second page of results with the following link:

https://api.spotify.com/v1/artists/07CimrZi5vs9iEao47TNQ4/albums?include_groups=single%2Calbum%2Ccompilation&market=GB&limit=50&offset=50

  The response is empty:

 

{
  "href": "https://api.spotify.com/v1/artists/07CimrZi5vs9iEao47TNQ4/albums?include_groups=album,single,compilation&offset=50&limit=50&market=GB&locale=en-GB,en-US;q=0.9,en;q=0.8",
  "items": [],
  "limit": 50,
  "next": null,
  "offset": 50,
  "previous": "https://api.spotify.com/v1/artists/07CimrZi5vs9iEao47TNQ4/albums?include_groups=album,single,compilation&offset=0&limit=50&market=GB&locale=en-GB,en-US;q=0.9,en;q=0.8",
  "total": 53
}

 

 

I can work with the top 50 results for now but this is clearly a bug.

Reply
1 Reply

Having the same kind of issue with offset on that endpoint.

 

Tried to view albums from artist Travis Scott

 

 

0Y5tJX1MQlPlqiwlOH1tJY

 

 

 

When I use offset from 0 to 6, the list is properly indexed but when I use offset 7 the list completely change and become unusable.

 

As an example, when I look for the album `WE DON'T TRUST YOU` where this artist appears in, if I use offset 0 to 6 the album is not in the list, if I use offset 7 to 49 the album is in the list, if I use offset > 50 the album is no longer in the list.

 

My query is the following:

 

 

https://api.spotify.com/v1/artists/0Y5tJX1MQlPlqiwlOH1tJY/albums?include_groups=album,single,appears_on&limit=50&offset=7

 

 

 

This doesn't make sense and makes this endpoint unreliable.

 

EDIT: Somehow, doing the same exercise at developer.spotify.com does not provide the same behavior and actually works fine.

 

EDIT 2: Decided to use the Authorization Bearer token from developer.spotify.com in my postman process and it was working fine too, the results were displayed differently too.

 

Hope all this can help finding the issue.

2024-07-28_7171.png
2024-07-28_7170.png

Suggested posts