I'm trying to search Spotify for metadata for tracks. I'm trying to see if Spotify has a song from a YouTube video. This is the URL template I use to make the search:
https://api.spotify.com/v1/search?q="MY SEARCH QUERY"&type=artist,track.
Since it's hard to determine what part of the search query is the artist or the track, I add those 2 as types for my search query.
However, when I get a YouTube video with a title like this: "Katy Perry - This How We Do (Official Video) [Letra Español - Lyrics English]" and use it as my search term I get 0 results.
If I manually "clean" it and my search query is instead: "Katy Perry - This How We Do", I get the result I'm looking for.
https://api.spotify.com/v1/search?q=Katy%20Perry%20-%20This%20How%20We%20Do&type=artist,track
Given this example is there any way in which the first query (as is without any cleaning) will yield results from the Spotify API? If not, what do I need to do to my search terms before sending them to the Spotify search API so that it has a greater chance of yielding results?