Announcements

Help Wizard

Step 1

NEXT STEP

Search API returns wrong total amount of results

Search API returns wrong total amount of results

Plan

Free

Country

Germany

 

My Question or Issue

I'm calling the following URL to search Spotify for artists:

 

https://api.spotify.com/v1/search?q=Nirvana&type=artist&offset=0&limit=20

 

The result contains 20 items with a total value of 87. The "next" url has an offset of 20, so I would expect to have five "pages" in sum, the fifth and last one containing only seven items. But that's not the case. Requesting the fourth page with offset 60:

 

https://api.spotify.com/v1/search?q=Nirvana&type=artist&offset=60&limit=20

 

gives only 7 items. The response also contains a "next" link with an offset of 80 but this gives an empty list of items. So 20 items are missing or the total number is not correct.

 

Am I doing something wrong here or is this actually a bug? Other artists also show wrong looking total numbers. Searching for "Opeth" with a limit of 20 gives one item yet a total value of two...

 

Best regards from Berlin

Nils

Reply
3 Replies

I've noticed that too. This is obviously a bug. Please fix it.

I found that this bug has already been reported in the old bug tracker on github about half a year ago, but without comment 😞 Apparently this was already reported (and even fixed) one more time in 2016 here

Does really nobody want to look after this issue?

So this is still happening almost 8 years after the issue was closed on Github 🙃

Suggested posts