Who Me Too'd this topic

Search API returns wrong total amount of results

hedgehog1833
Casual Listener

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

Who Me Too'd this topic