Skip to main content
Use this guide to ship personalized recommendations in production surfaces such as home feed, product detail rails, and post-purchase modules.

Setup

  1. Create an API client in Console -> Security -> API Clients.
  2. Exchange client credentials for an access token.
  3. Store the token in your backend service and call /recommendations from server-side code.
curl -X POST https://api.neuronsearchlab.com/auth/token \
  -H "Authorization: Basic <base64(client_id:client_secret)>" \
  -H "Content-Type: application/x-www-form-urlencoded" \
  -d "grant_type=client_credentials"

Common workflows

Request recommendations for a known user

curl -X GET "https://api.neuronsearchlab.com/recommendations?user_id=user-123&context_id=101&quantity=8" \
  -H "Authorization: Bearer <access_token>"

Serve recommendations for anonymous traffic

Use a temporary user identifier (for example a session-scoped UUID) in user_id so traffic can still be tracked consistently.

Roll out by surface using context IDs

Create separate context IDs for each surface (home_feed, pdp_related, email_digest) and pass the right context_id per request so ranking logic stays predictable.

Example app journey: Home feed rollout

  1. Product team defines context 101 for Home Feed in Console.
  2. Backend calls GET /recommendations with user_id, context_id=101, and quantity=8.
  3. Frontend renders the top recommendations in a hero rail.
  4. Click/view events are submitted to /events to close the feedback loop.
  5. Analytics is reviewed daily for serve volume and engagement lift.

Next steps