Link Search Menu Expand Document

playlist.getActivityPlaylist

Returns personalized playlists for the user given an acivity.

Example URL

https://api.melodia.io/v1/playlist.getActivityPlaylist?userKey=a4b5G982H3r9Vf783EEd&forActivity=running&timestamp=1625294543&location_latitude=37.445099&location_longitude=-122.160362&location_altitude=9.1

Params

paramrequireddescriptiontype
userKeyYA unique ID to be associated with the new userString
forActivityNCurrent moment’s activity. Can be either of the following: stationary, walking, running, biking, drivingString
timestampNCurrent moment’s Unix timestamp (in seconds). Defaults to current timestamp.Int
location_latitudeNCurrent moment’s location’s latitude (in degrees)Float
location_longitudeNCurrent moment’s location’s longitude (in degrees)Float
location_altitudeNCurrent moment’s location’s altitude (in meters)Float
count_playlistsNNumber of playlists to return (defaults to 3)Int
count_tracksNNumber of tracks per playlist (defaults to 8)Int

Auth

This service requires authentication. Refer to Authentication for more details.

Sample Response

{
    "statusCode": 200,
    "body":
        "playlists": [
            {"tracks": [
                "trackKey": "MT239432948",
                "title": "Someone Like You",
                "artist": "Adele",
                "artistKey": "MA29FE4f3gXj",
                "artwork100": "http://akamai-b.cdn.cddbp.net/cds/2.0/cover/D7E5/6608/B546/60CD_xlarge_front.jpg"
                ...
                ]
            },
            {"tracks": [
                "trackKey": "MT2894F294R",
                "title": "Thinking Out Loud",
                "artist": "Ed Sheeran",
                "artistKey": "MA69FE2f3g34",
                "artwork100": "http://akamai-b.cdn.cddbp.net/cds/2.0/cover/D7E5/6608/B546/60CD_xlarge_front.jpg"
                ...
                ]
            },
    ]
}

Discussion

Call this method to get playlist suggestions for the user according to a give activity (i.e., running, walking, driving, etc.). Playlists are personalized to the user’s unique taste and are curated according to their past listening patterns.