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

Search for Item endpoint returning wrong Artist

Search for Item endpoint returning wrong Artist

I am testing out the Search for Item end point to search for artists. I am getting back the wrong artist consistently. For example:

 

curl --request GET \
--url 'https://api.spotify.com/v1/search?q=radiohead&type=artist&limit=1&offset=0' \
--header 'Authorization: Bearer 1POdFZRZbvb...qqillRxMr2z'

 

returns back Thom Yorke instead of Radiohead.

 

 

 

 

{
  "artists": {
    "href": "https://api.spotify.com/v1/search?query=radiohead&type=artist&locale=en-US%2Cen%3Bq%3D0.9&offset=0&limit=1",
    "limit": 1,
    "next": "https://api.spotify.com/v1/search?query=radiohead&type=artist&locale=en-US%2Cen%3Bq%3D0.9&offset=1&limit=1",
    "offset": 0,
    "previous": null,
    "total": 801,
    "items": [
      {
        "external_urls": {
          "spotify": "https://open.spotify.com/artist/4CvTDPKA6W06DRfBnZKrau"
        },
        "followers": {
          "href": null,
          "total": 1079828
        },
        "genres": ["alternative rock", "art pop", "art rock", "electronica", "glitch pop", "indie rock", "oxford indie"],
        "href": "https://api.spotify.com/v1/artists/4CvTDPKA6W06DRfBnZKrau",
        "id": "4CvTDPKA6W06DRfBnZKrau",
        "images": [
          {
            "url": "https://i.scdn.co/image/ab6761610000e5ebaa834b50a2fbd31708a71681",
            "height": 640,
            "width": 640
          },
          {
            "url": "https://i.scdn.co/image/ab67616100005174aa834b50a2fbd31708a71681",
            "height": 320,
            "width": 320
          },
          {
            "url": "https://i.scdn.co/image/ab6761610000f178aa834b50a2fbd31708a71681",
            "height": 160,
            "width": 160
          }
        ],
        "name": "Thom Yorke",
        "popularity": 56,
        "type": "artist",
        "uri": "spotify:artist:4CvTDPKA6W06DRfBnZKrau"
      }
    ]
  }
}

 

 

 

Reply
2 Replies

Good day,

 

This is an issue I faced a while ago, and it still appears to exist. Attached is the solution that worScreenshot from 2024-06-16 15-43-02.pngked for me. It appears that if you set the search limit to 1, it doesn't return what you want, but if you change it to 2, it somehow manages to get it correct. In the example below, I have proven with 2 artists that the best way to resolve this issue is to set the limit to 2, and extract the first artist. In the first example, a search for Radiohead, and a limit of 1 results in REM, but changing the limit to 2 results in Radiohead being the first result. This also occurs with all the other artists I tested, including Depeche Mode, which returns Duran Duran on a limit of 1; Depeche Mode on a limit of 2.

I hope this helps, and let me know if you still can't get it to work,

Alex Kinney

@AlexKinney you can insert a code block by first clicking on the …, and then on the </>

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