Class: SuggestionsEndpoint
Defined in: endpoints/Suggestions/index.ts:23
Retrieve query suggestions based on trending and historic search activity.
Methods
suggestions()
suggestions(params: SuggestionsEndpointParams): Promise<SearchSuggestionsResponse>;
Defined in: endpoints/Suggestions/index.ts:55
Request related search suggestions for a given term.
Parameters
| Parameter | Type | Description |
|---|---|---|
params | SuggestionsEndpointParams | SuggestionsEndpointParams including storefront, search term, and optional limits. |
Returns
Promise<SearchSuggestionsResponse>
A collection of suggestion groups.
Throws
Error When the endpoint has not been initialized or the request fails.
Example
const suggestions = await appleMusic.Suggestions.suggestions({
term: "taylor",
});