API Methods.6. search

[Warning]

This method is DEPRECATED! Please use Search Methods instead!

Description

Gets list of artists, releases or songs by search criterea.

Executes relevant search of artists, releases, or songs on mp3caprice site.

Endpoint

http://api.mp3caprice.com/1.0/search/{searchType}/{maxResults}/{searchString}

Method Parameters

searchType

enumerated value; specifies type of search. Possible values are:

  • artists - search by artists.

  • releases – search by releases

  • songs – search by tracks

  • total – search by any of the above or their combinations

maxResults

integer value; specifies the maximum number of results to be returned. Maximum allowed value is 100.

searchString

string value; Case insensitive and Url encoded search string.

Result Structure

Table API Methods.14. Search result structure

Attribute Type Required Details
searchType Enumeration:
ARTIST_CRITERION_KIND
RELEASE_CRITERION_KIND
TRACK_CRITERION_KIND
TOTAL_CRITERION_KIND
yes Search type.
resultsCount integer yes Number of found results.
searchString string yes Specified search string.
searchResults List yes Search results.

or Error

Result sorting order

List of artist, release or track structures ordered by:

  • relevance - DESC

Possible Errors

Common Errors
5041 - "Unsupported search type parameter."
5042 - "Max results parameter value is too big."
5043 - "No search results found."

Method Example

Example API Methods.21. Search artist with name "Die Fantastischen Vier"

http://api.mp3caprice.com/1.0/search/artists/10/Die+Fantastischen+Vier.xml?api_key={API Key}&sub_account={sub_account}
               

<apiResponse>
 <searchType>ARTIST_CRITERION_KIND</searchType>
 <resultsCount>1</resultsCount>
 <searchString>Die Fantastischen Vier</searchString>
 <searchResults>
  <result xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="artist">
   <artistId>3729</artistId>
   <artistName>Die Fantastischen Vier</artistName>
   <releasesCount>11</releasesCount>
   <tracksCount>202</tracksCount>
   <artistUrl>
    http://mp3caprice.com/artist/die-fantastischen-vier-3729?pid=P_00101
   </artistUrl>
   <artistLargeCoverUrl>
    http://cvr.mp3caprice.com/covers/artists/003/729/230.jpg
   </artistLargeCoverUrl>
   <artistSmallCoverUrl>
    http://cvr.mp3caprice.com/covers/artists/003/729/90.jpg
   </artistSmallCoverUrl>
  </result>
 </searchResults>
</apiResponse>
[Note]

To search artist with name "Die Fantastischen Vier" in json format use url like

http://api.mp3caprice.com/1.0/search/artists/10/Die+Fantastischen+Vier.json?api_key={API Key}&sub_account={sub_account}