Searching across artists

This tutorial shows you how to retrieve the songs that match a range of criteria, not just those from a single artist.

Getting the hotttessst songs right now

One of the most frequent tasks to use the Echo Nest API for is to identify what songs are trending or hot right now. We call this hotttnesss, and it's easy to get this for artists and songs. If you just want to find the current hottt songs, you'll issue a song/search call, and sort the results by song_hotttnesss in descending order. To see it, we'll also add the song_hotttnesss bucket to the results

Example

Response

{
    "response": {
        "songs": [
            {
                "artist_id": "AR7J9AP1187FB5BD64", 
                "artist_name": "Adele", 
                "id": "SOBXHZA12C7A4BE657", 
                "song_hotttnesss": 1.0, 
                "title": "Rolling In The Deep"
            }, 
            {
                "artist_id": "AR0IVTL1187B9AD520", 
                "artist_name": "Katy Perry", 
                "id": "SOOXXWV12B39EA62C8", 
                "song_hotttnesss": 0.92478512894029052, 
                "title": "E.T."
            }, 
            {
                "artist_id": "ARRH63Y1187FB47783", 
                "artist_name": "Kanye West", 
                "id": "SONWCPE12B3A138A4E", 
                "song_hotttnesss": 0.91965738109361006, 
                "title": "All Of The Lights"
            }, 
            {
                "artist_id": "ARORMBJ1241B9CDB1A", 
                "artist_name": "Ke$ha", 
                "id": "SOPEJCL12A8C142CD4", 
                "song_hotttnesss": 0.91540566433453618, 
                "title": "TiK ToK"
            }, 
            {
                "artist_id": "ARF2EHS1187B994F4E", 
                "artist_name": "Kings of Leon", 
                "id": "SOEADHV12A8C13F115", 
                "song_hotttnesss": 0.91396701140793002, 
                "title": "Sex On Fire"
            }, 
            {
                "artist_id": "AR6PFD411C8A416424", 
                "artist_name": "Passion Pit", 
                "id": "SOSLQQJ12AB017BDCC", 
                "song_hotttnesss": 0.91379036412017689, 
                "title": "Sleepyhead"
            }, 
            {
                "artist_id": "ARKU3Z61187FB51DCA", 
                "artist_name": "Rihanna", 
                "id": "SOXABIQ12C563E9362", 
                "song_hotttnesss": 0.9130986936462826, 
                "title": "S&M"
            }, 
            {
                "artist_id": "ARKDTAM1187FB54026", 
                "artist_name": "Bon Iver", 
                "id": "SOTKYBW12A8C13C3EA", 
                "song_hotttnesss": 0.91173474152199052, 
                "title": "Skinny Love"
            }, 
            {
                "artist_id": "ARFC93D1187FB49D2E", 
                "artist_name": "Arcade Fire", 
                "id": "SOANJEB12B39EA62E9", 
                "song_hotttnesss": 0.90942907020744179, 
                "title": "The Suburbs"
            }, 
            {
                "artist_id": "AR0IVTL1187B9AD520", 
                "artist_name": "Katy Perry", 
                "id": "SOFRQTD12A81C233C0", 
                "song_hotttnesss": 0.9082501820701131, 
                "title": "Firework"
            }, 
            {
                "artist_id": "ARJHCSL123E29C21E8", 
                "artist_name": "Bruno Mars", 
                "id": "SOWWOQG12B39EA62FE", 
                "song_hotttnesss": 0.90811094502475687, 
                "title": "JUST THE WAY YOU ARE"
            }, 
            {
                "artist_id": "ARX6TAQ11C8A415850", 
                "artist_name": "Lady Gaga", 
                "id": "SOAOBBG127D9789749", 
                "song_hotttnesss": 0.90794201335104796, 
                "title": "Bad Romance"
            }, 
            {
                "artist_id": "ARH6W4X1187B99274F", 
                "artist_name": "Radiohead", 
                "id": "SOMYBOF12D02199E6E", 
                "song_hotttnesss": 0.90791065722720743, 
                "title": "No Surprises"
            }, 
            {
                "artist_id": "ARX6TAQ11C8A415850", 
                "artist_name": "Lady Gaga", 
                "id": "SOVTNSQ12AB018A769", 
                "song_hotttnesss": 0.90597556505311749, 
                "title": "Bad Romance"
            }, 
            {
                "artist_id": "ARH3S5S1187FB4F76B", 
                "artist_name": "Nirvana", 
                "id": "SOAWRDN12A8C140D30", 
                "song_hotttnesss": 0.90567054770560762, 
                "title": "Smells Like Teen Spirit"
            }
        ], 
        "status": {
            "code": 0, 
            "message": "Success", 
            "version": "4.2"
        }
    }
}

You can of course add additional parameters to the search query, to find only (e.g.) hot jazz songs (by adding: style=pop to the query.

Example

Response

{
    "response": {
        "songs": [
            {
                "artist_id": "AROSI8L1187B9ACD43", 
                "artist_name": "Ice Cube", 
                "id": "SOKYHYL12A8C13D79D", 
                "song_hotttnesss": 0.85877740128401336, 
                "title": "It Was A Good Day"
            }, 
            {
                "artist_id": "AR81GOD1187B9B1583", 
                "artist_name": "Young Jeezy", 
                "id": "SODTPYI12AB01805A9", 
                "song_hotttnesss": 0.8506155947923103, 
                "title": "Put On"
            }, 
            {
                "artist_id": "AR81GOD1187B9B1583", 
                "artist_name": "Young Jeezy", 
                "id": "SOMNXTR12AF72A7C81", 
                "song_hotttnesss": 0.83306358200084596, 
                "title": "Put On"
            }, 
            {
                "artist_id": "AR81GOD1187B9B1583", 
                "artist_name": "Young Jeezy", 
                "id": "SOPOGUR12873FD4A6C", 
                "song_hotttnesss": 0.83162728627400528, 
                "title": "Hustlaz Ambition"
            }, 
            {
                "artist_id": "AROSI8L1187B9ACD43", 
                "artist_name": "Ice Cube", 
                "id": "SOTXLMK12A6D4F9B89", 
                "song_hotttnesss": 0.81691219195135345, 
                "title": "Smoke Some Weed (Explicit)"
            }
        ], 
        "status": {
            "code": 0, 
            "message": "Success", 
            "version": "4.2"
        }
    }
}

Finding songs that meet other criteria

You can also use song/search to generate lists of songs that match other criteria. All of the parameters available in the song/search API call can be combined together, to generate interesting collections of songs. As an example, suppose you are looking for fast, danceable rock songs. You would combine a tempo threshold, a danceability threshold, and a style filter, like this:

Response

{
    "response": {
        "songs": [
            {
                "artist_id": "AR136921187FB4B8D2", 
                "artist_name": "McQueen", 
                "id": "SOFBJYM130516DF5F6", 
                "title": "Running Out of Things to Say (video)"
            }, 
            {
                "artist_id": "AR136921187FB4B8D2", 
                "artist_name": "McQueen", 
                "id": "SOZRITE12DA5949F08", 
                "title": "Running Out of Things to Say (video)"
            }, 
            {
                "artist_id": "AR1R1P51187B9A9AB6", 
                "artist_name": "The Reason", 
                "id": "SOKNBJG12A58A7A113", 
                "title": "Grounded"
            }, 
            {
                "artist_id": "AR1R1P51187B9A9AB6", 
                "artist_name": "The Reason", 
                "id": "SOWRTUH12A58A77AC8", 
                "title": "We Ridin"
            }, 
            {
                "artist_id": "AR1R1P51187B9A9AB6", 
                "artist_name": "The Reason", 
                "id": "SONCTMB12A58A7EF80", 
                "title": "The Reason"
            }
        ], 
        "status": {
            "code": 0, 
            "message": "Success", 
            "version": "4.2"
        }
    }
}

You might then want to give preference to songs that are a little more familiar. To so that, you'd issue the same query, but then sort by artist familiarity, like this:

Response

{
    "response": {
        "songs": [
            {
                "artist_id": "ARWX5TK1187FB4CDBE", 
                "artist_name": "The Who", 
                "id": "SOGAIWL12A58A77F51", 
                "title": "Guitar And Pen"
            }, 
            {
                "artist_id": "ARWX5TK1187FB4CDBE", 
                "artist_name": "The Who", 
                "id": "SONJJGP12A67020D47", 
                "title": "Who Are You"
            }, 
            {
                "artist_id": "ARWX5TK1187FB4CDBE", 
                "artist_name": "The Who", 
                "id": "SOHLSZD12B0B8084AC", 
                "title": "04 University Challenge"
            }, 
            {
                "artist_id": "ARWX5TK1187FB4CDBE", 
                "artist_name": "The Who", 
                "id": "SONQJEF12A6D4F915A", 
                "title": "Two Thousand Years"
            }, 
            {
                "artist_id": "ARWX5TK1187FB4CDBE", 
                "artist_name": "The Who", 
                "id": "SOKLXEO12AF72A21F6", 
                "title": "University Challenge"
            }
        ], 
        "status": {
            "code": 0, 
            "message": "Success", 
            "version": "4.2"
        }
    }
}

Combining these filters and sorts will give you an almost limitless field to build interesting musical applications.