Data/music-api/v1.1/design-your-app

Jump to: navigation, search

Designing Your Music Data Application

You have a vision for your app. Here's what you need to know to make your vision a reality.

Your Home Page

The entry to your Rovi Music app can begin in several ways:
  1. A presentation of featured content, such as:
    • Content from your catalog of music. You can get Rovi IDs for your catalog with Rovi Catalog Matching.
    • Top songs in a genre or subgenre as described below.
    • Top albums in a genre or subgenre as described below.
    • Top artists in a genre or subgenre as described below.
    • Top compositions in a classical music genre or subgenre as described below.
  2. Offer a text search for a song, album, composition, or person working in music:
  3. Offer a list of a field-level characteristics that apply to songs, albums, compositions, or people working in music:
  4. Present featured content. For examples, see the Presenting Featured Content section below.
    • An album, song, performance, composition, or artist.
    • Music and artists around the following:
      • A music genre such as jazz, pop/rock, or classical.
      • A music subgenre or style such as piano blues, slide-guitar blues, or contemporary blues.
      • A music mood that suits the times or audience such as erotic, celebratory, or mystical.
      • A music theme that suits the times or audience such as winter, Monday morning, or at the office.
    • Include regions on your page for eras, staff picks, editors' choices, most visited, new releases, featured new releases, etc.
From selections made from your home page, build out your pages by using IDs in responses to offer links to other pages as shown in the next section.

Roadmap to Rovi Music IDs

In the data returned by most API responses will be IDs for names, albums, tracks, etc.—IDs you can use in API requests for additional or related information. Here's a roadmap to building additional pages by using the Rovi IDs returned in responses to offer links to pages that feature a song, artist, album, release, composition, or performance:


Many API responses will also include IDs for moods, genres, subgenres, and styles that you can use to ask for further information in a Rovi Search or Recommendations request.

The Top-Level Requests: The Info Requests

The Music Service and Name Service provide six top-level requests:
  • Name/Info
  • Song/Info
  • Album/Info
  • Release/Info
  • Composition/Info
  • Performance/Info
These Info requests return core information plus preformatted requests for available subsidiary information. And these Info requests can also return subsidiary information in the response. Here are some design considerations when using the Info requests:
  1. An Info response tells you what subsidiary data is available: if a review or biography is not available, for example, the response will not include the preformatted request for the review or biography. This feature allows your application the following program control options when parsing an Info response:
    • Grab an available request and offer the data as a link.
    • Grab an available request, execute it, and present the data.
    • If a request is unavailable, execute an alternative request.
  2. You don't have to make separate requests for subsidiary information. An Info response can include subsidiary information in the response. You can, for example, include a review in an Info response by specifying that as part of the Info request. Use this feature in the following cases:
    • To build a page around data and subsidiary data you already know is available.
    • To present whatever data is available using appropriate program controls. Note: some subsidiary requests return huge amounts of data. For these requests, it's better to make a separate call so you can specify parameters that paginate the response data.
A Sample Info Response
Here's a response to a composition/info request. Note the three subsidiary requests returned at the end of the response.
{
   "status":"ok",
   "code":200,
   "messages":null,
   "build":"Build-Unknown-Label",
   "parameters":{
      "apiKey":"4p1k3y",
      "id":"MC0002396628",
      "format":"json"
   },
   "serverName":"tul1cssw1",
   "startTime":"2012-06-11T18:37:40.9392860Z",
   "endTime":"2012-06-11T18:37:40.9861586Z",
   "duration":46,
   "composition":{
      "ids":{
         "amgClassicalId":"C 157374",
         "compositionId":"MC0002396628"
      },
      "title":"Symphony No. 3 in E flat major (\"Eroica\"), Op. 55",
      "composers":[
         {
            "id":"MN0000536126",
            "name":"Ludwig van Beethoven"
         }
      ],
      "avarageDuration":2993,
      "compositionDate":"1803-??-??",
      "publicationDate":"",
      "revisionDate":"",
      "firstPerformanceDate":"",
      "rating":5,
      "alternateTitle":"Eroica",
      "genres":[
         {
            "id":"MA0000012291",
            "name":"Symphony",
            "weight":10
         },
         {
            "id":"MA0000002521",
            "name":"Classical",
            "weight":9
         }
      ],
      "periods":[
         {
            "id":"MA0000001731",
            "name":"Classical"
         },
         {
            "id":"MA0000001734",
            "name":"Romantic"
         }
      ],
      "forms":[
         {
            "id":"MA0000001706",
            "name":"Symphony"
         }
      ],
      "description":null,
      "descriptionUri":"http:\/\/api.rovicorp.com\/v1.1\/composition\/description?format=json&apikey=4p1k3y&compositionid=MC0002396628",
      "parts":null,
      "partsUri":"http:\/\/api.rovicorp.com\/v1.1\/composition\/parts?format=json&apikey=4p1k3y&compositionid=MC0002396628",
      "releases":null,
      "releasesUri":"http:\/\/api.rovicorp.com\/v1.1\/composition\/releases?format=json&apikey=4p1k3y&compositionid=MC0002396628"
   }
}
A Sample Info Response That Includes Information From a Subsidiary Request
Here's the response to the same composition/info request as above, but one which includes the information from the partsUri subsidiary composition request. With the Music API, you have the flexibility to get a group of related information with an Info request or to get just the subsidiary information in a subsidiary request.
{
   "status":"ok",
   "code":200,
   "messages":null,
   "build":"Build-Unknown-Label",
   "parameters":{
      "apiKey":"4p1k3y",
      "id":"MC0002396628",
      "include":"parts",
      "format":"json"
   },
   "serverName":"tul1cssw3",
   "startTime":"2012-06-11T18:46:44.7060719Z",
   "endTime":"2012-06-11T18:46:44.7529454Z",
   "duration":46,
   "composition":{
      "ids":{
         "amgClassicalId":"C 157374",
         "compositionId":"MC0002396628"
      },
      "title":"Symphony No. 3 in E flat major (\"Eroica\"), Op. 55",
      "composers":[
         {
            "id":"MN0000536126",
            "name":"Ludwig van Beethoven"
         }
      ],
      "avarageDuration":2993,
      "compositionDate":"1803-??-??",
      "publicationDate":"",
      "revisionDate":"",
      "firstPerformanceDate":"",
      "rating":5,
      "alternateTitle":"Eroica",
      "genres":[
         {
            "id":"MA0000012291",
            "name":"Symphony",
            "weight":10
         },
         {
            "id":"MA0000002521",
            "name":"Classical",
            "weight":9
         }
      ],
      "periods":[
         {
            "id":"MA0000001731",
            "name":"Classical"
         },
         {
            "id":"MA0000001734",
            "name":"Romantic"
         }
      ],
      "forms":[
         {
            "id":"MA0000001706",
            "name":"Symphony"
         }
      ],
      "description":null,
      "descriptionUri":"http:\/\/api.rovicorp.com\/v1.1\/composition\/description?format=json&apikey=4p1k3y&compositionid=MC0002396628",
      "parts":[
         "Allegro con brio",
         "Marcia funebre. Adagio assai",
         "Scherzo. Allegro vivace",
         "Finale. Allegro molto"
      ],
      "partsUri":"http:\/\/api.rovicorp.com\/v1.1\/composition\/parts?format=json&apikey=4p1k3y&compositionid=MC0002396628",
      "releases":null,
      "releasesUri":"http:\/\/api.rovicorp.com\/v1.1\/composition\/releases?format=json&apikey=4p1k3y&compositionid=MC0002396628"
   }
}

Page Control: Offset and Count

Some requests return enormous amounts of information. Name/Discography, a subsidiary request, returns over 400 albums for the Beatles.
To control the amount of data you receive in a response, subsidiary requests offer the parameters offset and count if the requests return lists of data. These parameters set the starting point and number of items to return. Use these parameters in combination with page forward and page reverse controls.

Presenting Featured Content

Let's start with that vision of yours. Here are some ideas for creating compelling content on any page, including a home page:

Feature an Album

  1. Grab the ID from a response that returns album IDs:
  2. Call Album/Info with the include parameter values that return the data you want to present:
  1. From the response, grab and use the data you want.
    • Consider presenting a list of similar albums with a call to Similar.
  2. Use the IDs in responses to build your pages out, adding links to other pages as shown above in Roadmap to Rovi Music IDs.

Feature a Song

  1. Grab the ID of the song from a response that returns track IDs:
  2. Call Song/Info with the include parameter values that return the data you want to present:
  3. From the response, grab and use the data you want:
    • Consider presenting a list of similar similar songs with a call to Similar.
  4. Use the IDs in responses to build your pages out, adding links to other pages as shown above in Roadmap to Rovi Music IDs.

Feature an Artist

  1. Grab the ID from a response that returns name IDs:
  1. Call Name/Info with the include parameter values that return the data you want to present. Note: these values may return large amounts of data. To control the amount of data returned, make separate requests instead and use the offset and count parameters to paginate the response.
  1. From the response, grab and use the data you want.
    • Use the IDs in responses to build your pages out, adding links to other pages as shown above in Roadmap to Rovi Music IDs.

    Feature a Composition

    1. Grab the ID from a response that returns composition IDs:
    2. Call Composition/Info with the include parameter values that return the data you want to present:
    3. From the response, grab and use the data you want.
    4. Consider recommending similar composers with a call to Similar.
    5. Use the IDs in responses to build your pages out, adding links to other pages as shown above in Roadmap to Rovi Music IDs.

    Feature a Classical Music Performance

    1. Grab the ID from a response that returns performance IDs:
    2. Call Performance/Info with the include parameter values that return the data you want to present:
    3. From the response, grab and use the data you want.
      • Consider presenting other albums featuring a performer, with a link to FilterBrowse.
      • Consider offering information about the composition and composer, with links to Composition/Info and Name/Info.
    4. Use the IDs in responses to build your pages out, adding links to other pages as shown above in Roadmap to Rovi Music IDs.

    Feature Artists by Era in a Musical Style, Genre, or Subgenre

    Example: Feature 90s artists by genre, along with their three most recent albums.
    1. Blues.png
      Get the ID of the style, genre, or subgenre you want to feature.
      • Grab a genre ID from an Info response or an ID from a Styles response.
      • Or get a list of all IDs by calling Descriptor/MusicGenres.
    2. Call FilterBrowse with the following parameters:
      • filter=decade:1990s
      • filter=genreid for each genre. For example: filter=genreid:MA0000002613|genreid:MA0000002572. Note: You can filter on a style or subgenre instead with filter=subgenreid.
      • include=discography to return the list of albums. Consider including other requests for the data you want to present about each artist, such as include=images to get URLs to images of the artists.
    3. From the response, grab and use the data you want:
      • Consider using data about artists, such as headlines from the headlineBio element.
      • With artist name IDs, add a Name/Info link to each artist that will drive your customer to a page about the artist.
      • Grab the data you want about the first three albums in the discography element.
    4. With the album IDs in the discography element, call Album/Images to return images about each album.
    5. Use the IDs in responses to build your pages out, adding links to other pages as shown above in Roadmap to Rovi Music IDs.

    Feature Recent Albums in a Musical Style, Genre, or Subgenre

    1. Get the ID of the style, genre, or subgenre you want to feature.
      • Grab a genre ID from an Info response or an ID from a Styles response.
      • Or get a list of all IDs by calling Descriptor/MusicGenres.
    2. Get a description of the genre, subgenre, or style that you can feature on the page:
    3. Call FilterBrowse with the following parameters:
      • filter=genreid with genre ID or filter=subgenreid with a subgenre ID. For example: filter=genreid:MA0000002613.
      • filter=releasedate with start and end dates.
      • filter=editorialrating if you also want to filter albums by editorial rating.
      • include= for the data you want to present about each album. For example, include=images to get URLs to album cover images.
    4. From the response, grab album IDs and add an Album/Info link to each album that will drive your customer to a page about the album.
    5. Use the IDs in responses to build your pages out, adding links to other pages as shown above in Roadmap to Rovi Music IDs.

    Feature Top Songs in a Musical Style, Genre, or Subgenre

    1. Get the ID of the style, genre, or subgenre you want to feature.
      • Grab a genre ID from an Info response or an ID from a Styles response.
      • Or get a list of all IDs by calling Descriptor/MusicGenres.
    2. Get a description of the genre, subgenre, or style that you can feature on the page:
    3. Call Descriptor/SignificantSongs with the ID.
    4. From the response, grab and use the data you want:
      • Grab the link to the album cover image you want.
      • With the artist name ID, add a Name/Info link that will drive your customer to a page about the artist.
      • With the album ID, add a Album/Info link that will drive your customer to a page about the album.
      • With the song ID, add a Song/Info link that will drive your customer to a page about the song and a song sample. Or make the call and add the data to this page.
    5. Use the IDs in responses to build your pages out, adding links to other pages as shown above in Roadmap to Rovi Music IDs.

    Feature Top Compositions in a Classical Music Genre or Subgenre

    1. Select the ID of the subgenre from the page Descriptor/SignificantCompositions.
    2. Get a description of the genre or subgenre with Descriptor/Subgenres.
    3. Call Descriptor/SignificantCompositions with the ID.
    4. From the response, grab and use the data you want. For example, with the composition ID, add a Composition/Info link that will drive your customer to a page about the composition.
    5. Use the IDs in responses to build your pages out, adding links to other pages as shown above in Roadmap to Rovi Music IDs.

    Feature Top Albums in a Musical Style, Genre, or Subgenre

    1. Get the ID of the style, genre, or subgenre you want to feature.
      • Grab a genre ID from an Info response or an ID from a Styles response.
      • Or get a list of all IDs by calling Descriptor/MusicGenres.
    2. Get a description of the genre, subgenre, or style:
    3. Call Descriptor/SignificantAlbums with the ID.
    4. From the response, grab and use the data you want:
      • Grab the link to the album cover image.
      • With the artist name ID, add a Name/Info link that will drive your customer to a page about the artist.
      • With the album ID, add a Album/Info link that will drive your customer to a page about the album.
    5. Use the IDs in responses to build your pages out, adding links to other pages as shown above in Roadmap to Rovi Music IDs.

    Feature Top Artists in a Musical Style, Genre, or Subgenre

    1. Get the ID of the style, genre, or subgenre you want to feature.
      • Grab a genre ID from an Info response or an ID from a Styles response.
      • Or get a list of all IDs by calling Descriptor/MusicGenres.
    2. Get a description of the genre, subgenre, or style:
    3. Call Descriptor/SignificantArtists with the ID.
    4. From the response, grab and use the data you want:
      • Grab the link to the image of the artist.
      • With the name ID of the artist, add a Name/Info link that will drive your customer to a page about the artist.
      • Consider including select information about the artist with one of these calls:
    5. Use the IDs in responses to build your pages out, adding links to other pages as shown above in Roadmap to Rovi Music IDs.

    Feature Top Composers in a Classical Music Subgenre

    1. Select the ID of the subgenre from the page Descriptor/SignificantComposers.
    2. Get a description of the subgenre with Descriptor/Subgenres.
    3. Call Descriptor/SignificantComposers with the ID.
    4. From the response, grab and use the data you want:
      • Grab the link to the image of the composer.
      • With the name ID, add a Name/Info link that will drive your customer to a page about the composer.
      • Consider listing compositions by calling Name/Compositions.
    5. Use the IDs in responses to build your pages out, adding links to other pages as shown above in Roadmap to Rovi Music IDs.


    Presenting a Search Box

    Should the user enter the full search query before hitting Enter?
    • If yes, call Search when the user hits Enter. Consider calling Autocomplete to return search text as the user types.
    • If no, call SingleStageSearch to return results as the user types.
    • Consider allowing the user to select the entitytype they are searching for—song, artist, album, or composition.
    • Present a page based on the user's selection.
    • Use the IDs in responses to build your pages out, adding links to other pages as shown above in Roadmap to Rovi Music IDs.

    ↑ Top

     
    Personal tools