3

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 ?

marc_s
  • 732,580
  • 175
  • 1,330
  • 1,459
George
  • 3,521
  • 4
  • 30
  • 75

1 Answers1

4

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"
Veve
  • 6,643
  • 5
  • 39
  • 58