New API Feature: artist years active

June 21, 2011

This week, we are pushing out another new feature in our API - support for artist years active.  With this new feature you will be able to retrieve years active information for hundreds of thousands of artists, search and filter artists and songs based upon when the artist was active and even create playlists based upon the years-active data.  

To get years active information, just add the ‘years_active’ bucket to any request that returns artist information.  For example here’s how to get the years active data for ‘The Beatles’

http://developer.echonest.com/api/v4/artist/profile?api_key=N6E4NIOVYMTHNDM8J&name=the+beatles&bucket=years_active

The response includes a years_active block like so:

 
            "years_active": [
                {
                    "end": 1970, 
                    "start": 1960
                }
            ]
 

Many artists have multiple ranges of activity (as they take hiatus or go on that reunion tour).  For example, The Police have 3 distinct ranges of activity.  Their years-active block looks like so:

            "years_active": [
                {
                    "end": 1984, 
                    "start": 1977
                }, 
                {
                    "end": 1986, 
                    "start": 1986
                }, 
                {
                    "end": 2008, 
                    "start": 2007
                }
            ]

For artists that are still active, the final range in the list of ranges will not have an ‘end’ year.  For example, Passion Pit are still active:

            "years_active": [
                {
                    "start": 2007
                }
            ]

Filtering results based upon years active

We’ve added a number of parameters to allow for filtering artist, song and playlist results based upon years-active data.  You can use the artist_end_year_before parameter to constrain the results to artists that ended their careers before the given year. For example, to find pop artists that disbanded before the 70s you can make a query like this:

http://developer.echonest.com/api/v4/artist/search?api_key=N6E4NIOVYMTHNDM8J&style=pop&bucket=years_active&artist_end_year_before=1970&results=3

This returns The Ronettes, The Shangri-Las and The Left Banke.

Similarly you can use the artist_start_year_after parameter to find popular country artists that launched this year.  The following query will find Scott McCreery, the latest American Idol winner:

http://developer.echonest.com/api/v4/artist/search?api_key=N6E4NIOVYMTHNDM8J&style=country&bucket=years_active&artist_start_year_after=2010&min_hotttnesss=.6

You can also use artist_end_year_after  and artist_start_year_before to filter artists. To filter artists that are still active use 'present'.  For instance, to find hottt artists that are still active use the query

http://developer.echonest.com/api/v4/artist/search?api_key=N6E4NIOVYMTHNDM8J&artist_end_year_after=present&sort=hotttnesss-desc

Sorting results based upon years active

You can also sort results based upon years active.  For instance, to sort pop artists in reverse order of start year use a query like:

http://developer.echonest.com/api/v4/artist/search?api_key=N6E4NIOVYMTHNDM8J&style=pop&sort=artist_start_year-desc&bucket=years_active

Search for songs based upon artist years active

Just as you can constrain artist searches by artist years active, you can constrain song searches by years active.  For example, to find the hotttest songs created by artists that were active between 1960 and 1980, issue a query like this:

http://developer.echonest.com/api/v4/song/search?api_key=N6E4NIOVYMTHNDM8J&sort=song_hotttnesss-desc&artist_start_year_after=1960&artist_end_year_before=1980

This gives you a good list of songs that you could use to populate a classic rock station

Creating playlists based upon years active data

You can use the years-active data to filter playlists.  For example, to create a pop playlist like you could hear in the 1960s, you can make a query like so:

http://developer.echonest.com/api/v4/playlist/static?api_key=N6E4NIOVYMTHNDM8J&type=artist-description&style=pop&artist_start_year_before=1970

This will create a playlist with artists such as Bobby Vinton, Cher, The Beach Boys, Pat Boone and Three Dog Night.

The years active data enables quite a bit of fun stuff.  Over on Music Machinery, Paul has built a little visualization of the years-active data of the top 1,000 artists. It is interesting to see how artists span time. 

The years-active data is live now in our API. Read the docs and then go build something cool with it!