Announcements

Help Wizard

Step 1

NEXT STEP

FAQs

Please see below the most popular frequently asked questions.

Loading article...

Loading faqs...

VIEW ALL

Ongoing Issues

Please see below the current ongoing issues which are under investigation.

Loading issue...

Loading ongoing issues...

VIEW ALL

API Search: Second artist doesent show up on track when search for

API Search: Second artist doesent show up on track when search for

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. 

Reply
2 Replies

Nevermind, Im an **bleep**. If I just do a search query without specifying the artist/track it works perfectly. 

Also, you are searching for AvrilLavigne (without a space), instead of Avril%20Lavigne (with a space).

XimzendSpotify 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

Let's introduce ourselves!

Hey there you,   Yeah, you! 😁   Welcome - we're glad you joined the Spotify Community!   While you here, let's have a fun game and get…

ModeratorStaff / Moderator/ 4 years ago  in Social & Random