Skip to main content

Class: SearchEndpoint

Defined in: endpoints/Search/index.ts:24

Perform catalog-wide search queries with precise filtering.

Methods

search(params: SearchEndpointParams): Promise<SearchEndpointResponse>;

Defined in: endpoints/Search/index.ts:54

Execute a search query across multiple resource types.

Parameters

ParameterTypeDescription
paramsSearchEndpointParamsSearchEndpointParams describing the search term, storefront, and fine-grained filtering options.

Returns

Promise<SearchEndpointResponse>

Normalized search results segmented by resource type.

Throws

Error When the endpoint has not been initialized or the request fails.

Example

const results = await appleMusic.Search.search({ term: "midnights" });
console.log(results.results.songs?.data[0].attributes?.name);