mirror of
https://github.com/spotipy-dev/spotipy.git
synced 2026-04-27 08:35:49 +03:00
[GH-ISSUE #489] Exact search for artist name possible? #289
Labels
No labels
api-bug
bug
dependencies
documentation
duplicate
enhancement
external-ide
headless-mode
implicit-grant-flow
invalid
missing-endpoint
pr-welcome
private-api
pull-request
question
spotipy3
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/spotipy#289
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @Musikfreitag on GitHub (May 4, 2020).
Original GitHub issue: https://github.com/spotipy-dev/spotipy/issues/489
When I use "sp.search()", then I get results that contain the string anywhere in the hit result. Is it possible to do an exact search?
Example for the query "LEA"
results = sp.search(q='artist:' +'LEA', type='artist')
items = results['artists']['items']
for i in range(len(items)):
print(items[i]['name']+"\t"+str(items[i]['followers']['total']))
Current Results:
League of Legends 621187
Lea Salonga 118225
Christian Leave 178686
Yung Lean 418445
Leavv 13121
LeAnn Rimes 715975
The Human League 597907
Lea Michele 429499
Pure Prairie League 116541
Leah Maur 141
Expected Result:
LEA 446601
The current results are not sorted and the expected hit is not in the top 50 results, so adding "limit = 50" does not help. I am happy about any help for this issue, even it is a link to a part of the documentation that I missed.
@ritiek commented on GitHub (May 7, 2020):
Doesn't seem like Spotify offers making proper exact searches as of yet. Spotify includes a section on advanced search but none of them help with your example use-case:
https://developer.spotify.com/documentation/web-api/reference/search/search/
https://community.spotify.com/t5/Social/Is-there-a-n-extended-Spotify-search-syntax/td-p/1014655
The link https://support.spotify.com/us/using_spotify/features/search/ mentions:
But it doesn't seem to be working for your example artist search.
There has also been a support question asked on https://community.spotify.com/t5/iOS-iPhone-iPad/Search-need-an-quot-exact-match-quot/td-p/1116711 but doesn't have a satisfactory answer that works for your example use-case.
Hard luck I guess. :(