Retrieving the hotttessst song for an artist

It's very common to want to find the current hotttessst song for an artist. This is easy to do using the Echo Nest API; there are two ways to do it.

Retrieving hotttessst song from a song/search

Using the song/search API call, you can add a parameter to restrict to a specific artist. You can then request the songs in a sorted order, by song hotttnesss. These two in conunction will allow you to get the hotttessst song or songs for an artist.

Let's look for the hotttessst Adele song (Adele's Echo Nest Artist ID is AR7J9AP1187FB5BD64). In this case, we'll also limit results to 1 song.

Example

Response

{
    "response": {
        "songs": [
            {
                "artist_id": "AR7J9AP1187FB5BD64", 
                "artist_name": "Adele", 
                "id": "SOBXHZA12C7A4BE657", 
                "title": "Rolling In The Deep"
            }
        ], 
        "status": {
            "code": 0, 
            "message": "Success", 
            "version": "4.2"
        }
    }
}

If you want to see the raw hotttnesss value for the song, you can add the bucket=hotttnesss parameter to the above query, like so:

Response

{
    "response": {
        "songs": [
            {
                "artist_id": "AR7J9AP1187FB5BD64", 
                "artist_name": "Adele", 
                "id": "SOBXHZA12C7A4BE657", 
                "song_hotttnesss": 1.0, 
                "title": "Rolling In The Deep"
            }
        ], 
        "status": {
            "code": 0, 
            "message": "Success", 
            "version": "4.2"
        }
    }
}

You can return more than one song, of course, by changing the results= parameter. Let's see Adele's 5 hotttessst songs next:

Response

{
    "response": {
        "songs": [
            {
                "artist_id": "AR7J9AP1187FB5BD64", 
                "artist_name": "Adele", 
                "id": "SOBXHZA12C7A4BE657", 
                "song_hotttnesss": 1.0, 
                "title": "Rolling In The Deep"
            }, 
            {
                "artist_id": "AR7J9AP1187FB5BD64", 
                "artist_name": "Adele", 
                "id": "SORFCTI127CF88D209", 
                "song_hotttnesss": 0.88697712481528657, 
                "title": "Chasing Pavements"
            }, 
            {
                "artist_id": "AR7J9AP1187FB5BD64", 
                "artist_name": "Adele", 
                "id": "SOFHFCU12A8AE467B2", 
                "song_hotttnesss": 0.88264481903569336, 
                "title": "Make You Feel My Love"
            }, 
            {
                "artist_id": "AR7J9AP1187FB5BD64", 
                "artist_name": "Adele", 
                "id": "SODXNUR12A58A7970D", 
                "song_hotttnesss": 0.87928343882628412, 
                "title": "Hometown Glory"
            }, 
            {
                "artist_id": "AR7J9AP1187FB5BD64", 
                "artist_name": "Adele", 
                "id": "SOULAUI12AF72A5C5B", 
                "song_hotttnesss": 0.86585868087043283, 
                "title": "Daydreamer"
            }
        ], 
        "status": {
            "code": 0, 
            "message": "Success", 
            "version": "4.2"
        }
    }
}

Retrieving the song bucket from an artist

The other way to retrieve the hotttessst song from an artist is to combine it with an artist/profile call. You may want to gather several different sets of data about an artist in one step, to minimize API calls. The typical way to do this is via buckets. In this case, you'll add the songs bucket to the parameters, which will return the top fifteen hotttessst songs, sorted in descending order of hotttnesss. NOTE: In this case you cannot change the number of songs returned.

Example

Response

{
    "response": {
        "artist": {
            "id": "AR7J9AP1187FB5BD64", 
            "name": "Adele", 
            "songs": [
                {
                    "id": "SOBXHZA12C7A4BE657", 
                    "title": "Rolling In The Deep"
                }, 
                {
                    "id": "SORFCTI127CF88D209", 
                    "title": "Chasing Pavements"
                }, 
                {
                    "id": "SOFHFCU12A8AE467B2", 
                    "title": "Make You Feel My Love"
                }, 
                {
                    "id": "SODXNUR12A58A7970D", 
                    "title": "Hometown Glory"
                }, 
                {
                    "id": "SOULAUI12AF72A5C5B", 
                    "title": "Daydreamer"
                }, 
                {
                    "id": "SOFWYYV12A8AE467A6", 
                    "title": "Cold Shoulder"
                }, 
                {
                    "id": "SORSQZS12A8AE4679F", 
                    "title": "Best For Last"
                }, 
                {
                    "id": "SOPRHXS12A58A7930E", 
                    "title": "Right As Rain"
                }, 
                {
                    "id": "SOEGXRS12A58A7C013", 
                    "title": "Crazy For You"
                }, 
                {
                    "id": "SOESSAX127CF88D210", 
                    "title": "My Same"
                }, 
                {
                    "id": "SOYFTDG12A8AE467AA", 
                    "title": "Melt My Heart To Stone"
                }, 
                {
                    "id": "SOGFTZQ12A8AE467AE", 
                    "title": "First Love"
                }, 
                {
                    "id": "SOIKHTB12A8AE467B8", 
                    "title": "Tired"
                }, 
                {
                    "id": "SOULIRY12A8C141CB6", 
                    "title": "Hometown Glory"
                }, 
                {
                    "id": "SOSAOBS12A58A7C593", 
                    "title": "My Same"
                }
            ]
        }, 
        "status": {
            "code": 0, 
            "message": "Success", 
            "version": "4.2"
        }
    }
}

Notice that, in this case, the response includes a songs section, with 15 songs listed. The first 5 match the ones returned from the earlier call. Also note that there is no extra data associated (specifically, the hotttnesss value is not returned).