Adding Genres to my Rockin App

Currently, I have an empty genres table that looks like this:


My thought when I created it was I’d just use booleans for each column (except artistID, of course). I was going to use these as a short list of categories to create charts with but I’m now thinking I want to use all of the genres Spotify may provide.

Their console gave me the following genres for Alice Cooper:

  "genres": [
    "album rock",
    "classic rock",
    "glam metal",
    "glam rock",
    "hard rock",

I’m fine with that. I wrote about Spotify genres once before, wondering how artists were assigned genres. Were tracks and albums assigned genres and the artist was then assigned all of those? That makes the most sense to me, but I don’t think that’s how Spotify does it.

I wanted to test and dig around but despite the fact that Alice Cooper has tracks that might not fit any of those genres, I couldn’t think of an Alice Cooper album that would go beyond those listed above. So I did Iggy Pop:

"genres": [
    "alternative rock",
    "classic rock",
    "dance rock",
    "garage rock",
    "glam rock",
    "new wave",
    "permanent wave",

The first thing I notice is Alice didn’t get “punk” despite being voted “Punk of the Year” in 1973 by Cream magazine readers. I don’t even know what “permanent wave” is. Anyway, I chose Iggy because I wondered what genre his two French language jazz albums might fall under.

Preliminaires (33EUXrFKGjpUSGacqEHhU4)

"genres": []

One version of Preliminaires has a genres property but no values.

Preliminaires (0bwmAmXOTTfX1PMS0psdjM)

"genres": []



"genres": []

Same. No surprise.

As a “control group,” I also tried:

  • Raw Power – nope, no genres
  • Lust for Life – no genres

Anyway … what I’m wondering is — can I use Spotify’s genres in the way that I want to? If I want a list of punk bands, will One Bad Pig appear or not? If they don’t, I can add the genres myself … the question really is, I guess … how do I design the table(s)? Maybe just a two-column table (artistID, genre) with an index for each. And … create a function that

  1. gets an artist
  2. gets the genres array
  3. for each genre in genre, insert a row with the artistID and the genre

Man, I hope the spelling for their genres is standardized … like … no “Funk” and “Phunk” or some such nonsense.

Yeah, that’s what I’ll do.

One Bad Pig, by the way, gets:

"genres": [
    "christian metal",
    "christian punk",
    "deep christian rock"

See, this is why I didn’t want to use Spotify’s genres. I have to write extra code to make sure a “punk” chart includes “punk” but also “protopunk” as well as “christian punk” and … whatever else. Seriously — ew.

The silver lining is, it will all make for a killer relationship chart.


Spotify Genres

I created a little genres table recently to categorize the artists I’ve entered into my little database. I created columns for these crude descriptions:

  • rock
  • xian
  • rap
  • alt
  • hardrock
  • electronic
  • metal

I can’t believe I didn’t include “classic rock” considering it was my shower thoughts about that genre that inspired this whole project.

Every Noise at Once lists all 1,523 genres Spotify uses (as of the last time ENaO updated their little page). They get a wee more “granular” (as the kids today say) than I did.

ENaO lists 142 rock genres including

  • alternative rock
  • indie rock
  • alt-indie rock
  • indie rockism
  • Russian (and many other nationalities) rock
  • classic rock
  • classic Russian rock
  • spanish rock
  • spanish indie rock
  • rock en espanol
  • space rock
  • deep space rock
  • deep soft rock

Spotify has 13 christian (not to be confused with gospel or uplift) genres including

  • christian rock
  • deep christian rock
  • christian alternative rock
  • latin christian
  • deep latin christian

There’s also

  • 48 jazz
  • 10 gothic
  • 12 dark
  • 7 industrial
  • 127 deep
  • 24 tech (tech, techno, technical, aggrotech, ghettotech, etc.)
  • 23 rap, not to be confused with
  • 47 hip hop

Of course, each artist can have multiple genres attached to them.

Alice Cooper, for example, falls under

  • album rock
  • blues-rock
  • classic rock
  • glam metal
  • glam rock
  • hard rock
  • heavy christmas
  • mellow gold
  • metal
  • protopunk
  • rock

I don’t know which comes first, the artist’s genres or if the songs and/or albums get a genre and all of those genre are applied to the artist.

I’m choosing Alice Cooper because his career has included so many types of music … his album Alice Cooper Goes to Hell falls under … well, how about that … it seems albums don’t have genres. They have a genre property but, so far, none of the albums I’ve seen have any values for the genre property.

Tracks from Get an Album’s Tracks don’t have a genre property at all. Using “I’m the Coolest” from Goes to Hell, I checked the large Track object and it doesn’t have a genre property either.

I’ll tell ya, I’d be rather pissed if someone recommended Alice to me because I like metal so I left the record store with Pretties for You, DaDa, From the Inside and Zipper Catches Skin. For the record, all of those albums are way better than Raise Your Fist and Yell, Along Came A Spider, Dragontown and Brutal Planet.

Let’s try Steve Taylor. I predict (see what I did there?) a combination of christian, punk, new wave, and rock. Spotify says

  • christian metal
  • deep christian rock

I would never in a million years have even imagined metal. I don’t know what deep means.

Steve Taylor & The Perfect Foil has no genre values so I fully expected Steve Taylor & The Danielson Foil to have none but they also fall under deep christian rock. For those of you who know who Mr. Taylor is, I’m obligated to report Chagall Guevara are also deep christian rock.

Finally working some D3 into this sweet little app o’ mine … ta-da!


After well over a year of scraping every spare couple of minutes of learning to create things with code, one of the original two purposes is finally being realized! Had to learn PHP, SQL, jQuery, and D3 (and Python along the way) for the above and it’s now still just a skeleton of my full vision.

For genres, I expected S.F.C. to have christian, rap, hip hop, or a combination of two or more. What do they have? None. Search for christian hip hop and you’ll definitely get square miles of piled high landfills of crap like Lacrae but no SFC. Sad. Rigged.

Yo, yo, yo! I just noticed artists have a followers property which I’m totally going to start grabbing. Is there a benefit to following other than having artists appear under My Music > Artists?

I wonder if albums have a saved/saves property … nope … but that would be interesting, I think.

Hmm … Freedom of Soul, however, is deep east coast hip hop. No christian or uplift, though.

  • 12th Tribe is null
  • Playdough is christian hip hop — finally!
  • Say What? is null

Last try is for One Bad Pig. I’m not optimistic. I feel pretty dissed.

Holy crap. One Bad Pig is

  • christian metal
  • christian punk
  • deep christian rock

I accept that.

I wonder why they don’t fall under “christian” and “punk” separately. Or, maybe … no, probably not.