Search-api/v2.1/sort

Jump to: navigation, search

Sort

Sorts up to 20 names, songs, albums, movies, or TV shows by priorities such as newness, current popularity, and all-time popularity, and makes available extensive amounts of data for each result.

This request returns a large amount of data, especially if you use the include parameter to return additional data. To speed data transmission, do the following:

  • Request only data that you need to immediately display.
  • Request a compressed response by including Accept-Encoding: gzip,deflate in the HTTP header.

Syntax

endpoint/sort? nameid=nameid
trackid=trackid
albumid=albumid
amgvideoid=amgvideoid
cosmoprogramid=cosmoprogramid
&apikey=apikey&sig=sig&sort=sort [&include=include] [&country=country] [&language=language] [&format=format]

Request Example 1

Sort a list of singers from most-to-least hot.

Request Example 2

Sort a list of love songs by all-time popularity from most-to-least popular.

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 ⊑⊒
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.

sort Yes Priority to sort on, in ascending or descending order.

Examples:

  • Specify name,asc to sort alphabetically by title.
  • Specify releaseyear,asc to sort movies in order of release year.
  • Specify alltime,desc to sort by all-time popularity from most-to-least popular.

The priorities you can sort on are:

  Priority    For ID . . .    Sorts on . . .
hotAllCurrent popularity.
newAllOriginal release date.
nameAllTitle or name (first name then last name) alphabetical.
alltimeAllAll-time popularity.
freshcosmoprogramidFor TV series, most recent new episode release date.
releaseyearcosmoprogramidRelease year (for movies and TV shows).
albumid Conditional Rovi Music ID for an album, consisting of the prefix MW followed by a ten-digit number, specified like this: albumid=MW0000056882. Requires an endpoint of music.

You can grab album IDs from responses to the following requests:

Condition: The request must specify from 1 to 20 values for just one of these parameters:

  • nameid
  • albumid
  • trackid
  • amgvideoid
  • cosmoprogramid
amgvideoid Conditional All Media Guide (AMG) database ID for a movie or TV series, consisting of a ten-character string that starts with V and is followed by 9 digits with leading spaces, specified like this: amgvideoid=V+++295550. Requires an endpoint of amgvideo.

Your application can grab amgvideo IDs from responses to the following requests:

Condition: The request must specify from 1 to 20 values for just one of these parameters:

  • nameid
  • albumid
  • trackid
  • amgvideoid
  • cosmoprogramid
cosmoprogramid Conditional Cosmo database ID for a movie or television program, specified like this: cosmoprogramid=3899277. Requires an endpoint of video. Cosmo is a database of television information.

Your application can grab Cosmo IDs from responses to the following requests:

Condition: The request must specify from 1 to 20 values for just one of these parameters:

  • nameid
  • albumid
  • trackid
  • amgvideoid
  • cosmoprogramid
nameid Conditional Rovi Name ID for a person or group, consisting of the prefix MN followed by a ten-digit number, specified like this: nameid=MN0000114342. Requires an endpoint of music.

Your application can grab name IDs from responses to Search and from Info, Credits, Tracks, and Recommendations requests. For a complete list of requests that return name IDs, click here.

Condition: The request must specify from 1 to 20 values for just one of these parameters:

  • nameid
  • albumid
  • trackid
  • amgvideoid
  • cosmoprogramid
trackid Conditional Rovi Music ID for a song, consisting of the prefix MT followed by a ten-digit number, specified like this: trackid=MT0009472348. Requires an endpoint of music.

Your application can grab track IDs from responses to the following requests:

Condition: The request must specify from 1 to 20 values for just one of these parameters:

  • nameid
  • albumid
  • trackid
  • amgvideoid
  • cosmoprogramid
country No Country the language parameter applies to. The current release of the API supports only US.
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 endpointAnd This IDYou can include these results . . .
music albumid
  • All
  • ClassicalReview
  • Credits
  • Images
  • Moods
  • PrimaryReview
  • Releases
  • Similar
  • Styles
  • Themes
  • Tracks
music trackid
  • All
  • Appearances
  • Moods
  • Review
  • Styles
  • Themes
music nameid
  • 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 amgvideoid
  • All
  • Cast
  • Crew
  • Images
  • Keywords
  • Moods
  • Related
  • Releases
  • Review
  • Similar
  • Synopsis
  • Themes
  • Tones
  • Types
  • Videos
video ⊑⊒cosmoprogramid
  • All
  • Awards
  • Cast
  • Crew
  • Event
  • Images
  • Keywords
  • Review
  • Synopsis
  • Themes
  • Tones
language No Language of the response data. This request supports only en (English).

Response

Response Header

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

Response for Sort

ResponseTypeDescription
results result [ ] Information about the items specified in the request, listed in order of the specified priority.

JSON Response Example

Here's the top response to Request Example 1, sorting a list of singers from most-to-least hot right now.
Requested with http://api.rovicorp.com/search/v2.1/music/sort?apikey=apikey&sig=sig&
nameid=MN0000761179&nameid=MN0000367188&nameid=MN0000820434&nameid=MN0000855531&
nameid=MN0000376204&nameid=MN0000594665&nameid=MN0000409968&sort=hot,desc
.
{
   "sortResponse":{
      "meta:id":"tul1cpgpsrapp17:gwy:3oyson",
      "controlSet":{
         "status":"ok",
         "code":200,
         "messages":null
      },
      "results":[
         {
            "type":"artist",
            "relevance":[
               {
                  "code":"Score",
                  "value":1
               }
            ],
            "id":"MN0000367188",
            "messages":null,
            "name":{
               "ids":{
                  "amgClassicalId":"Q 487440",
                  "amgMovieId":"P475340",
                  "amgPopId":"P 704560",
                  "cosmoId":"102350",
                  "nameId":"MN0000367188"
               },
               "name":"Rihanna",
               "isGroup":false,
               "primaryMedia":"Music\\Popular",
               "musicGenres":[
                  {
                     "id":"MA0000002613",
                     "name":"Pop/Rock",
                     "weight":9
                  },
                  {
                     "id":"MA0000002809",
                     "name":"R&B",
                     "weight":7
                  }
               ],
               "movieGenres":[
                  {
                     "id":"D 648",
                     "name":"Comedy",
                     "weight":99
                  },
                  {
                     "id":"D 1776",
                     "name":"Music [nf]",
                     "weight":99
                  }
               ],
               "active":[
                  "2000s",
                  "2010s"
               ],
               "birth":{
                  "date":"1988-02-20",
                  "place":"Saint Michael, Barbados"
               },
               "death":{
                  "date":"",
                  "place":""
               },
               "country":"Barbados",
               "period":"2006-2014",
               "headlineBio":"R&B and dance-pop singer whose stark, sexualized hit singles established her as one of the biggest pop stars in music history.",
               "classicalBio":null,
               "classicalBioUri":null,
               "discography":null,
               "discographyUri":"http://api.rovicorp.com/data/v1.1/name/discography?format=json&apikey=4p1k3y&nameid=MN0000367188",
               "filmography":null,
               "filmographyUri":"http://api.rovicorp.com/data/v1.1/name/filmography?format=json&apikey=4p1k3y&nameid=MN0000367188",
               "followers":null,
               "followersUri":"http://api.rovicorp.com/data/v1.1/name/followers?format=json&apikey=4p1k3y&nameid=MN0000367188",
               "groupMembers":null,
               "groupMembersUri":null,
               "memberOf":null,
               "memberOfUri":null,
               "images":null,
               "imagesUri":"http://api.rovicorp.com/data/v1.1/name/images?format=json&apikey=4p1k3y&nameid=MN0000367188",
               "influencers":null,
               "influencersUri":"http://api.rovicorp.com/data/v1.1/name/influencers?format=json&apikey=4p1k3y&nameid=MN0000367188",
               "similars":null,
               "similarsUri":"http://api.rovicorp.com/data/v1.1/name/similars?format=json&apikey=4p1k3y&nameid=MN0000367188",
               "moods":null,
               "moodsUri":"http://api.rovicorp.com/data/v1.1/name/moods?format=json&apikey=4p1k3y&nameid=MN0000367188",
               "movieBio":null,
               "movieBioUri":"http://api.rovicorp.com/data/v1.1/name/movieBio?format=json&apikey=4p1k3y&nameid=MN0000367188",
               "musicBio":null,
               "musicBioUri":"http://api.rovicorp.com/data/v1.1/name/musicBio?format=json&apikey=4p1k3y&nameid=MN0000367188",
               "musicCredits":null,
               "musicCreditsUri":"http://api.rovicorp.com/data/v1.1/name/musicCredits?format=json&apikey=4p1k3y&nameid=MN0000367188",
               "songs":null,
               "songsUri":"http://api.rovicorp.com/data/v1.1/name/songs?format=json&apikey=4p1k3y&nameid=MN0000367188",
               "musicStyles":null,
               "musicStylesUri":"http://api.rovicorp.com/data/v1.1/name/musicStyles?format=json&apikey=4p1k3y&nameid=MN0000367188",
               "themes":null,
               "themesUri":"http://api.rovicorp.com/data/v1.1/name/themes?format=json&apikey=4p1k3y&nameid=MN0000367188",
               "videos":null,
               "videosUri":null,
               "movieStyles":null,
               "movieStylesUri":"http://api.rovicorp.com/data/v1.1/name/movieStyles?format=json&apikey=4p1k3y&nameid=MN0000367188",
               "contemporaries":null,
               "contemporariesUri":null,
               "associatedWith":null,
               "associatedWithUri":"http://api.rovicorp.com/data/v1.1/name/associatedWith?format=json&apikey=4p1k3y&nameid=MN0000367188",
               "collaboratorWith":null,
               "collaboratorWithUri":null,
               "compositions":null,
               "compositionsUri":null,
               "aliases":null,
               "aliasesUri":"http://api.rovicorp.com/data/v1.1/name/aliases?format=json&apikey=4p1k3y&nameid=MN0000367188",
               "web":null,
               "webUri":"http://api.rovicorp.com/data/v1.1/name/web?format=json&apikey=4p1k3y&nameid=MN0000367188",
               "factsheets":null,
               "factsheetsUri":"http://api.rovicorp.com/data/v1.1/name/factsheets?format=json&apikey=4p1k3y&nameid=MN0000367188",
               "schedule":null,
               "scheduleUri":null,
               "credits":null,
               "creditsUri":"http://api.rovicorp.com/data/v1.1/name/credits?format=json&apikey=4p1k3y&nameid=MN0000367188"
            }
         }
      ]
   }
}

Error Codes

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

See Also

↑ Top

Personal tools