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

Pagination does not work on /v1/artists/{id}/albums

Pagination does not work on /v1/artists/{id}/albums

Initially, I tried to make paginated requests for this endpoint from my application. But I found that even with enough total, I get an empty list of items. as far as I understand, if the offset is less than the total, then everything should work.

 

As I checked, this does not work for all authors and markets.

 

For example: https://api.spotify.com/v1/artists/0TnOYISbd1XYRBk9myaseg/albums?include_groups=single%2Cappears_on&...

 

Reply
2 Replies

I have the same problem.

I use spotify tools : 

souriya59_1-1709059618644.png

In my browser's console :

souriya59_0-1709059579841.png

No results in ITEMS



 

I managed to get around this problem by doing separate requests for each of the album types (ie 'album', 'single', 'appears_on' and 'compilation')

For some reason, when I am only using 1 album type the problem of having empty pages does not arise. I then collate the responses into 1 dataset.

 

Python example:

 

albums = []
for album_type in ['album', 'single', 'appears_on', 'compilation']:
page = self.spotify_client.artist_albums(artist_id, limit=50, album_type=album_type)
while page:
albums.extend(page["items"])
page = self.spotify_client.next(page)

 I hope this helps someone because I struggled with it for a long time and it seems to have been an issue for many years. 

Suggested posts