close
The Wayback Machine - https://web.archive.org/web/20140803061704/https://developer.beatsmusic.com/docs/read/recs/Just_for_You

Just for You

Get a user’s recommended playable content, provided in the Just For You section of the app on the user's mobile device.


Endpoint URL

/api/users/:user_id/recs/just_for_you


HTTP Method

GET


Authentication

OAuth 2.0: Access token required. See Authentication for examples and details.


Parameters

Name Required Description Example
user_id required The unique ID for the user. 150470956064702464
time_zone required The local time zone for the user, as a UTC offset. -0800
timestamp optional A unix timestamp to filter recommendations and keep paging consistent over subsequent requests. 1394211265
offset optional A zero-based integer offset into the results. Default 0. 0
limit optional Specifies the maximum number of records to retrieve. You are guaranteed to get at most this number of results, but you may get fewer. If set to zero or less, returns nothing. Maximum value is 200 (i.e., if greater than 200, returns only 200). If not supplied, defaults to 20. 20

Response Elements

ResponseDescription
code

Beats API response code. OK if successful; otherwise an error code is returned.

data

A list of recommended playable content (playlists, albums, tracks).


 

Example Request

Suppose you would like to retrieve the recommended playable content for a user. You will need their user ID. Recall that when you first created a playlist for the user, a response containing the user ID was returned:

{
    "data": {
        ...
    },
    "refs": {
        ...
        "user": {
            "ref_type": "user",
            "display": "[YOUR_USER_NAME]",
            "id": "150470956064702464"
        },
        ...
    }
    "code": "OK"
}

You will need to provide the user ID, the user's time zone, and your access token. The general form of this API is:

curl -X GET "https://partner.api.beatsmusic.com/v1/api/users/[USER_ID]/recs/just_for_you?
    time_zone=[TIME_ZONE]
    &access_token=[YOUR_ACCESS_TOKEN]"

In this example we will get at most 3 recommendations for the user ID you just retrieved (150470956064702464), specifying limit=3 in the request:

curl -X GET "https://partner.api.beatsmusic.com/v1/api/users/150470956064702464/recs/just_for_you?
    time_zone=-0800
    &limit=3
    &access_token=[YOUR_ACCESS_TOKEN]"

 

Example Response

{
    "data": [
        {
            "blurb": [],
            "timestamp": 1394211265,
            "content": {
                "type": "playlist",
                "id": "pl106751132424077568",
                "name": "Bruce Springsteen: Deep Cuts",
                "description": "Bruce Springsteen is ...",
                "user_display_name": "Beats Rock",
                "access": "public",
                "duration": 5438,
                "total_tracks": 21,
                "total_subscribers": 96,
                "created_at": 1382449853,
                "updated_at": 1394012479,
                "parental_advisory": false,
                "refs": {
                    "tracks": [
                        {
                            "ref_type": "track",
                            "id": "tr547211",
                            "display": "The Ties That Bind"
                        },
                        {
                            "ref_type": "track",
                            "id": "tr64713217",
                            "display": "Easy Money"
                        },
                        {
                            "ref_type": "track",
                            "id": "tr30359167",
                            "display": "She's The One"
                        },
                        ...
                    ],
                    "user": {
                        "ref_type": "genre",
                        "display": "beatsrock",
                        "id": "eg77531656377860096"
                    },
                    "author": {
                        "ref_type": "user",
                        "display": "Christopher Tait",
                        "id": "59078276936630273"
                    }
                }
            },
            "type": "recommendation"
        },
        {
            "blurb": [
                "1978 · 9 Songs"
            ],
            "timestamp": 1394211265,
            "content": {
                "type": "album",
                "id": "al665593",
                "title": "Dire Straits (Remastered)",
                "duration": 2503,
                "parental_advisory": false,
                "edited_version": false,
                "release_date": "1978-10-01",
                "release_format": "LP",
                "rating": 0,
                "popularity": 26758,
                "streamable": true,
                "artist_display_name": "Dire Straits",
                "refs": {
                    "artists": [
                        {
                            "ref_type": "artist",
                            "id": "ar8489",
                            "display": "Dire Straits"
                        }
                    ],
                    "label": {
                        "ref_type": "label",
                        "id": "lb2",
                        "display": "Warner Bros."
                    },
                    "tracks": [
                        {
                            "ref_type": "track",
                            "id": "tr665595",
                            "display": "Down To The Waterline"
                        },
                        {
                            "ref_type": "track",
                            "id": "tr665597",
                            "display": "Water Of Love"
                        },
                        {
                            "ref_type": "track",
                            "id": "tr665599",
                            "display": "Setting Me Up"
                        },
                        ...
                    ]
                },
                "canonical": true,
                "total_companion_albums": 0,
                "total_tracks": 9,
                "essential": false
            },
            "type": "recommendation"
        },
        {
            "blurb": [
                "1970 · 13 Songs"
            ],
            "timestamp": 1394211265,
            "content": {
                "type": "album",
                "id": "al46894159",
                "title": "Bridge Over Troubled Water",
                "duration": 2607,
                "parental_advisory": false,
                "edited_version": false,
                "release_date": "1970-01-26",
                "release_format": "LP",
                "rating": 0,
                "popularity": 31034,
                "streamable": true,
                "artist_display_name": "Simon & Garfunkel",
                "refs": {
                    "artists": [
                        {
                            "ref_type": "artist",
                            "id": "ar30163",
                            "display": "Simon & Garfunkel"
                        }
                    ],
                    "label": {
                        "ref_type": "label",
                        "id": "lb468",
                        "display": "COLUMBIA/LEGACY"
                    },
                    "tracks": [
                        {
                            "ref_type": "track",
                            "id": "tr46894241",
                            "display": "Bridge Over Troubled Water"
                        },
                        {
                            "ref_type": "track",
                            "id": "tr46894225",
                            "display": "El Condor Pasa (If I Could)"
                        },
                        {
                            "ref_type": "track",
                            "id": "tr46894211",
                            "display": "Cecilia"
                        },
                        ...
                    ]
                },
                "canonical": true,
                "total_companion_albums": 0,
                "total_tracks": 13,
                "essential": true
            },
            "type": "recommendation"
        }
    ],
    "info": {
        "offset": 0,
        "count": 3,
        "total": 73
    },
    "code": "OK"
}

Docs Navigation