Announcements
The Spotify Stars Program: Celebrating Values Week!

Help Wizard

Step 1

NEXT STEP

Web API: Endpoint /search returns different values for "total" although the query is identical

Web API: Endpoint /search returns different values for "total" although the query is identical

Plan

Free

 

Country

Germany

 

My Question or Issue

The curl command:

 

curl -X "GET" "https://api.spotify.com/v1/search?q=Ope&type=artist&market=US&limit=10&offset=0" -H "Accept: application/json" -H "Content-Type: application/json" -H "Authorization: Bearer MY-TOKEN"

 

 

returns the following meta-data:

 

"limit": 10,
"next": "https://api.spotify.com/v1/search?query=Ope&type=artist&market=US&offset=10&limit=10",
"offset": 0,
"previous": null,
"total": 4070

 

 

The total is 4070. If I then request the next URL https://api.spotify.com/v1/search?query=Ope&type=artist&market=US&offset=10&limit=10 is suddenly 4080. On the third page (offest=20) the total is 4085. On the fourth page the total is 4082.

 

Looks like a bug to me.

 

Reply
1 Reply

Same here, but I think this is quite a long-standing issue.

 

In some cases it can even return the wrong total with only one page of results!

Suggested posts