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 `search` endpoint unexpected results.

Web API `search` endpoint unexpected results.

Hi,

 

The Web API's `search` endpoint is giving unexpected results. For example, the result is empty (even after the response code 200). BUT, with the same query on documentation playground, it does return right results. Even if I copy-paste the exact query from the documentation playground (after it returns expected results) into my code, it returns empty results unlike the documentation playground or the Spotify web interface.

 

Then, I thought I might be doing something wrong, AND the thing was: I was using `track:` & `artist:` before the song name and artist name respectively just like shown in the documentation example. Even tried with explicitly using `track%3A` & `artist%3A`, but still got empty/null results with response code 200.

 

So, I removed `track:` & `artist:` from my query string. But now I am getting unexpected results again. It does not return right results. Same search query if compared with the Web interface & Documentation playground, it (the `search` endpoint) returns completely different / random results.

 

Again, even if copy-paste the exact same query from documentation playground (which returns expected results) into the code, the `search` endpoint returns empty/null results.

 

CheapNightbot_0-1726675379171.png

^ <Response [200]>, but "items" list is empty.

 

CheapNightbot_1-1726675508968.png

^ Same query on Documentation playground return "items".

 

(new here, sorry if the issue isn't clear or I repeated myself)

Reply
3 Replies

CheapNightBot, 

 

I'm glad you posted this, because I'm seeing same "unexpected token" issue at the moment. This reminds me of the bug in February of this year that went on a few days as a result of Spotify tinkering on the backend. 

 

We'll have to wait and see. 

 

 

Oh Hi!

 

We'll wait... ๐Ÿ˜ณ

Hi everyone,

 

Thank you for reaching out to the community, and welcome!

 

The search endpoint is working fine on my end.

The issue with the demo code is that the token is removed in the middle.

To use this endpoint, youโ€™ll need a token generated through the Client Credentials Flow at the very least.

You can get one by going through the Getting started with Web API guide.

 

Let me know if this helps, and feel free to ask if you have any more questions!

 
XimzendSpotify Star
Help others find this answer and click "Accept as Solution".
If you appreciate my answer, maybe give me a Like.
Note: I'm not a Spotify employee.

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/ 3 years ago  in Social & Random

Type a product name