Sean Gallavan
Sean Gallavan

Reputation: 41

How do I get a full list of genres from the Gracenote Music API?

We are currently working with the Gracenote Music API and are wondering if there is a full list of generes and mappings between the different hierarchies of genres. Ideally, we'd love a dump of those tables in the backend Gracenote system. If .csv's, text files, or even XML are easier to provide, we will figure out a way to import that data in our system.

If a full mapping isn't available, a list of top level genres would be very helpful.

Upvotes: 4

Views: 1834

Answers (3)

Mawg
Mawg

Reputation: 40185

To get the list of genres (or moods, or eras) you need to make a call to the "fieldvalues" API, you can see how to do it here:

https://developer.gracenote.com/rhythm-api#attribute-station

This call will give you the list of supported genres:

https://cXXXXXXX.web.cddbp.net/webapi/json/1.0/radio/fieldvalues?fieldname=RADIOGENRE&client=CLIENT_ID&user=USER_ID

You can then use the returned ID's with pygn.createRadio()

Upvotes: 1

breakpoint
breakpoint

Reputation: 986

It turns out that there are at least three sources for example code in the GNSDK:

  1. Properly maintained samples in the "samples" directory. This will compile into full applications with minimal effort (once you've settled on a makefile solution for your platform, as a complete Automake setup is not yet part of the package).

  2. samples/code_snippets - These are useful to look at, but do not necessarily build into full apps, and may not be completely up to date with the SDK.

  3. Code linked from the documentation. This is a problem if you downloaded the SDK as an archive and the documentation as a PDF, as the links will resolve as relative file links, not HTTP links, and you won't have the files. You need to look at the HTML version of the documentation on the server to find these files. However, they are apparently outdated and will not build without some (relatively minor rework). This can be done using the primary samples as a guide.

So, all of that said, what you want to look at in the GNSDK Developer's Guide is "Advanced Topics : Using Lists". You will want to read that entire section, then find and work with the sample application referenced on page 93.

Upvotes: 1

jmctodo
jmctodo

Reputation: 186

I'm afraid there is no way to iterate the list of genres via the Web API. Most of the client SDKs have this capability.

Upvotes: 2

Related Questions