From ec638870ca6f47df57c9fa0b4eaab346e5fc551d Mon Sep 17 00:00:00 2001 From: Mattia Maestrini Date: Wed, 5 Aug 2015 18:52:38 +0100 Subject: [PATCH] Add 'market' parameter to the search endpoint --- spotipy/client.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/spotipy/client.py b/spotipy/client.py index c926814..1a2a244 100644 --- a/spotipy/client.py +++ b/spotipy/client.py @@ -288,7 +288,7 @@ class Spotify(object): tlist = [self._get_id('album', a) for a in albums] return self._get('albums/?ids=' + ','.join(tlist)) - def search(self, q, limit=10, offset=0, type='track'): + def search(self, q, limit=10, offset=0, type='track', market=None): ''' searches for an item Parameters: @@ -297,8 +297,9 @@ class Spotify(object): - offset - the index of the first item to return - type - the type of item to return. One of 'artist', 'album', 'track' or 'playlist' + - market - An ISO 3166-1 alpha-2 country code or the string from_token. ''' - return self._get('search', q=q, limit=limit, offset=offset, type=type) + return self._get('search', q=q, limit=limit, offset=offset, type=type, market=market) def user(self, user): ''' Gets basic profile information about a Spotify User