Search¶
Warning
The search API was broken at 2016-02-03 by a server-side change made by Spotify. The functionality was never restored.
Please use the Spotify Web API to perform searches.
-
class
spotify.Search(session, query='', callback=None, track_offset=0, track_count=20, album_offset=0, album_count=20, artist_offset=0, artist_count=20, playlist_offset=0, playlist_count=20, search_type=None, sp_search=None, add_ref=True)[source]¶ A Spotify search result.
Call the
search()method on yourSessioninstance to do a search and get aSearchback.-
loaded_event= None¶ threading.Eventthat is set when the search is loaded.
-
is_loaded¶ Whether the search’s data is loaded.
-
error¶ An
ErrorTypeassociated with the search.Check to see if there was problems loading the search.
-
load(timeout=None)[source]¶ Block until the search’s data is loaded.
After
timeoutseconds with no resultsTimeoutis raised. IftimeoutisNonethe default timeout is used.The method returns
selfto allow for chaining of calls.
-
query¶ The search query.
Will always return
Noneif the search isn’t loaded.
-
did_you_mean¶ The search’s “did you mean” query or
Noneif no such suggestion exists.Will always return
Noneif the search isn’t loaded.
-
tracks¶ The tracks matching the search query.
Will always return an empty list if the search isn’t loaded.
-
track_total¶ The total number of tracks matching the search query.
If the number is larger than the interval specified at search object creation, more search results are available. To fetch these, create a new search object with a new interval.
-
albums¶ The albums matching the search query.
Will always return an empty list if the search isn’t loaded.
-
album_total¶ The total number of albums matching the search query.
If the number is larger than the interval specified at search object creation, more search results are available. To fetch these, create a new search object with a new interval.
-
artists¶ The artists matching the search query.
Will always return an empty list if the search isn’t loaded.
-
artist_total¶ The total number of artists matching the search query.
If the number is larger than the interval specified at search object creation, more search results are available. To fetch these, create a new search object with a new interval.
-
playlists¶ The playlists matching the search query as
SearchPlaylistobjects containing the name, URI and image URI for matching playlists.Will always return an empty list if the search isn’t loaded.
-
playlist_total¶ The total number of playlists matching the search query.
If the number is larger than the interval specified at search object creation, more search results are available. To fetch these, create a new search object with a new interval.
-
more(callback=None, track_count=None, album_count=None, artist_count=None, playlist_count=None)[source]¶ Get the next page of search results for the same query.
If called without arguments, the
callbackand*_countarguments from the original search is reused. If anything other thanNoneis specified, the value is used instead.
-
-
class
spotify.SearchPlaylist(session, name, uri, image_uri)[source]¶ A playlist matching a search query.
-
name= None¶ The name of the playlist.
-
uri= None¶ The URI of the playlist.
-
image_uri= None¶ The URI of the playlist’s image.
-
playlist¶ The
Playlistobject for thisSearchPlaylist.
-
image¶ The
Imageobject for thisSearchPlaylist.
-