Announcements

Help Wizard

Step 1

NEXT STEP

Query search work on spotify app, but not when i use API

Query search work on spotify app, but not when i use API

Hello,

 

I'm trying to use the Spotify API to get some informations about a specific sound.

I have the track title and artist, so I'm using the search item endpoint.

My example is to find the title "Balayer" by "13 Block".

 

When I go on 

 

 

 

https://developer.spotify.com/console/get-search-item/?q=artist%3A%2213%20Block%22%20track%3A%22Balayer%22&type=track&market=&limit=10&offset=0

 

 

 

 

It found me the track I'm searching for.

 

But when I got to my ReactJS app, I'm using axios package to call the API.

First I'm calling

https://accounts.spotify.com/api/token

With grant_type: client_credential, to get my API token. Then I'm doing a second call by using the URL given in the API test page, and of course the token in header, and my search return 0 items in the response.

I tried several URL encoding, I tried without artist: and track: keys, and it really don't want to find the track.

 

Do you know why and how to fix it please ?

 

Thanks,

Alexandre Navaro

Reply
1 Reply

Hey @Navalex, help's here!

Hmm, that doesn't sound right! Are you still having issues with this? What is the response you in your ReactJS app? Also, what is the code you use to call the API? I'd love to get to the bottom of this. 

 

Have a good one!

Hubo

HuboSpotify 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