Search
You can submit keywords to our public Search API to find the following information in the Beats Music Catalog:
- artists
- tracks
- albums
- playlists
- users
- genres
Endpoint URL
/api/search
HTTP Method
GET
Authentication
Client ID required. See how to authenticate public resources here.
Parameters
| Name | Required | Description | Example | ||||||
|---|---|---|---|---|---|---|---|---|---|
| q | required | Query string for the search. | dr+dre | ||||||
| type | required | The type of entity for the search. Values: genre, artist, album, track, playlist, user
|
artist | ||||||
| offset | optional | A zero-based integer offset into the results. Default 0. | 0 | ||||||
| limit | optional | Specifies the maximum number of records to retrieve. The number of results returned will be less than or equal to this value. No results are returned if it is set to zero or less. The maximum permitted value is 200. If value higher than 200 is specified, no more 200 results will be returned. Default 20. | 20 | ||||||
| filters | optional |
Array of streamability filter operations to be applied. Each operation is specified as filter:value.
Values:
|
Response Elements
| Response | Description |
|---|---|
| code |
Beats API response code. OK if successful; otherwise an error code is returned. |
| info |
Contains paging information used to display the results. |
|
offset |
A zero-based integer offset into the results. Always matches the parameter value if it was specified. |
|
count |
The number of results returned for this request. |
|
total |
The total number of elements available for this resource. |
| data |
List of matching search results. Each element is a search_result object: |
|
type |
The entity type of the API object |
|
result_type |
The entity type of the search result object. |
|
id |
The unique ID of the referenced item. |
|
display |
Text to be displayed when displaying a link to the item. |
|
detail |
Additional text detail describing the item. |
|
related |
Object with keys corresponding to referenced object types, and values providing the information needed for linking to the objects. |
Example Request
Suppose you performed a search of the Beats Music Catalog for artists whose information contains "Dr Dre". You would specify q=dr+dre for the query string, and type=artist to indicate that you would like the results to be artists.
curl -X GET "https://partner.api.beatsmusic.com/v1/api/search?
q=dr+dre
&type=artist
&client_id=[YOUR_CLIENT_ID]"
Example Response
{
data: [
{
type: "search_result",
result_type: "artist",
id: "ar8917",
display: "Dr. Dre",
detail: "",
related: {
ref_type: "artist",
id: "ar8917",
display: "Dr. Dre"
}
}
...
],
info: {
offset: 0,
count: 11,
total: 11
},
code: "OK"
}

