Contents

Search for Library Resources

Search the library by using a query.

URL

GET https://api.music.apple.com/v1/me/library/search

Query Parameters

NameTypeDescription
term Requiredstring

The text for the search, with a plus sign (+) between each word to replace spaces (for example, term=james+br).

types Required[string]

The list of the types of resources to include in the results. The possible values are library-albums, library-songs, library-playlists, library-artists, and library-music-videos.

limit Optionalinteger

The number of objects or number of objects in the specified relationship returned.

offset Optionalstring

The next page or group of objects to fetch.

l Optionalstring

The localization to use, specified by a language tag. The possible values are in the supportedLanguageTags array belonging to the Storefront object specified by storefront. Otherwise, the default is defaultLanguageTag in Storefront.

Response Codes

StatusReasonTypeDescription
200OK
Content-Type: application/json
LibrarySearchResponse

The request was successful.

401Unauthorized
Content-Type: application/json
UnauthorizedResponse

A response indicating an incorrect Authorization header.

403Forbidden
Content-Type: application/json
ForbiddenResponse

A response indicating invalid or insufficient authentication.

500Internal Server Error
Content-Type: application/json
ErrorsResponse

A response indicating an error occurred on the server.

Discussion

If successful, the HTTP status code is 200 (OK) and the results contains a map of search results. If unsuccessful, the HTTP status code indicates the error and the details are in the errors array. For more information, see Handling Requests and Responses.

This endpoint requires a music user token. For more information, see User Authentication for MusicKit.

Example

See Also

Related Documentation