Genre tag names API list

webservice
api
genres
Tags: #<Tag:0x00007f11cad4b7e0> #<Tag:0x00007f11cad4b650> #<Tag:0x00007f11cad4b448>

#1

Hi all,

I am looking at the current Genre list - does anyone know what API query can get a copy of this list?

Thanks in advance


#2

The list is here:


#3
' 

@paulakreuzer thank you for your reply. Perhaps I didn’t phrase my question correctly - I am looking for web service query - perhaps something like this:

https://musicbrainz.org/ws/2/release/?inc=genre-list


#4

We don’t currently have this, mostly because I didn’t expect it to be very useful - tags in the list will be returned as genres with inc=genres, others won’t, so requesting the full list of possible genres seemed irrelevant. If we added it, it certainly wouldn’t be as an inc for release (that seems to make no semantic sense), but as ws/2/genre or something like that :slight_smile: What’s your use case?


#5

@reosarevok thank you for that info. I am re-coding my player to include Genre search and user entry. I want to give my users a list of available genres. I am assuming that MB Genre list will change from time-to-time. I am not keen on hardcoding the list into the player…


#6

Fair :slight_smile: I added MBS-9880 for it. Not sure when we’ll have time for it, but at least it’s tracked now, will try to get to it in the not too long term. In the meantime, can you add a hack to the player to scrape that file once a week or so? As long as it is hardcoded on our side, it will only change once every two weeks anyway, since that’s how often we put new code into production. Whenever we move to the database I’ll make sure to add the genre list to the API if it didn’t happen before that.


#7

Thank you very much for that @reosarevok. It is going to take me some time to complete my end of this task. In the meantime I have captured the current list into a file, and I am using that for intermediate testing.


#8

As far as I can tell, https://raw.githubusercontent.com/metabrainz/musicbrainz-server/master/entities.json should always work, which means until we have a better way you can just make your player consume the JSON file, then check for tag.genres :slight_smile:


#9

Thanks for that @reosarevok. As long as the github site is in-sync with MB database I’m happy with that.


#10

@reosarevok - I have a skeletal prototype of my player running. I’m using the “https://raw.githubusercontent.com/metabrainz/musicbrainz-server/master/entities.json” link as temporary mechanism to load the Genre Names List. If you could let me know when an alternative method is available, that would be great. Thanks.


#11

Will do! There’s https://musicbrainz.org/genres as well right now but I suspect the JSON is still better for your purposes: easier to parse and it actually gets genres added even before the site itself does :slight_smile: