Spotify API get track info based on track name?

6.1k Views Asked by At

Is there a way to query the spotify API in order to get information about a track/artist/album/playlist based on its name.

E.g. query for track=I need a hero&artistName=... and get a URI/ID and some information about the track.

I couldn't find anything like this in the documentation. Am I overlooking something ?

1

There are 1 best solutions below

0
Veve On BEST ANSWER

You can use the search API endpoint, by specifying an artist and a track parameters, then extract the track ID from the response if there is only one match:

curl -X GET "https://api.spotify.com/v1/search?q=track:I%20need%20a hero%20artist:the%20artist&type=track"