Retrieve search results
The Kameleoon Search service provides access to two different types of search results:
- Instant (typeahead) search, which is displayed and updated as users type their search queries.
- Full search, which returns complete and filtered search results after the user submits their search query.
Both options use the same endpoint. You'll use the type
parameter to specify which of these two search types you want to use.
HTTP Request
GET https://api.products.kameleoon.com/search
Query Parameters
The following query parameters are used by both full search and instant search. There are also some additional parameters that only you can use with full search.
Parameter | Type | Required | Description |
---|---|---|---|
did | String | True | Device ID. You can get this ID from the cookie KameleoonProducts_device_id , which you can retrieve from the back-end before calling this endpoint. |
shop_id | String | True | Your Store Key. You can find this in Recommendations > Settings > Store settings in the Kameleoon app. You can also contact your Customer Success Manager for the key. |
seance | String | True | The temporary user session ID. You can find this ID from KameleoonProducts_session_code , which you can retrieve from the back-end before calling this endpoint. |
type | String | True | Specifes the type of search you want to perform. Use either instant_search or full_search . |
search_query | String | True | The current search query |
locations | List | Optional | A comma-separated list of locations IDs. |
Additional query parameters (full search only)
You can use the following additional parameters with full search requests (when type
is full_search
).
Parameter | Type | Required | Description |
---|---|---|---|
limit | Integer | Optional | Maximum number of results you want the API to return. |
offset | Integer | Optional | Offset of results. |
category_limit | Integer | Optional | Maximum number of categories for the sidebar filter to return. |
categories | List | Optional | Comma separated list of categories to filter. |
extended | Integer or empty | Optional | Adds extended information about the product results. Supported values: 1 or empty. If value is 1, the API returns all of the information about the products. If empty, the API returns only the products IDs. For full search, we recommed setting this to true. |
sort_by | String | Optional | The parameter you want to sort the results by. Supported values: popular , price , discount , sales_rate , date . |
order | String | Optional | Sort direction: asc for ascending or desc for descending. Default is descending. |
brands | List | Optional | Comma-separated list of brands to filter. |
filters | String | Optional | escaped JSON string with filter parameters. For example: {"bluetooth":["yes"],"offers":["15% cashback"],"weight":["1.6"]} |
price_min | Integer | Optional | Minimum price. |
price_max | Integer | Optional | Maximum price. |
colors | Integer | Optional | Comma-separated list of colors. |
exclude | Integer | Optional | Comma-separated list of products IDs to exclude from search results. |
API response (instant search)
Name | Type | Description |
---|---|---|
search_query | string | Search query |
categories | array | Array with information about categories. Each object has the following properties:
|
filters | array | Array with information about filters. Each object has the following properties:
|
html | string | HTML-code of the block with products. The template is customized in the Kameleoon personal account. |
price_range | object | Min and max price of products. Has the following properties:
|
products | array | Array with information about products. Each object has the following properties:
|
search_query_redirects | array | Array with information about redirects. Each object has the following properties:
|
products_total | number | Total number of products |
API response (full search)
Name | Type | Description |
---|---|---|
brands | array | Array with information about brands. Each object has the following properties:
|
categories | array | Array with information about categories. Each object has the following properties:
|
filters | array | Array with information about filters. Each object has the following properties:
|
html | string | HTML-code of the block with products. The template is customized in the Kameleoon personal account. |
price_range | object | Min and max price of products. Has the following properties:
|
products | array | Array with information about products. Each object has the following properties:
|
products_total | number | Total count of products |
search_query | string | Search query |