API Reference

GET /v1/recommendations/index/{index public key}/block/{block id}

Retrieve recommendations from an AddSearch Recommend block. See the documentation on configuring recommendations block in the AddSearch dashboard here.

Optional Query Parameters

itemIdPathThe name of the field used to identify item in the AddSearch indexstringitemIdPath supports document ID and custom fields. Examples of allowed values:

By default, the path configured in the recommendations bock is used
itemIdThe id of an item for which recommendations are fetchedstringThe if of the currently viewed item is usually extracted from the page's source code with a CSS selector. If you use docid to identify the item, it could be calculated as md5 hash of the item's URL.

Requests examples

When fetching global recommendations, you don’t need to specify any of the optional parameters. Recommendations are fetched according to the configuration of your global widget block. For instance, a global recommendations request’s URL could look like this:

When you fetch recommendations for a particular item, you need to specify that item’s id and the path to an id. Here is an example of such request:


The request returns results according to the configuration of your AddSearch Recommend block. For more information on the results object please visit the search API reference page.

Was this helpful?

Need more help?

We’re always happy to help with code or other questions you might have. Search our documentation, contact support, or connect with our sales team.