Once your catalog and events are flowing, you can begin requesting recommendations. This guide shows how to call the API directly and how to rely on the official JavaScript or PHP SDK for convenience. Recommendation requests require an access token that includes theDocumentation Index
Fetch the complete documentation index at: https://docs.neuronsearchlab.com/llms.txt
Use this file to discover all available pages before exploring further.
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 request filters let you narrow eligibility for a single call. Use the Rules Engine for durable promotion, suppression, grouping, or ordering logic.
Call the REST API
user_id(optional): identifier for the end user. If omitted, thesubclaim from the access token is used.context_id(optional): numeric console context ID.ctx_aliases such asctx_101are accepted for backwards compatibility.limit(optional): number of results to return. Defaults to20and is capped at100.entity_type,name,description(optional): override attributes saved with the user embedding.entity_typemust be eitherUserorItem.
request_id, pagination fields, embedding information, explanations when available, and processing time.
See the endpoint reference for the detailed contract.
Use the JavaScript SDK
Install the SDK and initialise it with an access token obtained from the auth token endpoint:Use the PHP SDK
Install the PHP SDK from Packagist and initialize it with an access token obtained from the auth token endpoint: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 /v1/events endpoint and keep your catalog fresh with POST /v1/items; both feed the signals that the recommendation service uses.
