Using the Search and Recommendation API to create search experiences
Use the Search and Recommendation API to create best-in-class search experiences for your visitors. The API has one endpoint and many objects and keys that you can use to get search results, recommendations, AI-powered questions and answers, and more.
Refer to the Search and Recommendation API reference for descriptions of objects and keys, and a detailed view of the data model.
You can use the Search and Recommendation API to integrate with your website or mobile app after an administrator has performed the initial set up and configured sources using Sitecore Search.
Sitecore Search and the Search and Recommendation API
Sitecore Search and the Search and Recommendation API work together. Administrators use Sitecore Search to do two main things:
-
Perform the initial setup. That is, configure sources, widgets, pages, attributes, and options like sorting, filtering, textual relevance, and other features that you want to use. They must do this before you can make any API call.
-
Configure settings that do not change at run time. For example, they can configure which facets you want Sitecore Search to return when you request all facets in an API call. This is because when you request all facets, you do not depend on a runtime visitor query to determine which facets to show.
To request items and set configurations that you can only pass at run time, you must use the Search and Recommendation API. For example, if you want to get facets at the filter level or send user
context, you must do this through the API. This is because the facets available depend on the visitor query, and you only know user
context when a specific visitor's action triggers an API call.
There is an overlap between what you can do in Search and what you can do through the API. If there is a conflict, the settings you request through the API always override what you define in Search.