def track_search(self, q_track, q_artist, page_size, page, s_track_rating, _format='json'): data = self._request(self._get_url('track.search?' 'q_track={}&q_artist={}' '&page_size={}' '&page={}' '&s_track_rating={}&format={}' .format(q_track, q_artist, _set_page_size(page_size), page, s_track_rating, _format))) return data
def chart_artists(self, page, page_size, country='us', _format='json'): ''' This api provides you the list of the top artists of a given country. Parameters: page - Define the page number for paginated results. page_size - Define the page size for paginated results (range 1 - 100). country - A valid country code (default US). format - Decide the output type json or xml (default json). ''' data = self._request(self._get_url('chart.artists.get?' 'page={}&page_size={}' '&country={}&format={}' .format(page,_set_page_size(page_size),country, _format))) return data
def album_tracks_get(self, album_id, page, page_size, f_has_lyrics=None, _format='json'): ''' This api provides you the list of the songs of an album. Parameters: album_id - Musixmatch album id. f_has_lyrics - When set, filter only contents with lyrics. page - Define the page number for paginated results. page_size - Define the page size for paginated results. (range is 1 to 100). format - Decide the output type json or xml (default json). ''' data = self._request(self._get_url('album.tracks.get?album_id={}' '&f_has_lyrics={}&page={}&page_size={}' '&format={}' .format(album_id,f_has_lyrics, page, _set_page_size(page_size), _format))) return data
def artist_related_get(self, artist_id, page, page_size, artist_mbid=None, _format='json'): ''' Get a list of artists somehow related to a given one. Parameters: artist_id - The musiXmatch artist id. artist_mbid - The musicbrainz artist id. page - Define the page number for paginated results. page_size - Define the page size for paginated results. (range is 1 to 100). format - Decide the output type json or xml (default json). ''' data = self._request(self._get_url('artist.related.get?artist_id={}' '&artist_mbid={}&page={}' '&page_size={}&format={}' .format(artist_id, artist_mbid, page, _set_page_size(page_size), _format))) return data
def chart_tracks_get(self, page, page_size, f_has_lyrics, country='us', _format='json'): ''' This api provides you the list of the top songs of a given country. Parameters: page - Define the page number for paginated results. page_size - Define the page size for paginated results (range 1 - 100). f_has_lyrics - When set, filter only contents with lyrics. country - A valid country code (default US). format - Decide the output type json or xml (default json). ''' data = self._request(self._get_url('chart.tracks.get?' 'page={}&page_size={}' '&country={}&format={}' '&f_has_lyrics={}' .format(page, _set_page_size(page_size), country, _format, f_has_lyrics))) return data
def artist_search(self, q_artist, page, page_size, f_artist_id, f_artist_mbid, _format='json'): ''' Search for artists in our database. Parameters: q_artist - The song artist. f_artist_id - When set, filter by this artist id. f_artist_mbid - When set, filter by this artist musicbrainz id. page - Define the page number for paginated results. page_size - Define the page size for paginated results (Range is 1 to 100). format - Decide the output type json or xml (default json). ''' data = self._request(self._get_url('artist.search?q_artist={}' '&f_artist_id={}&f_artist_mbid={}' '&page={}&page_size={}&format={}' .format(q_artist, f_artist_id, f_artist_mbid, page, _set_page_size(page_size), _format))) return data
def artist_albums_get(self, artist_id, g_album_name, page, page_size, s_release_date='desc', artist_mbid=None, _format='json'): ''' Get the album discography of an artist. Parameters: artist_id - Musixmatch artist id. artist_mbid - Musicbrainz artist id. g_album_name - Group by Album Name. s_release_date - Sort by release date (asc|desc). page - Define the page number for paginated results. page_size - Define the page size for paginated results (range is 1 to 100). format - Decide the output type json or xml (default json). ''' data = self._request(self._get_url('artist.albums.get?artist_id={}' '&artist_mbid={}&g_album_name={}' '&s_release_date={}&page={}' '&page_size={}&format={}' .format(artist_id, artist_mbid, g_album_name, s_release_date, page, _set_page_size(page_size), _format))) return data