mirror of
https://github.com/spotipy-dev/spotipy.git
synced 2026-04-27 00:25:54 +03:00
[GH-ISSUE #268] Search doesn't appear to support field filters #146
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#146
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 @InconsolableCellist on GitHub (Mar 28, 2018).
Original GitHub issue: https://github.com/spotipy-dev/spotipy/issues/268
The Spotify query API permits for field filters, which allow you to key a search down to return more specific results:
https://beta.developer.spotify.com/documentation/web-api/reference/search/search/
If you try to construct a query to the generic search() function and pass in a filter as part of your q parameter, the call to request() will URI encode it rather than treat it as additional parameters, mangling the query.
@InconsolableCellist commented on GitHub (Mar 29, 2018):
I found a workaround that I didn't think previously worked, due to a typo. You can use the q parameter in the generic search() function to compose the filter yourself. For example:
q set to "steambreather artist:mastodon" will work.
I previously ruled this out by trying to compose it like "steambreather&artist:mastdon"
Functions could be added to support this so that the end user doesn't have to compose the filter himself, however, as currently this workaround makes the consumer responsible for making some Spotify-API-specific code himself.
@stephanebruckert commented on GitHub (Jan 11, 2020):
Yes everyone is free to build custom queries. A first step could be to document how to write a query in the spotipy doc.