/recommendations endpoint requires an access token that includes the neuronsearchlab-api/read scope.
Choose a context and audience
Every request should specify the surface and user the results are meant for.- context_id ties the request to a configuration defined in the console (for example
101for Homepage Recommendations). - user_id represents the end user who will see the results. Anonymous traffic can use a temporary UUID.
- Optional filters and boosts allow you to respect inventory rules or promote specific items.
Call the REST API
user_id(required): identifier for the end user. If omitted, thesubclaim from the access token is used.context_id(optional): numeric reference to a stored context configuration that can introduce conditional filtering or grouping.quantity(optional): number of results to return. Defaults to the configured context quantity when not supplied.entity_type,name,description(optional): override attributes saved with the user embedding.entity_typemust be eitherUserorItem.
Use the JavaScript SDK
Install the SDK and authenticate it with your client credentials:Render and measure
Use the item metadata provided in each response to render cards, collections, or hero modules in your UI. Track downstream engagement with thePOST /events endpoint and keep your catalog fresh with POST /items; both feed the signals that the recommendation service uses.
