Title might be confusing so here is an example. If I search with the following url then I get the expected JSON response which includes Avril Lavigne as an artist an the items array.
"https://api.spotify.com/v1/search?q=track%3AFlames%20artist%3AMod%20Sun&type=track&limit=1"
{
"tracks": {
"href": "https://api.spotify.com/v1/search?query=track%3AFlames+artist%3AMod+sun&type=track&locale=en-US%2Cen%3Bq%3D0.9&offset=0&limit=1",
"items": [
{
"album": {
"album_type": "single",
"artists": [
{
"external_urls": {
"spotify": "https://open.spotify.com/artist/3u2R8st1bb6zfBqNWceRXG"
},
"href": "https://api.spotify.com/v1/artists/3u2R8st1bb6zfBqNWceRXG",
"id": "3u2R8st1bb6zfBqNWceRXG",
"name": "MOD SUN",
"type": "artist",
"uri": "spotify:artist:3u2R8st1bb6zfBqNWceRXG"
},
{
"external_urls": {
"spotify": "https://open.spotify.com/artist/0p4nmQO2msCgU4IF37Wi3j"
},
"href": "https://api.spotify.com/v1/artists/0p4nmQO2msCgU4IF37Wi3j",
"id": "0p4nmQO2msCgU4IF37Wi3j",
"name": "Avril Lavigne",
"type": "artist",
"uri": "spotify:artist:0p4nmQO2msCgU4IF37Wi3j"
}
], However, if I do that same search but with Avril Lavigne instead of MOD SUN then I dont get the same JSON but rahter one with an empty items array that looks like this:
"https://api.spotify.com/v1/search?q=track%3AFlames%20artist%3AAvrilLavigne&type=track&limit=1"
{
"tracks": {
"href": "https://api.spotify.com/v1/search?query=track%3AFlames+artist%3AAvrilLavigne&type=track&locale=en-US%2Cen%3Bq%3D0.9&offset=0&limit=1",
"items": [],
"limit": 1,
"next": null,
"offset": 0,
"previous": null,
"total": 0
}
}This is kind of throwing a wrench in my plans. Is this intended behavior? And if so is there any work around? Im not going to have the track id, just one of the artists(which might not be the first one listed as described) and the song name.