[GH-ISSUE #788] Trying to get the track id with track name and artist stated, artist name is not the exact same as it actually is #488

Closed
opened 2026-02-27 23:22:54 +03:00 by kerem · 3 comments
Owner

Originally created by @kingofsquirrel on GitHub (Mar 8, 2022).
Original GitHub issue: https://github.com/spotipy-dev/spotipy/issues/788

Hey, so I hope I'm not bothering you too much here but I've already asked this qestion a few times and nobody was able to provide an answer. So basically whenever I try to get the track id using search is works fine, and it also works when I state an artist like abba, but as soon as I state an artist like Anne-Marie it just doesn't return a track. I think it might be because my input is annemarie instead of Anne-Marie, but basically my question is if there is any way to make the spectrum of answers broader or something like that? Again, I hope I'm not bothering you too much but I can't find a solution to this.

Originally created by @kingofsquirrel on GitHub (Mar 8, 2022). Original GitHub issue: https://github.com/spotipy-dev/spotipy/issues/788 Hey, so I hope I'm not bothering you too much here but I've already asked this qestion a few times and nobody was able to provide an answer. So basically whenever I try to get the track id using search is works fine, and it also works when I state an artist like abba, but as soon as I state an artist like Anne-Marie it just doesn't return a track. I think it might be because my input is annemarie instead of Anne-Marie, but basically my question is if there is any way to make the spectrum of answers broader or something like that? Again, I hope I'm not bothering you too much but I can't find a solution to this.
kerem closed this issue 2026-02-27 23:22:54 +03:00
Author
Owner

@Peter-Schorn commented on GitHub (Mar 9, 2022):

Are you trying to get the id for a track given the track name and a slightly-misspelled artist name? Assuming you're using the API correctly, if the expected track is not returned, then there's not much you can do. It would be more helpful if you posted the code you're using.

<!-- gh-comment-id:1062476180 --> @Peter-Schorn commented on GitHub (Mar 9, 2022): Are you trying to get the id for a track given the track name and a slightly-misspelled artist name? Assuming you're using the API correctly, if the expected track is not returned, then there's not much you can do. It would be more helpful if you posted the code you're using.
Author
Owner

@kingofsquirrel commented on GitHub (Mar 9, 2022):

track_id = sp.search(q='track:' + searchOnSpotify[0] + 'artist:' + searchOnSpotify[1], limit=1, type='track')
That's the code, searchOnSpotify[0] is the track name and searchOnSpotify[1] is the artist name, it does function with non-misspelled artist names, but the weird thing is that it just returns everything like normal but there is nothing inside items. But maybe it's just a problem with the spotify api

<!-- gh-comment-id:1063122922 --> @kingofsquirrel commented on GitHub (Mar 9, 2022): `track_id = sp.search(q='track:' + searchOnSpotify[0] + 'artist:' + searchOnSpotify[1], limit=1, type='track')` That's the code, searchOnSpotify[0] is the track name and searchOnSpotify[1] is the artist name, it does function with non-misspelled artist names, but the weird thing is that it just returns everything like normal but there is nothing inside items. But maybe it's just a problem with the spotify api
Author
Owner

@Peter-Schorn commented on GitHub (Mar 10, 2022):

it does function with non-misspelled artist names, but the weird thing is that it just returns everything like normal but there is nothing inside items.

So you're saying the request returns the expected result when the artist name is spelled correctly, but returns no results when the artist name is misspelled? In that case, there's not much you can do to overcome this issue. It's not a "problem" that the Spotify web API doesn't return any results when you misspell names.

<!-- gh-comment-id:1063694640 --> @Peter-Schorn commented on GitHub (Mar 10, 2022): > it does function with non-misspelled artist names, but the weird thing is that it just returns everything like normal but there is nothing inside items. So you're saying the request returns the expected result when the artist name is spelled correctly, but returns no results when the artist name is misspelled? In that case, there's not much you can do to overcome this issue. It's not a "problem" that the Spotify web API doesn't return any results when you misspell names.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/spotipy#488
No description provided.