- Previous: Method: Artist Related
- Up: Introduction
- Next: Method: Book Charts
Method: Artist Search
Request URL
The object is artist and the action is search. The base request URL is:
http://api.emusic.com/artist/search?apiKey=myKey&term=search+term
Request ParametersFollowing is a list of required and optional query string parameters for the Artist Search method. For more information about individual request parameters, see request parameters.
| Name | Required | Default | Description |
| apiKey | YES | none | The developer API key. This is required for all methods. |
| term | depends | none | A URL-encoded search term with which to search artists. One of term, albumId, artistId, genreId, labelId or styleId must be provided. |
| albumId artistId genreId labelId styleId |
depends | none | A related search ID. One of term, albumId, artistId, genreId, labelId or styleId must be provided. |
| page | no | 1 | The starting page index of returned artists. (Used for paginating through longer result lists.) |
| perPage | no | 20 | The number of artists to return per page. |
| format | no | XML | The format of the response (XML, JSON, JSONP). |
| callback | depends | none | The name of the JavaScript callback method for the JSONP format. (Required for JSONP responses only.) |
| fref | no | none | The eMusic partner tag. If provided, the FREF value is automatically added to all appropriate eMusic links. |
// Returns the first 20 artists that contain the string "bob marley".
http://api.emusic.com/artist/search?apiKey=myKey&term=bob+marley
// Returns the third page of 10 artists.
http://api.emusic.com/artist/search?apiKey=myKey&term=bob+marley&page=3&perPage=10
// Returns the first 20 artists with album ID 11002212.
http://api.emusic.com/artist/search?apiKey=myKey&albumId=11002212
// Returns the first 20 artists in JSON.
http://api.emusic.com/artist/search?apiKey=myKey&term=bob+marley&
format=JSON
// Returns the third page of 10 artists in JSONP using a callback of
// someMethod() and an FREF value of 400060.
http://api.emusic.com/artist/search?apiKey=myKey&term=bob+marley&page=3&perPage=10&
format=JSONP&callback=someMethod&fref=400060
Following is a list of returned elements for the Artist Search method. For more information about individual response elements, see Response Elements.
| Name | Type | Returned | Description |
| status | status | always | Contains a result code. |
| messages | list | on error | Contains one or more messages. |
| options | options | on ok | Contains a list of method options. |
| search | search | on ok | Contains the search term. |
| view | view | on ok | Contains the paginate result counts. |
| artists | list | on ok | Contains a paged list of artists that meet the search criteria. See the example response below for typical artist elements. |
<?xml version="1.0" encoding="UTF-8"?>
<response xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<status code="200">ok</status>
<options format="xml"/>
<search term="bob marley"/>
<view page="1" pages="9" perPage="3" total="25"/>
<artists list="true" size="3">
<artist id="10559083" name="Bob Marley" url="http://www.emusic.com/artist/Bob-Marley-MP3-Download/10559083.html"/>
<artist id="10559248" name="Bob Marley and the Wailers" url="http://www.emusic.com/artist/Bob-Marley-and-the-Wailers-MP3-Download/10559248.html"/>
<artist id="11650684" name="Bob Marley & Lee Scratch Perry" url="http://www.emusic.com/artist/Bob-Marley-Lee-Scratch-Perry-MP3-Download/11650684.html"/>
</artists>
</response>
- Previous: Method: Artist Related
- Up: Introduction
- Next: Method: Book Charts
Docs Navigation
- Introduction
- Request Format
- Response Elements
- Result Codes
- Response Format
- Code Samples
- Branding Guidelines
- Method Index
- Request Parameters
- Method: Album Charts
- Method: Album Editorial
- Method: Album Info
- Method: Album Picks
- Method: Album Ratings
- Method: Album Reviews
- Method: Album Search
- Method: Artist Charts
- Method: Artist Editorial
- Method: Artist Info
- Method: Artist Picks
- Method: Artist Ratings
- Method: Artist Related
- Method: Artist Search
- Method: Book Charts
- Method: Book Editorial
- Method: Book Info
- Method: Book Ratings
- Method: Book Reviews
- Method: Book Search
- Method: Label Info
- Method: Label Search
- Method: Track Charts
- Method: Track Search
0 Comments
Please sign in to post a comment.