Reference / @open-music-sdk/client-catalog / searchCatalog
Function: searchCatalog()
function searchCatalog(
client,
term,
options
): Promise<tSearchResponse>;Defined in: clients/client-catalog/src/discover.ts:49
Searches the catalog for a term, and resolves to the results by type, each one a first page. limit and offset apply to every type asked for. A next link of a search answers with results by type again, not with a page, so paginate stops after the first page: to get more of one type, ask again with a larger offset. The link keeps the term and the types and leaves out limit, as it did against the live API on 18 October 2026.
Parameters
client
The client to ask with.
term
string
What to search for, 1 to 256 characters.
options
The types to look for, which have to be given; whether to send the best matches of any type; the storefront to ask in; and what to send beside the results.
Returns
Promise<tSearchResponse>
What Apple answered: the results by type under results, each a first page with a next of its own, and the best matches under results.top when they were asked for.
Throws
TypeError if client is no client or an argument is not what it should be, before Apple is asked.
Throws
AppleMusicError if Apple, the network, or a token provider fails, if the client has no storefront to ask in, or a schema finds issues; _tag says which.
Throws
The reason options.signal aborted with, when it does.
Throws
Whatever a token provider, store, schema, hook or rate limiter throws, as client.request passes it on.