This guide explains how to query the Product Recommendation API to display live (instant) and full product search results without embedding the Kameleoon HTML element. Refer to the visual integration guide for the visual method. The tutorial uses the search endpoint.Documentation Index
Fetch the complete documentation index at: https://docs.kameleoon.com/llms.txt
Use this file to discover all available pages before exploring further.
Why use the API?
Depending on your needs, this approach offers multiple benefits:- Full Control: Customize the variation display to match your design and UX standards.
- Better Performance: Use optimized API calls to reduce page load delays compared to script-based solutions.
- Easier Debugging: Log, monitor, and debug integrations within your client codebase using standard tools.
- No Third-Party Script Dependency: Use direct calls to avoid external scripts, reduce potential conflicts, and align with security policies.
- SPA-Friendly: Integrate directly into single-page applications to avoid timing issues and fit into client-side routing.
- Ad Blocker Resilience: Deliver experiments consistently without third-party scripts or specific HTML markers. For more details on how ad blockers affect Kameleoon, see the FAQ.
Goal
Retrieve and display product search results based on user input using either instant (typeahead) or full search modes.Requirements
-
A valid Kameleoon account with a Store ID (
shop_id).- Get your
shop_idfrom Recommendations > Settings > Store settings in the Kameleoon app. Contact your Customer Success Manager for the key if necessary.

- Get your
-
A Device ID (
did) and Session ID (sid). (Required only when using filters or algorithms that rely on historical device/user data).- For Kameleoon Web Experimentation, get these from the following cookies:
KameleoonProducts_device_id→ Device ID (did)KameleoonProducts_session_code→ Session ID (sid)
- Otherwise, generate these values manually.
- For Kameleoon Web Experimentation, get these from the following cookies:
Steps
1. Configure the feed for Kameleoon search
Follow the search configuration guide to configure your feed.2. Retrieve cookies (Kameleoon Web Experimentation only)
3. Make a search request
The API supports two search types:a. Instant search (instant_search)
Use instant search for typeahead and autocomplete results as the user types. Endpoint:| Name | Type | Required | Description |
|---|---|---|---|
did | string | True | Device ID (from cookie) |
sid | string | True | Session ID (from cookie) |
shop_id | string | True | Your Kameleoon store ID |
type | string | True | "instant_search" |
search_query | string | True | User’s search input |
locations | List | False | Comma-separated list of location IDs |
b. Full search (full_search)
Use full search to display detailed results with filters, categories, pagination, and sorting. Endpoint:| Name | Type | Required | Description |
|---|---|---|---|
did | string | True | Device ID (from cookie) |
sid | string | True | Session ID (from cookie) |
shop_id | string | True | Your Kameleoon store ID |
type | string | True | "full_search" |
search_query | string | True | User’s search input |
locations | List | False | Comma-separated list of location IDs |
limit | Integer | False | Maximum number of results |
offset | Integer | False | Offset for pagination |
extended | Integer/Empty | False | 1 returns full product data |
sort_by | String | False | Sort criteria: popular, price, etc. |
order | String | False | Sort order: asc or desc |
brands | List | False | Filter by brand list |
categories | List | False | Filter by category list |
filters | String | False | Escaped JSON string for product parameters |
price_min | Integer | False | Minimum price |
price_max | Integer | False | Maximum price |
exclude | List | False | Product IDs to exclude |
4. Integrate the response
a. Instant search
If the request succeeds, the API returns an HTML snippet for direct page injection, alongside product and category data for custom rendering.
Sample Response
a. Full Search
Integrating full search also provides an HTML snippet for displaying results. The response also includesbrands and filters arrays in addition to the categories array.
The
filters array contains keys and values from the product params fields. Use these to build the filter interface.
Applying filters
The following example shows the full search request with the filters selected in the image above:Sample response
Notes
- Ensure cookies are accessible before making requests.
- Use full search with
extended=1for detailed product listings, such as on product pages. - Customize the returned HTML or render a custom UI using the JSON response. se.