Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Spotipy.search is returning incorrec Artist Info when limit set to 1 #1076

Closed
XavaarQ opened this issue Mar 1, 2024 · 2 comments
Closed
Labels

Comments

@XavaarQ
Copy link

XavaarQ commented Mar 1, 2024

Describe the bug
Spotipy.search is returning incorrect Artist Info when limit set to 1 for example information for Drake is returned when Taylor swift is searched. If limit is set >1 then the first entry is the correct artist.

Your code
spotipy = spotipy.Spotify(auth_manager=SpotifyOAuth(scope=scope))
spotipy.search(q='Taylor Swift', type='artist', limit=1)

Expected behavior
Artist info for the artist searched for should be returned when limit is set to 1

Output

{'artists': {'href': 'https://api.spotify.com/v1/search?query=Taylor+Swift&type=artist&offset=0&limit=1',
  'items': [{'external_urls': {'spotify': 'https://open.spotify.com/artist/3TVXtAsR1Inumwj472S9r4'},
    'followers': {'href': None, 'total': 84483099},
    'genres': ['canadian hip hop',
     'canadian pop',
     'hip hop',
     'pop rap',
     'rap'],
    'href': 'https://api.spotify.com/v1/artists/3TVXtAsR1Inumwj472S9r4',
    'id': '3TVXtAsR1Inumwj472S9r4',
    'images': [{'height': 640,
      'url': 'https://i.scdn.co/image/ab6761610000e5eb4293385d324db8558179afd9',
      'width': 640},
     {'height': 320,
      'url': 'https://i.scdn.co/image/ab676161000051744293385d324db8558179afd9',
      'width': 320},
     {'height': 160,
      'url': 'https://i.scdn.co/image/ab6761610000f1784293385d324db8558179afd9',
      'width': 160}],
    'name': 'Drake',
    'popularity': 96,
    'type': 'artist',
    'uri': 'spotify:artist:3TVXtAsR1Inumwj472S9r4'}],
  'limit': 1,
  'next': 'https://api.spotify.com/v1/search?query=Taylor+Swift&type=artist&offset=1&limit=1',
  'offset': 0,
  'previous': None,
  'total': 2}}

Environment:

  • OS: Ubuntu 20.04.5 LTS
  • Python version 3.9.18
  • spotipy version 2.23.0
  • VScode

Additional context
This function was returning correct info yesterday Feb 29th, 2024

@XavaarQ XavaarQ added the bug label Mar 1, 2024
@dieser-niko
Copy link
Member

This is more or less a problem with Spotify's API, not Spotipy. It also seems to be fixed now, at least I couldn't replicate the issue.

@dieser-niko
Copy link
Member

dieser-niko commented May 23, 2024

Any updates so far? Please close the issue if your problem has been resolved.

@XavaarQ XavaarQ closed this as completed May 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants