Sonos Music API > search

Sonos uses the search request to find content based on a search term within a search category. If you support search on your service, you must also support it on Sonos. See Add search for details.

Request parameters

Name Type Description
id string(128) The ID of the search category.
term string The search term.
index int The zero-based index at which to start retrieving search results.
count int The number of search results requested.

Response

The response is identical to the getMetadata message. See the samples below for details.

Sample presentation map configuration

Details

  • You must implement search in two ways, one for Sonos apps for mobile devices and one for Sonos apps for desktop computers. Implement search for mobile devices by sending a list of searchable categories from the unified search configuration in the presentation map. Implement it for Windows and Mac OS by sending a list of categories in a response to a getMetadata request on the search container. See Add search for details.
  • The list of IDs, whether contained in the presentation map or in the response to a Sonos getMetadata request on the “search” ID, should be identical.
  • Regardless of where Sonos firmware retrieves the list of searchable categories, Sonos uses the ID for a given category as the category (ID) parameter to the search message. For example, your service may expose search categories like “artists”, “tracks”, or “albums” but this list can be expanded to enable other categories of searches.

Sample request from a search for artist “Foo Fighters”

Sample response

Sample getmetadata “search” request

Sample getMetadata “search” response