API Methods.3. Genre(s) Methods

API Methods.3.1. genre/byId
API Methods.3.2. genre/byArtist
API Methods.3.3. genre/all

API Methods.3.1. genre/byId

Description

Gets genre by id.

Endpoint

http://api.mp3caprice.com/1.0/genre/byId/{genreId}

Method Parameters

genreId

positive integer value; specifies the genre's id.

Result Structure

Genre or Error

Result sorting order

Single genre structure returned.

Method Example

Example API Methods.13. Get genre by id

http://api.mp3caprice.com/1.0/genre/byId/1.xml?api_key={API Key}&sub_account={sub_account}
                  

<apiResponse>
 <genreId>1</genreId>
 <genreName>Alternative Rock</genreName>
 <releasesCount>1520</releasesCount>
 <genreUrl>
  http://mp3caprice.com/genre/alternative-rock-1?pid=P_00101
 </genreUrl>
</apiResponse>
[Note]

To get genre by id that equals to 1 in json format use url like

http://api.mp3caprice.com/1.0/genre/byId/1.json?api_key={API Key}&sub_account={sub_account}
                  

API Methods.3.2. genre/byArtist

Description

Gets artist's genre.

The result list will be empty when the specified artist is represented only in VA compilations.

Endpoint

http://api.mp3caprice.com/1.0/genre/byArtist/{artistId}

Method Parameters

artistId

positive integer value; specifies the artist's id

Result Structure

Table API Methods.8. Artist genres result structure

Attribute Type Required Details
artistId integer yes Mp3Caprice Artist's id
genres Genres List yes Artist's genres

or Error

Result sorting order

Paginated genre structures ordered by:

  • genre.releasesCount - DESC

Method Example

Example API Methods.14. Get genres for artist with id that equals 1

http://api.mp3caprice.com/1.0/genre/byArtist/1.xml?api_key={API Key}&sub_account={sub_account}
                  

<apiResponse>
 <artistId>1</artistId>
 <genres>
  <genre>
   <genreId>6</genreId>
   <genreName>Hard Rock</genreName>
   <releasesCount>20</releasesCount>
   <genreUrl>
    http://mp3caprice.com/genre/hard-rock-6?pid=P_00101
   </genreUrl>
  </genre>
  ...
 </genres>
</apiResponse>
[Note]

To get genre by id that equals 1in json format use url like

http://api.mp3caprice.com/1.0/genre/byArtist/1.json?api_key={API Key}&sub_account={sub_account}
                  

API Methods.3.3. genre/all

Description

Gets list of genres that are represented by {minReleases} releases..

Endpoint

http://api.mp3caprice.com/1.0/genre/all/{minReleases}

Method Parameters

minReleases

positive integer value; specifies the minimum number of releases a genre needs to be represented by in order to be included in the results list.

Minimum allowed value is 5, maximum – 50.

Result Structure

Table API Methods.9. Genres result structure

Attribute Type Required Details
totalCount integer yes Total number of genres.
minReleases integer yes minReleases request parameter.
genres Genres List yes Genres represented by at least minReleases releases.

or Error

Result sorting order

List of genre structures ordered by:

  • genre.genreName

Method Example

Example API Methods.15. Get all available genres

http://api.mp3caprice.com/1.0/genre/all/5.xml?api_key={API Key}&sub_account={sub_account}
                  

<apiResponse>
 <totalCount>295</totalCount>
 <minReleases>5</minReleases>
 <genres>
  <genre>
   <genreId>764</genreId>
   <genreName>A Cappella</genreName>
   <releasesCount>5</releasesCount>
   <genreUrl>
    http://mp3caprice.com/genre/a-cappella-764?pid=P_00101
   </genreUrl>
  </genre>
  ...
 </genres>
</apiResponse>
[Note]

To get all available genres in json format use url like

http://api.mp3caprice.com/1.0/genre/all/5.json?api_key={API Key}&sub_account={sub_account}