Tracks

This section of the API handles retrieval of track data. All requests must be authenticated as covered in the introduction.

smp.tracks.getChart

This method gets the last week's top 50 most listened to tracks on Playlists.net.

http://playlists.net/api/v2?method=smp.tracks.getChart

It will return an array of results similar to the following.

{
    "status":"ok",
    "tracks":[
        {
            "id":"6996202",
            "name":"Don't You Worry Child (Radio Edit) [feat. John Martin]",
            "spotify_uri":"spotify:track:1oF75Qbv8UvOBm1imUAE51",
            "artist":{
                "id":"179981",
                "image":"https:\/\/s3.amazonaws.com\/smpv2-artists-image-large\/179981.jpg",
                "image_l":"https:\/\/s3.amazonaws.com\/smpv2-artists-image-large\/179981.jpg",
                "image_m":"https:\/\/s3.amazonaws.com\/smpv2-artists-image-medium\/179981.jpg",
                "image_s":"https:\/\/s3.amazonaws.com\/smpv2-artists-image-small\/179981.jpg",
                "name":"Swedish House Mafia",
                "summary":"Swedish House Mafia is a house music supergroup comprised of DJ\/producers Axwell, Steve Angello, and Sebastian Ingrosso. Each of the group members is an accomplished DJ\/producer and label owner in his own right. The Swedish group initially teamed up in the mid-2000s, when they toured together as DJs and collaborated from time to time on one another's productions. Eric Prydz was also a member of the group for a while.",
                "summary_formatted":"Swedish House Mafia is a house music supergroup comprised of DJ\/producers Axwell, Steve Angello, and Sebastian Ingrosso. Each of the group members is an accomplished DJ\/producer and label owner in his own right. The Swedish group initially teamed up in the mid-2000s, when they toured together as DJs and collaborated from time to time on one another's productions. Eric Prydz was also a member of the group for a while.",
                "spotify_uri":"spotify:artist:1h6Cn3P4NGzXbaXidqURXs",
                "uri":"http:\/\/playlists.net\/artists\/Swedish House Mafia"
            }
        },
        {
            "id":"5588366",
            "name":"Greyhound",
            "spotify_uri":"spotify:track:3GC3xIxWImpR7dfv2F81ze",
            "artist":{
                "id":"179981",
                "image":"https:\/\/s3.amazonaws.com\/smpv2-artists-image-large\/179981.jpg",
                "image_l":"https:\/\/s3.amazonaws.com\/smpv2-artists-image-large\/179981.jpg",
                "image_m":"https:\/\/s3.amazonaws.com\/smpv2-artists-image-medium\/179981.jpg",
                "image_s":"https:\/\/s3.amazonaws.com\/smpv2-artists-image-small\/179981.jpg",
                "name":"Swedish House Mafia",
                "summary":"Swedish House Mafia is a house music supergroup comprised of DJ\/producers Axwell, Steve Angello, and Sebastian Ingrosso. Each of the group members is an accomplished DJ\/producer and label owner in his own right. The Swedish group initially teamed up in the mid-2000s, when they toured together as DJs and collaborated from time to time on one another's productions. Eric Prydz was also a member of the group for a while.",
                "summary_formatted":"Swedish House Mafia is a house music supergroup comprised of DJ\/producers Axwell, Steve Angello, and Sebastian Ingrosso. Each of the group members is an accomplished DJ\/producer and label owner in his own right. The Swedish group initially teamed up in the mid-2000s, when they toured together as DJs and collaborated from time to time on one another's productions. Eric Prydz was also a member of the group for a while.",
                "spotify_uri":"spotify:artist:1h6Cn3P4NGzXbaXidqURXs",
                "uri":"http:\/\/playlists.net\/artists\/Swedish House Mafia"
            }
        }
    ]
}

PHP SDK

require_once "ShareMyPlaylists.php";

$public = "{your_public_key}";
$private = "{your_private_key}";

$smp = new ShareMyPlaylists_Api($public, $private);

$parameters = array();

$get_list = $smp->api("tracks.getChart", $parameters);

$tracks = $get_list["tracks"];

foreach( $tracks as $track )
{
	print "".$track["name"]."<br />";
}