Rcs-eval-api/v2.1/for-you

Jump to: navigation, search

ForYou

This is one of several requests that demonstrates how Rovi can generate personalized entertainment recommendations for your customers. To understand this feature, we suggest working with these calls in this order:

This Request . . .       Demonstrates . . .

How an item taste profile gets added to a user taste profile.

What an item taste profile looks like.

What a user taste profile looks like.

How personalized recommendations are generated from a user taste profile.

ForYou returns personalized entertainment recommendations based on a user taste profile and, optionally, on the following filters specified in the request:

  • Field-level filters
  • Upcoming television schedules
  • Priority settings such as hot, new, fresh, or all-time

Note: Events must be submitted for a user before recommendations can be returned for that user.

Syntax

endpoint/foryou?apikey=apikey&sig=sig&userid=userid&entitytype=entitytype [&boost=boost] [&filter=filter] [&availableclu=availableclu] [&availablestart=availablestart] [&availableend=availableend] [&include=include] [&format=format] [&language=language] [&size=size]

Request Example 1

Recommend 20 songs for user ID 100.

Request Example 2

Recommend movies and TV series for user ID 100 with a focus on fresh and new content.

Request Example 3

Recommend up to ten TV movies for user ID 100 over the weekend on DirecTV in Boston, MA, and show up to five viewing times each. To try this call, change the available-end date 20111120 to next Sunday.

Request Parameters

  Music-related requests      Movie-related requests    ⊑⊒  TV-related requests

ParameterRequiredDescription
apikey Yes Access code that authorizes your request for data from Rovi.
endpoint Yes Database of the item.
For this type of item . . .Specify this endpoint.
musicmusic
movies and TV seriesamgvideo
television (movies and TV programs)video
entitytype Yes Type of content.
In this endpoint . . . To find . . .Specify entitytype.
music songssong
 albumsalbum
 people in musicartist
amgvideo moviesmovie
 TV seriestvseries
video ⊑⊒moviesmovie
 TV seriestvseries
To return data from multiple entity types within an endpoint, specify multiple entitytype parameters like this: entitytype=tvseries&entitytype=movie. Note:  The top results may come from just one of the entity types. Order of results is determined by relevance and is not deliberately balanced across the searched entity types.
sig Yes A calculated, 32-hex-digit authorization code. To perform the calculation, execute the MD5 function on the concatenation of the following three ASCII strings:
  • Your API key.
  • The secret key you received with your API key.
  • The Unix time. Unix time is a timestamp supported in most development environments, and is generally defined as the number of seconds since January 1, 1970 00:00:00 GMT.

Express the alpha hex digits as lower case.

Perform the calculation at the time of each request to be sure it's within a five-minute window of the server time. If you're testing the call in a browser, use our online signature generator to perform the calculation.

userid Yes ID of a user for whom events have been previously submitted for the requested endpoint.
available-clu No Service ID of a television service that has upcoming movies or TV series you want to match against. Service IDs for television services are available with calls to Services.

Broadcast times of programs are returned in availabilities objects. To return multiple broadcast times, specify the maximum number of broadcasts as serviceID,number like this: availableclu=360861,5.

Notes:

  • Requires an endpoint of video.
  • Requires an entitytype of movie or tvseries.
  • To check multiple television services, specify multiple parameters like this: availableclu=360861,5&availableclu=20494.
  • To limit the broadcast time window to less than the next two weeks, specify the availablestart or availableend parameters, or both.
  • To return only programs in the broadcast time window, add boost=availability or filter=availability to the request.
  • Here are some Service IDs you can use for evaluation tests:
    • 20419 — Chicago Area Broadcast TV
    • 890504 — CanalSat in Paris, France
    • 68809 — Shaw Cable in Moose Jaw, Saskatchewan
    • 60795 — Time Warner Cable in Southern Manhattan
    • 360861 — Time Warner Cable in Beverly Hills, California
available-end No If you specify the availableclu parameter, availableend specifies the end of the broadcast time window in one of the following formats:
  • UTC time: YYYYmmDDhhMMssZ. For example: 20120315140000Z for 2012-03-15 14:00:00 GMT.
  • Local time with a UTC offset: YYYYmmDDhhMMss + or - hhMM (positive or negative offset). For example, for the same time specified as US Pacific time: 201203150600000800.

If not specified, the end time is two weeks after the time of the request.

availablestart No If you specify the availableclu parameter, availablestart specifies the start of the broadcast time window in one of the following formats:
  • UTC time: YYYYmmDDhhMMssZ. For example: 20120315140000Z for 2012-03-15 14:00:00 GMT.
  • Local time with a UTC offset: YYYYmmDDhhMMss + or - hhMM (positive or negative offset). For example, for the same time specified as US Pacific time: 201203150600000800.

If not specified, the start time is the time of the request.

boost No Sort-order priorities you can increase or decrease by a decimal value between -1 and 1. To boost the priority of new content by 50%, for example, specify boost=new:0.5. The priorities you can increase and decrease are:
  Factor  Meaning
  • hot
  • new
  • fresh
  • alltime

hot content
recent original release date
new episodes in a TV series
all-time popularity

To boost multiple factors, specify multiple parameters: boost=new:0.5&boost=alltime:0.4. Note:  The sum of the absolute values of all factors must be less than or equal to 1. That is, add all of the absolute values together and make sure the total is less than or equal to 1.

If you are using the available-clu parameter, you can also use the boost parameter to filter out results that are not available on the television service. Specified without a value, like this: boost=availability.

filter No Field content that determines which results are returned. Like a WHERE clause in an SQL statement, this parameter selects only results with fields that meet your criteria. This parameter only filters content with a video endpoint.

Examples:

  • Specify filter=latestairing>20091231 to return only shows broadcast in 2010 or later.
  • Specify filter=ratingid:3|ratingid:4|ratingid:5 to return movies rated G, PG, or PG13.

The selection operators include:

Operator    Meaning
:Is equal to.
!:Is not equal to.
<Is less than.
<:Is less than or equal to.
>Is greater than.
>:Is greater than or equal to.
|Or.

For the And operation, specify another filter parameter like this: filter=releaseyear>:2004&
filter=releaseyear<2009
.

The following shows which fields you can select for each video entity type. If you specify a filter that does not apply to an entity type, no data will be returned for that entity type.

For . . .You can filter on . . .Description
movie
  • availability
Returns only results that are found in availableclu. Specified without a value, like this: filter=availability.
  • latestairing
Filters out content based on the most recent date the program was broadcast (YYYYMMDD).
  • ratingid
Includes only content that has a particular parental rating. See the IDs in the ratings table.
  • releaseyear
Filters content by release year.
tvseries
  • availability
Returns only results that are found in availableclu. Specified without a value, like this: filter=availability.
  • latestairing
Filters out content based on the most recent date the series was broadcast (YYYYMMDD).
  • ratingid
Includes only content that has a particular parental rating. See the IDs in the ratings table.
format No Format of the returned data: json or xml. The default is JSON.

Alternatively you can specify the response format in an HTTP Accept header with either of these Accept field content types:

  • application/xml
  • application/json

If you specify both, the format parameter overrides the Accept header.

include No Additional data to include in each result returned. To include cast members in movie results, for example, specify include=cast. For multiple includes, separate the values with commas like this: include=moods,crew. To include all data, specify include=all.
For endpointEntitytypeYou can include these results . . .
music album
  • All
  • ClassicalReview
  • Credits
  • Images
  • Moods
  • PrimaryReview
  • Releases
  • Similar
  • Styles
  • Themes
  • Tracks
music song
  • All
  • Appearances
  • Review
  • Sample
music artist
  • All
  • Aliases
  • AssociatedWith
  • ClassicalBio
  • CollaboratorWith
  • Compositions
  • Contemporaries
  • Credits*
  • Discography
  • Factsheets*
  • Filmography
  • Followers
  • GroupMembers
  • Images
  • Influencers
  • MemberOf
  • Moods
  • MovieBio
  • MovieStyles
  • MusicBio
  • MusicCredits
  • MusicStyles
  • Similars
  • Songs
  • Themes
  • Videos
  • Web
amgvideo movie
  • All
  • Cast
  • Crew
  • Images
  • Keywords
  • Moods
  • Related
  • Releases
  • Review
  • Similar
  • Synopsis
  • Themes
  • Tones
  • Types
  • Videos
amgvideo tvseries
  • All
  • Cast
  • Crew
  • Images
  • Keywords
  • Moods
  • Related
  • Releases
  • Review
  • Similar
  • Synopsis
  • Themes
  • Tones
  • Types
  • Videos
video ⊑⊒movie
  • All
  • Awards
  • Cast
  • Crew
  • Event
  • Images
  • Keywords
  • Review
  • Synopsis
  • Themes
  • Tones
video ⊑⊒tvseries
  • All
  • Awards
  • Cast
  • Crew
  • Images
  • Keywords
  • Review
  • Seasons
  • Synopsis
  • Themes
  • Tones
video ⊑⊒onetimeonly
  • All
  • Awards
  • Cast
  • Crew
  • Event
  • Images
  • Keywords
  • Review
  • Synopsis
  • Themes
  • Tones
language No Language of the response data. This request supports only en (English).
size No The number of items you want to be returned. The default is 20.

Response

Response Header

ResponseTypeDescription
controlSet ControlSet The HTTP response status.
id string Server transaction ID for the response.

Response for ForYou

ResponseTypeDescription
results result [ ] Information about the items that are similar to the item specified in the request, listed in order of similarity and the priorities specified in the request.

Response Example 1

Here's the top recommendation for a TV series with new episodes airing on DirecTV in Boston, MA, along with three broadcast times.
Requested with: http://api.rovicorp.com/snrpreview/v2.1/video/foryou?apikey=apikey&sig=sig&
userid=100&entitytype=tvseries&available-clu=889011,3&filter=availability&boost=fresh:0.5&
format=json&size=1
.
{
   "forYouResponse":{
      "meta:id":"tul1cpgssrapp2:gwy:7kj6y",
      "controlSet":{
         "status":"ok",
         "code":200,
         "messages":null
      },
      "results":[
         {
            "type":"tvseries",
            "relevance":[
               {
                  "code":"Score",
                  "value":0.99315065
               }
            ],
            "availabilities":[
               {
                  "start":"20140326010100+0000",
                  "cosmosource":11826,
                  "format":"hd",
                  "end":"20140326013100+0000",
                  "source":"CLU_889011",
                  "available_as":{
                     "id":23703221,
                     "type":"CosmoIdProgram"
                  }
               },
               {
                  "start":"20140326010100+0000",
                  "cosmosource":20254,
                  "format":"hd",
                  "end":"20140326013100+0000",
                  "source":"CLU_889011",
                  "available_as":{
                     "id":23703221,
                     "type":"CosmoIdProgram"
                  }
               },
               {
                  "start":"20140326010100+0000",
                  "cosmosource":233,
                  "format":"sd",
                  "end":"20140326013100+0000",
                  "source":"CLU_889011",
                  "available_as":{
                     "id":23703221,
                     "type":"CosmoIdProgram"
                  }
               }
            ],
            "id":22055965,
            "messages":null,
            "video":{
               "ids":{
                  "amgMovieId":null,
                  "cosmoId":"22055965",
                  "iguideId":7059463,
                  "pidPaid":null,
                  "videoId":null
               },
               "seriesIds":null,
               "masterTitle":"About a Boy",
               "secondaryTitle":"",
               "episodeTitle":null,
               "category":"Other",
               "color":"Color",
               "lastAirDate":null,
               "originalAirDate":"2014-02-22T00:00:00.00Z",
               "programType":"Series",
               "releaseYear":2014,
               "duration":30,
               "subcategory":"comedy",
               "syndicated":false,
               "programLanguage":"English",
               "partNumber":null,
               "partTotal":null,
               "parentalRatings":null,
               "parentalRatingsUri":"http://api.rovicorp.com/data/v1.1/video/parentalRatings?format=json&apikey=4p1k3y&cosmoid=22055965",
               "cast":null,
               "castUri":"http://api.rovicorp.com/data/v1.1/video/cast?format=json&apikey=4p1k3y&cosmoid=22055965",
               "crew":null,
               "crewUri":"http://api.rovicorp.com/data/v1.1/video/crew?format=json&apikey=4p1k3y&cosmoid=22055965",
               "awards":null,
               "awardsUri":"",
               "images":null,
               "imagesUri":"http://api.rovicorp.com/data/v1.1/video/images?format=json&apikey=4p1k3y&cosmoid=22055965",
               "clip":null,
               "clipUri":"",
               "seasons":null,
               "seasonsUri":"http://api.rovicorp.com/data/v1.1/video/seasons?format=json&apikey=4p1k3y&cosmoid=22055965",
               "variants":null,
               "variantsUri":"http://api.rovicorp.com/data/v1.1/video/variants?format=json&apikey=4p1k3y&cosmoid=22055965",
               "schedule":"",
               "scheduleUri":"",
               "event":null,
               "eventUri":"",
               "keywords":null,
               "keywordsUri":"http://api.rovicorp.com/data/v1.1/video/keywords?format=json&apikey=4p1k3y&cosmoid=22055965",
               "moods":null,
               "moodsUri":"",
               "related":null,
               "relatedUri":"",
               "review":null,
               "reviewUri":"",
               "synopsis":null,
               "synopsisUri":"http://api.rovicorp.com/data/v1.1/video/synopsis?format=json&apikey=4p1k3y&cosmoid=22055965",
               "themes":null,
               "themesUri":"",
               "tones":null,
               "tonesUri":""
            }
         }
      ]
   }
}

Response Example 2

Here's the top recommendation for a user who is looking for new songs.
Requested with: http://api.rovicorp.com/snrpreview/v2.1/music/foryou?apikey=apikey&sig=sig&
userid=100&entitytype=song&boost=new:0.5&format=json&size=1
.
{
   "forYouResponse":{
      "meta:id":"tul1cpgssrapp2:gwy:311f7",
      "controlSet":{
         "status":"ok",
         "code":200,
         "messages":null
      },
      "results":[
         {
            "type":"song",
            "relevance":[
               {
                  "code":"Score",
                  "value":0.468954
               }
            ],
            "id":"MT0043802990",
            "messages":null,
            "song":{
               "ids":{
                  "amgClassicalTrackId":null,
                  "amgPopTrackId":"T 26027608",
                  "isrcId":null,
                  "muzeId":"35608425",
                  "trackId":"MT0043802990"
               },
               "title":"Cold Crush",
               "primaryArtists":[
                  {
                     "id":"MN0000168619",
                     "name":"Estelle"
                  }
               ],
               "isPick":true,
               "genres":[
                  {
                     "id":"MA0000002809",
                     "name":"R&B",
                     "weight":9
                  }
               ],
               "appearances":null,
               "appearancesUri":"http://api.rovicorp.com/data/v1.1/song/appearances?format=json&apikey=4p1k3y&trackId=MT0043802990",
               "moods":null,
               "moodsUri":"",
               "review":null,
               "reviewUri":"",
               "styles":null,
               "stylesUri":null,
               "themes":null,
               "themesUri":"",
               "sample":null,
               "sampleUri":"http://api.rovicorp.com/data/v1.1/song/sample?format=json&apikey=4p1k3y&trackId=MT0043802990"
            }
         }
      ]
   }
}

Error Codes

CodeDescription
400 Incorrect or invalid request. The reason is shown in the Message object in ControlSet.

See Also

↑ Top

Personal tools