V1.MetaData.MusicService.Descriptor:MusicGenres

Jump to: navigation, search

Descriptor/MusicGenres

Returns the music genres, subgenres, and styles recognized by Rovi Music.

Syntax

descriptor/musicgenres?apikey=apikey&sig=sig [&include=include] [&format=format] [&country=country] [&language=language]

Request Example 1

Request music genres.

Request Example 2

Request music genres with subgenres.

Request Example 3

Request music genres with subgenres and styles.

Request Parameters

Sort none.gif  Click to re-sort

Parameter Required Description
apikey Yes Access code that authorizes your request for data from Rovi.
sig Yes A calculated authorization code. To perform the calculation, execute the MD5 function on the concatenation of the following three 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.

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.

country No Country of the language of the response. The current release of the API supports only US.
format No Format of the returned data: json or xml. The default is JSON.
include No Additional information you want to be included about each genre. The possible values are:
  • all
Includes the subgenres and music styles of the returned genres.
  • subgenres
Includes the subgenres of the returned genres.
For example, to include subgenres in the response, add include=subgenres.
language No Language of the response data. This request supports only en (English).

Response

Response Header

ResponseTypeDescription
buildStringThe software release level of the API.
codeIntegerHTTP status code. See the status field for the text part of the code.
durationIntegerServer processing time in milliseconds. The difference between startTime and endTime.
endTimeStringWhen the server sent the response (UTC time).
messagesMessage [ ]Elements of a multiple HTTP response status message.
parametersparametersList of the parameters included in the request.
serverNameStringName of the server that processed the request.
startTimeStringWhen the server received the request (UTC time).
statusStringText part of the HTTP status code that is shown in the code field.
viewviewSummary of items returned in a list of items.

Response for Descriptor/MusicGenres

ResponseTypeDescription
genres Genre [ ] Genres and, if requested, the subgenres and styles.

Response Example 1

Here's the first two genres from Request Example 1. The response has been edited to reduce the length and formatted to make it easy to read.
{
  "status":"ok",
  "code":200,
  "messages":null,
  "build":"1.5.1.9",
  "parameters":{
    "apiKey":"apikey",
    "id":null
  },
  "view":{
    "total":21
  },
  "serverName":"tul1cssw2",
  "startTime":"2011-04-28T23:18:09.9533342Z",
  "endTime":"2011-04-28T23:18:09.9689593Z",
  "duration":15,
  "genres":[
    {
      "id":"MA0000012170",
      "name":"Avant-Garde",
      "type":"Music Genre"
    },
    {
      "id":"MA0000002467",
      "name":"Blues",
      "type":"Music Genre"
    }
  ]
}

Response Example 2

Here's the first genre and first two subgenres from Request Example 2. The response has been edited to reduce the length and formatted to make it easy to read.
{
   "status":"ok",
   "code":200,
   "messages":null,
   "build":"1.7.2.5",
   "parameters":{
      "apiKey":"4p1k3y",
      "id":null,
      "include":"subgenres"
   },
   "view":{
      "total":21
   },
   "serverName":"tul1cssw4",
   "startTime":"2011-10-07T02:03:32.1015551Z",
   "endTime":"2011-10-07T02:03:32.1015551Z",
   "duration":0,
   "genres":[
      {
         "id":"MA0000012170",
         "name":"Avant-Garde",
         "type":"Music Genre",
         "subgenres":[
            {
               "id":"MA0000012238",
               "name":"Computer Music",
               "type":"Music SubGenre"
            },
            {
               "id":"MA0000011891",
               "name":"Conceptual Art",
               "type":"Music SubGenre"
            }
         ]
      }
   ]
}

XML Response Example

Here's part of a response to Request Example 3. It has been edited to reduce the length.
<MusicGenres xmlns="com.rovicorp.metadataservice" xmlns:i="http://www.w3.org/2001/XMLSchema-instance">
  <status>ok</status>
  <code>200</code>
  <messages i:nil="true"/>
  <build>1.7.2.5</build>
  <parameters>
    <apiKey>4p1k3y</apiKey>
    <id i:nil="true"/>
    <include>all</include>
    <format>xml</format>
  </parameters>
  <view>
    <total>21</total>
  </view>
  <serverName>tul1cssw4</serverName>
  <startTime>2011-10-07T02:24:06.0624077Z</startTime>
  <endTime>2011-10-07T02:24:06.0624077Z</endTime>
  <duration>0</duration>
  <genres>
    <Genre>
      <id>MA0000002532</id>
      <name>Country</name>
      <type>Music Genre</type>
      <subgenres>
        <subgenre>
          <id>MA0000004415</id>
          <name>Americana</name>
          <type>Music SubGenre</type>
        </subgenre>
        <subgenre>
          <id>MA0000002443</id>
          <name>Bakersfield Sound</name>
          <type>Music SubGenre</type>
        </subgenre>
        <subgenre>
          <id>MA0000002466</id>
          <name>Bluegrass</name>
          <type>Music SubGenre</type>
          <styles>
            <style>
              <id>MA0000011818</id>
              <name>Contemporary Bluegrass</name>
              <type>Music Style</type>
            </style>
            <style>
              <id>MA0000012360</id>
              <name>Progressive Bluegrass</name>
              <type>Music Style</type>
            </style>
            <style>
              <id>MA0000011963</id>
              <name>Traditional Bluegrass</name>
              <type>Music Style</type>
            </style>
          </styles>
        </subgenre>
        <subgenre>
          <id>MA0000012138</id>
          <name>Close Harmony</name>
          <type>Music SubGenre</type>
        </subgenre>
      </subgenres>
    </Genre>
  </genres>
</MusicGenres>


See Also

↑ Top

Personal tools