Musicbrainz Api to get mbid for a list of artist

Tags: #<Tag:0x00007f58fa6dc5e0> #<Tag:0x00007f58fa6dc4c8> #<Tag:0x00007f58fa6dc360>

Hey everyone.
im trying to use the musicbrainz api to give me a list of artist mbid’s so i can further get metadata on them
however, when i run my code:
def get_tags(artist):
mine = mb.search_artists(artist)[‘artist-list’][0]
return mine

file[“test”] = file.apply(lambda x: get_tags([‘artist’]), axis=1)

it gives me the same mbid for each entry in my list, which corresponds to a standard entry
anyone know how to solve this problem.

You are passing a list to search_artists, but it expects a string with a search query. See https://musicbrainz.org/doc/MusicBrainz_API/Search and https://lucene.apache.org/core/7_7_2/queryparser/org/apache/lucene/queryparser/classic/package-summary.html#package.description for details on how to perform searches.

2 Likes

Thank you, I managed to make it work