Data/music-api/v1.1/song/sample

Jump to: navigation, search

Song/Sample

Returns a URL to an audio sample of a song. Song samples are 30-second MP3 clips encoded in stereo at 96 kbit/s. File size is approximately 357 kB.

Note: Access to music samples through the API is governed by your subscription level.

Syntax

song/sample? track=track
isrcid=isrcid
muzeid=muzeid
trackid=trackid
amgpoptrackid=amgpoptrackid
amgclassicaltrackid=amgclassicaltrackid
&apikey=apikey&sig=sig [&format=format] [&country=country] [&language=language]

Request Example 1

Request a sample of Beat It.

Request Example 2

Request an XML format response.

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, 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.

amgclassicaltrackid Conditional All Media Guide (AMG) ID for a track on a classical music album, consisting of a ten-character string that starts with Y and is followed by 9 digits with leading spaces. AMG is a legacy database of entertainment information. When using an AMG Classical ID in a request, replace any spaces in the ID with plus (+) or percent20 (%20) symbols.

Condition: The request must contain just one of these arguments:

  • track
  • isrcid
  • muzeid    
  • trackid
  • amgpoptrackid
  • amgclassicaltrackid
amgpoptrackid Conditional All Media Guide (AMG) ID for a track on a popular music album, consisting of a ten-character string that starts with T and is followed by 9 digits with leading spaces. AMG is a legacy database of entertainment information. When using an AMG Pop ID in a request, replace any spaces in the ID with plus (+) or percent20 (%20) symbols.

Condition: The request must contain just one of these arguments:

  • track
  • isrcid
  • muzeid    
  • trackid
  • amgpoptrackid
  • amgclassicaltrackid
isrcid Conditional International Standard Recording Code (ISRC) for a song recording. Note: Because some recordings have the same ISRC code as another recording or have multiple ISRC codes, you need to verify results of requests that use ISRC codes that come from outside of Rovi Cloud Services. The song you want may be available under a different ISRC code.

Condition: The request must contain just one of these arguments:

  • track
  • isrcid
  • muzeid    
  • trackid
  • amgpoptrackid
  • amgclassicaltrackid
muzeid Conditional Legacy ID from the Muze database.

Condition: The request must contain just one of these arguments:

  • track
  • isrcid
  • muzeid    
  • trackid
  • amgpoptrackid
  • amgclassicaltrackid
track Conditional Keywords from the song title. This searches for the most popular title with that combination of words. Replace spaces with plus (+) or percent20 (%20) symbols.

Condition: The request must contain just one of these arguments:

  • track
  • isrcid
  • muzeid    
  • trackid
  • amgpoptrackid
  • amgclassicaltrackid
trackid Conditional Rovi Music ID for a popular song, consisting of the prefix MT followed by a ten-digit number. For example: MT0009472348. Your application can grab track IDs from responses to the following requests:

Condition: The request must contain just one of these arguments:

  • track
  • isrcid
  • muzeid    
  • trackid
  • amgpoptrackid
  • amgclassicaltrackid
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.
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.
parametersparametersThe parameters that were included in the request.
parentIdsparentIdsAll of the IDs for the requested object that are recognized by the API.
serverNamestringName of the server that processed the request.
startTimestringWhen the server received the request (UTC time).
statusstringText part of the HTTP status code, which is shown in the code field.

Response for Song/Sample

ResponseTypeDescription
sample string URL to an audio sample of the song specified in the request.

Note: Access to music samples through the API is governed by your subscription level.

JSON Response Example

Here's the response to Request Example 1, which asks for a sample of the song Beat It. The response is formatted with extra spaces and carriage returns to make it easy to read.
Requested with http://api.rovicorp.com/data/v1.1/song/sample?apikey=apikey&sig=sig&trackid=MT0011378361.
{
  "status":"ok",
  "code":200,
  "messages":null,
  "build":"1.5.1.9",
  "parameters":{
    "apiKey":"apikey",
    "id":"MT0011378361"
  },
  "serverName":"tul1cssw1",
  "startTime":"2011-04-28T17:43:21.7679045Z",
  "endTime":"2011-04-28T17:43:21.7679045Z",
  "duration":0,
  "parentIds":{
    "amgPopTrackId":"T  4243363",
    "isrcId":"GBAMC8400011",
    "trackId":"MT0011378361"
  },
  "sample":"http:\/\/rovimusic.rovicorp.com\/actual-url-concealed.mp3"
}

XML Response Example

Here's the response to Request Example 2, which asks for an XML response with a sample of the song Beat It.
Requested with http://api.rovicorp.com/data/v1.1/song/sample?apikey=apikey&sig=sig&
trackid=MT0011378361&format=xml
.
<SongSample 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.5.1.9</build>
  <parameters>
    <apiKey>apikey</apiKey>
    <id>MT0011378361</id>
    <format>xml</format>
  </parameters>
  <serverName>tul1cssw2</serverName>
  <startTime>2011-04-28T17:43:05.0997039Z</startTime>
  <endTime>2011-04-28T17:43:05.0997039Z</endTime>
  <duration>0</duration>
  <parentIds>
    <amgPopTrackId>T 4243363</amgPopTrackId>
    <isrcId>GBAMC8400011</isrcId>
    <trackId>MT0011378361</trackId>
  </parentIds>
  <sample>http://rovimusic.rovicorp.com/actual-url-concealed.mp3</sample>
</SongSample>


See Also

↑ Top

Personal tools