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

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

Staff
Let's introduce ourselves!

Hey there you,   Yeah, you! 😁   Welcome - we're glad you joined the Spotify Community!   While you here, let's have a fun game and get…

Staff
ModeratorStaff / Moderator/ 4 years ago  in Social & Random

Type a product name