Recommendation API
Overview
The Recommendation API recommends and delivers similar products based on the product code requested by the customer. Both GET and POST methods are supported. Please select and use the method you want.
Endpoint
We currently support two LENS API versions
Version 1.1:
Version 1.2: Recommended for new LENS users
Filter option added on request compared to version 1.1
Method 1) GET /
Request
Header
Name
Description
x-api-key
API Key for authentication from Omnious [Required]
Query Parameter
Name
Type
Description
id
String
(required) Product code of the query product you want to recommend
limit
Int
Maximum number of items to recommend
default: 10
max: 500
weightColorFeature
String
Weight of color to be reflected in recommendations
default: MEDIUM
Selectable from the following values
LOW
MEDIUM
HIGH
showContext
Bool
Whether to display context information
default: false
showImageInfo
Bool
Whether to display image information
default: false
Request Examples
Example. request for recommendation (without Context information)
Example. request for recommendation (with Context information)
Example. request for recommendation (with Context and image information)
Response
Return recommended products in order of similarity.
HTTP Status Codes
Code
Description
403
API KEY authentication related error
400
Input Data Validation related error
200
Success response with zero recommendation results
201
Success response with one or more recommendation results
500
Server error
Response Data
Name
Type
Description
id
String
Product code of the query product you want to recommend
limit
Int
Maximum number of items to recommend
weightColorFeature
String
Weight of color to be reflected in recommendations
LOW
MEDIUM
HIGH
showContext
Bool
Whether to display context information
showImageInfo
Bool
Whether to display image information
recommendation
Array of Recommendations
List of recommendations (refer to the below)
Recommendations
Name
Type
Description
id
String
Product code to recommend
url
String
Recommended product information url
context
Object
Context information inserted in Data Management API
imageInfo
Object
Image information entered in Data Management API
(Detection information, Image URL)
null if showImageInfo is false
imageInfo.detection
String
Detection information of the product
imageInfo.content
String
The url of the product image used in the analysis
Response Example
Example. When 4 products are recommended
Context information and imageinfo are not included
HTTP Status Code: 201
Example. When 4 products are recommended (HTTP Status Code: 201)
Context information and imageinfo are included
Method 2) POST /
Request
Header
Name
Description
Content-Type
application/json
x-api-key
API Key for authentication from Omnious [Required]
Body
Name
Type
Description
id
String
(Required) Product code of the query product you want to recommend
limit
Int
Maximum number of items to recommend
default: 10
max: 500
weightColorFeature
String
Weight of color to be reflected in recommendations
default: MEDIUM
Selectable from the following values
LOW
MEDIUM
HIGH
showContext
Bool
Whether to display context information
default: false
showImageInfo
Bool
Whether to display image information
default: false
filter
Filter object
Filters are available from version 1.2
Filter
url
String filter
include, exclude, match
image
Object
image.content
String filter
include, exclude, match
context
Object
context.name
String filter
include, exclude, match
context.gender
String filter
include, exclude, match
context.brand
String filter
include, exclude, match
context.price
Object
context.price.currency
currency filter
match
context.price.value
Integer filter
type(required)
gte, lte, gt, lt, eq : Use one out of the 5
context.price.discounted
Integer filter
type(required)
gte, lte, gt, lt, eq : Use one out of the 5
context.mobilePrice
Object
context.mobilePrice.currency
currency filter
match
context.mobilePrice.value
Integer filter
type(required)
gte, lte, gt, lt, eq : Use one out of the 5
context.mobilePrice.discounted
Integer filter
type(required)
gte, lte, gt, lt, eq : Use one out of the 5
Request Examples
Example 1. Request for recommendation (without context information)
Example 2. Request for recommendation (with context information)
Example 3. Request for recommendation (with context and image information)
Example 4. Filtering items in the price range of 400 ~ 700
Example 5. Filtering items between 0.7 ~ 1.2 ratio (70% ~ 120%) of the price of the input item
Example 6. Filtering "Nike" brand products
Example 7. Filtering products that include "shirts" in the product name
Example 8. Filtering products don't include "shirts" in the product name
Response
Return recommended products in order of similarity.
HTTP Status Code
Code
Description
403
API KEY authentication related error
400
Input Data Validation related error
200
Success response with zero recommendation results
201
Success response with one or more recommendation results
500
Server error
Response Data
Name
Type
Description
id
String
Product code to base the search on
limit
Int
Maximum number of items to recommend
weightColorFeature
String
Weight of color to be reflected in recommendations
[LOW
showContext
Bool
Whether to display context information
showImageInfo
Bool
Whether to display image information
recommendations
List of Recommendations
List of recommendations (refer to the below)
Recommendations
Name
Type
Description
id
String
Product code to recommend
url
String
Recommended product information url
context
Object
Context information inserted in Data Management API
imageInfo
Object
Image information entered in Data Management API
(Detection information, Image URL)
null if showImageInfo is false
imageInfo.detection
String
Detection information of the product
imageInfo.content
String
The url of the product image used in the analysis
Example. When 4 products are recommended (HTTP Status Code: 201)
Context information and imageinfo are not included
Example. When 4 products are recommended (HTTP Status Code: 201)
Context information and imageinfo are included
Last updated
Was this helpful?