Query Context - Attributes

Created by Pedro Ondiviela · last update June 5, 2020

About this Endpoint

Returns the top product attributes for a specific query. The product attribute weights are calculated based on user clicks, add-to-carts and purchases and the values are normalized using a linear function.

Request URL example

GET https://api.empathybroker.com/contextsearch/v2/querycontext/attributes/{client_id}?{Input_Parameters}

Input Parameters

Parameter name Data Type
Required:  
query String
lang String
Not required:  
rows Number
event.min Number
userAttributes String
maxTries Number


Responses

Responses examples for successful and failing calls to the endpoint.

topAttributes” objects don’t have a fixed order and it may change in between requests. Nevertheless, values for each attribute are sorted by “weight” in descending order.

Remember that your EB Contextualize configuration could use different fields for the preference calculations, so the ones showing below (“brand” and “gender”) are just examples.

200 400 404

Successful request

Type: application/json

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
[
  {
    "field": "brand",
    "values": [
      {"value": "apple", "weight": 3},
      {"value": "sony", "weight": 1.8}
    ]
  },
  {
    "field": "category",
    "values": [
      {"value": "mobiles", "weight": 3}
    ]
  }
]