Skip to content
vviinn DocsDocs Beta

Similar Products

POST
/similar-products
curl --request POST \
--url https://api.vviinn.com/similar-products \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{ "requestId": "6edf9d4d-60e8-49f3-b120-e89d728b8a89", "productId": 120857, "resultsCount": 8, "campaigns": [ 28 ], "substitutions": { "category": [ "cm9vdA", "TcO2YmVsPlRpc2NoZQ" ], "price": 19.9 }, "staticFilters": { "excluded": [ { "column": "brand", "values": [ "Nike", "Puma" ] } ], "included": [ { "column": "brand", "values": [ "Nike", "Puma" ] } ] }, "dynamicFilters": [ { "column": "product_type", "values": [ "cm9vdA", "TcO2YmVsPlRpc2NoZQ" ] } ] }'

This endpoint allows to discover products similar to the source product, usually chosen by a user. The response contains a list of similarities for each product.

Similar Products request body

Media typeapplication/json
object
requestId
string
Example
6edf9d4d-60e8-49f3-b120-e89d728b8a89
productId
required
string
Example
120857
resultsCount

Returns less than or equal to the campaign’s defined results

integer
Example
8
campaigns

List of campaign ids

Array
substitutions
object
category

Each item describes a category path that should be used instead of the product’s actual category paths

Array<string>
Example
[
"cm9vdA",
"TcO2YmVsPlRpc2NoZQ"
]
price
number
nullable
Example
19.9
staticFilters

The static filters are predefined parameters that set the initial scope for the data retrieval process. These filters are configured to extract a broad, meaningful set of results based on your criteria. Once applied, they help in reducing the dataset to a manageable and relevant subset before any further, more granular filtering occurs via dynamicFilters.

object
excluded

Each item describes a column and values from that column that should be excluded from the result set

Array<object>
object
column
string
Example
brand
values
Array<string>
Example
[
"Nike",
"Puma"
]
included

Each item describes a column and values from that column that should be included in the result set

Array<object>
object
column
string
Example
brand
values
Array<string>
Example
[
"Nike",
"Puma"
]
dynamicFilters

The dynamic filters are parameters that refine the already narrowed down dataset from the staticFilters based on real-time request criteria. These filters are flexible and can be adjusted dynamically to specific user queries or requirements, allowing for further granular filtering. They provide a more precise result based on the user’s immediate needs.

Array<object>
object
column
required
string
Example
product_type
values
required
One of:

Each item describes a category path that should be used instead of the product’s actual category paths

Array<string>
Example
[
"cm9vdA",
"TcO2YmVsPlRpc2NoZQ"
]

OK

Media typeapplication/json
object
requestId
string
data
required
object
sourceProduct
required
object
kind

This field is superseded by the entity type and therefore deprecated.

string
Allowed values: product content
entityType

The API usually returns products; it can also return entities representing something else. To enable different handling of these entities, the API uses an entity-type to distinguish between them, namely:

  • A product entity represents a product in the catalog.
  • A content entity contains information relevant to a user, e.g., trends, opening hours.
  • A list entity comprises a collection of distinguishable items, e.g., a category page.
string
Allowed values: product content list
groupId
string
nullable
productId
string
title
string
deeplink

Link to the product detail page

string
nullable
brand
string
nullable
productType
string
nullable
image
object
original
required
string format: uri
thumbnail
required
string format: uri
nullable
images
Array<object>
object
original
required
string format: uri
thumbnail
required
string format: uri
nullable
price
object
actual
number
nullable
sale
number
nullable
basePrice
object
actual

The base price per measure is derived by adjusting the product’s total cost to a standardized unit of measurement, making it easier to compare products of varying volumes.

object
price
number
nullable
quantity
number
measure
string
sale

The base price per measure is derived by adjusting the product’s total cost to a standardized unit of measurement, making it easier to compare products of varying volumes.

object
price
number
nullable
quantity
number
measure
string
energyEfficiencyClass

More information

string
nullable
Allowed values: A+++ A++ A+ A B C D E F G
minEnergyEfficiencyClass

More information

string
nullable
Allowed values: A+++ A++ A+ A B C D E F G
maxEnergyEfficiencyClass

More information

string
nullable
Allowed values: A+++ A++ A+ A B C D E F G
energyCertifications
Array<object>
object
certificationClass

More information

string
nullable
Allowed values: A+++ A++ A+ A B C D E F G
classIconUrls
object
left
required
string format: uri
right
required
string format: uri
classRange
object
min

More information

string
nullable
Allowed values: A+++ A++ A+ A B C D E F G
max

More information

string
nullable
Allowed values: A+++ A++ A+ A B C D E F G
classLabelUrl
string format: uri
classDataSheetUrl
string format: uri
productType
string
custom_label_0
string
nullable
custom_label_1
string
nullable
custom_label_2
string
nullable
custom_label_3
string
nullable
custom_label_4
string
nullable
products
required
Array<object>
object
kind

This field is superseded by the entity type and therefore deprecated.

string
Allowed values: product content
entityType

The API usually returns products; it can also return entities representing something else. To enable different handling of these entities, the API uses an entity-type to distinguish between them, namely:

  • A product entity represents a product in the catalog.
  • A content entity contains information relevant to a user, e.g., trends, opening hours.
  • A list entity comprises a collection of distinguishable items, e.g., a category page.
string
Allowed values: product content list
groupId
string
nullable
productId
string
title
string
deeplink

Link to the product detail page

string
nullable
brand
string
nullable
productType
string
nullable
image
object
original
required
string format: uri
thumbnail
required
string format: uri
nullable
images
Array<object>
object
original
required
string format: uri
thumbnail
required
string format: uri
nullable
price
object
actual
number
nullable
sale
number
nullable
basePrice
object
actual

The base price per measure is derived by adjusting the product’s total cost to a standardized unit of measurement, making it easier to compare products of varying volumes.

object
price
number
nullable
quantity
number
measure
string
sale

The base price per measure is derived by adjusting the product’s total cost to a standardized unit of measurement, making it easier to compare products of varying volumes.

object
price
number
nullable
quantity
number
measure
string
energyEfficiencyClass

More information

string
nullable
Allowed values: A+++ A++ A+ A B C D E F G
minEnergyEfficiencyClass

More information

string
nullable
Allowed values: A+++ A++ A+ A B C D E F G
maxEnergyEfficiencyClass

More information

string
nullable
Allowed values: A+++ A++ A+ A B C D E F G
energyCertifications
Array<object>
object
certificationClass

More information

string
nullable
Allowed values: A+++ A++ A+ A B C D E F G
classIconUrls
object
left
required
string format: uri
right
required
string format: uri
classRange
object
min

More information

string
nullable
Allowed values: A+++ A++ A+ A B C D E F G
max

More information

string
nullable
Allowed values: A+++ A++ A+ A B C D E F G
classLabelUrl
string format: uri
classDataSheetUrl
string format: uri
productType
string
custom_label_0
string
nullable
custom_label_1
string
nullable
custom_label_2
string
nullable
custom_label_3
string
nullable
custom_label_4
string
nullable
interactions
object
dynamicFilters
required
Array
One of:
object
type
required
string
Allowed values: categorical interval
column
required
string
label
required
string
isPrimary
required
boolean
values
required
Array
object
value
required
One of:

In a category tree, a category path identifies a category of the tree. The API expects and returns each category path only in encoded form.

A category path is a sequence category labels, separated by the > character. Whitespace around the category labels is ignored. If the > character is part of a category label, it must be escaped with %3E. The root node has no label and is omitted in a category path. To represent the root node, use root as the sole label instead.

Consider the following category tree:

.
├── Furniture
│   ├── Benches
│   └── Cabinets & Storage
└── Home & Garden
    ├── Plants
    ├── Wood Stoves
    └── Fish Pond (<><)

That contains the following category paths:

  • root
  • Furniture
  • Furniture > Benches
  • Furniture > Cabinets & Storage
  • Home & Garden
  • Home & Garden > Plants
  • Home & Garden > Wood Stoves
  • Home & Garden > Fish Pond (<%3E<)

Category paths are transmitted in encoded form. To this end, we use the Base64-URL encoding without any padding. The category paths above are encoded as follows:

  • cm9vdA
  • RnVybml0dXJl
  • RnVybml0dXJlID4gQmVuY2hlcw
  • RnVybml0dXJlID4gQ2FiaW5ldHMgJiBTdG9yYWdl
  • SG9tZSAmIEdhcmRlbg
  • SG9tZSAmIEdhcmRlbiA-IFBsYW50cw
  • SG9tZSAmIEdhcmRlbiA-IFdvb2QgU3RvdmVz
  • SG9tZSAmIEdhcmRlbiA-IEZpc2ggUG9uZCAoPCUzRTwp

On Linux, the basenc command can be used to encode category paths:

echo -n 'Furniture > Cabinets & Storage' | basenc -w0 --base64url
# returns: RnVybml0dXJlID4gQ2FiaW5ldHMgJiBTdG9yYWdl
echo -n 'RnVybml0dXJlID4gQ2FiaW5ldHMgJiBTdG9yYWdl' | basenc -d -w0 --base64url
# returns: Furniture > Cabinets & Storage
string
label
required
string
active
required
boolean
selected
required
boolean
suggestedSearchAreas
Array<object>
object
rectangle
required

A rectangle is defined by the position of its top-left corner and its side lengths. Each value is relative to an image’s dimensions, i.e., they are in the range [0, 1]. The top-left corner is defined to be at (0, 0), the bottom-right corner at (1, 1).

object
left

The relative distance to the left edge of the image

number
top

The relative distance to the top edge of the image

number
width

The width relative to the image’s width

number
height

The height relative to the image’s height

number
redirect
object
url
required

The URL to which the user should be redirected.

string format: uri
substitutions
Array<object>
object
column
required
string
Allowed values: product_type google_product_category price
value
required
One of:
object
value
required
One of:

In a category tree, a category path identifies a category of the tree. The API expects and returns each category path only in encoded form.

A category path is a sequence category labels, separated by the > character. Whitespace around the category labels is ignored. If the > character is part of a category label, it must be escaped with %3E. The root node has no label and is omitted in a category path. To represent the root node, use root as the sole label instead.

Consider the following category tree:

.
├── Furniture
│   ├── Benches
│   └── Cabinets & Storage
└── Home & Garden
    ├── Plants
    ├── Wood Stoves
    └── Fish Pond (<><)

That contains the following category paths:

  • root
  • Furniture
  • Furniture > Benches
  • Furniture > Cabinets & Storage
  • Home & Garden
  • Home & Garden > Plants
  • Home & Garden > Wood Stoves
  • Home & Garden > Fish Pond (<%3E<)

Category paths are transmitted in encoded form. To this end, we use the Base64-URL encoding without any padding. The category paths above are encoded as follows:

  • cm9vdA
  • RnVybml0dXJl
  • RnVybml0dXJlID4gQmVuY2hlcw
  • RnVybml0dXJlID4gQ2FiaW5ldHMgJiBTdG9yYWdl
  • SG9tZSAmIEdhcmRlbg
  • SG9tZSAmIEdhcmRlbiA-IFBsYW50cw
  • SG9tZSAmIEdhcmRlbiA-IFdvb2QgU3RvdmVz
  • SG9tZSAmIEdhcmRlbiA-IEZpc2ggUG9uZCAoPCUzRTwp

On Linux, the basenc command can be used to encode category paths:

echo -n 'Furniture > Cabinets & Storage' | basenc -w0 --base64url
# returns: RnVybml0dXJlID4gQ2FiaW5ldHMgJiBTdG9yYWdl
echo -n 'RnVybml0dXJlID4gQ2FiaW5ldHMgJiBTdG9yYWdl' | basenc -d -w0 --base64url
# returns: Furniture > Cabinets & Storage
string
label
required
string
Example
{
"requestId": "6edf9d4d-60e8-49f3-b120-e89d728b8a89",
"data": {
"sourceProduct": {
"kind": "product",
"entityType": "product",
"groupId": "55fc5f71d6362321cb93b82b387e2f32",
"productId": "55fc5f71d6362321cb93b82b387e2f32",
"title": "Livingwalls Fototapete Walls by Patel iconic 3",
"deeplink": "http://mainUrl/site/5/product/55fc5f71d6362321cb93b82b387e2f32/details",
"brand": "Fender",
"productType": "guitar",
"image": {
"original": "http://mainUrl/image.jpg",
"thumbnail": "http://mainUrl/thumbnail-image.jpg"
},
"images": [
{
"original": "http://mainUrl/image.jpg",
"thumbnail": "http://mainUrl/thumbnail-image.jpg"
}
],
"price": {
"actual": 19.9,
"sale": 19.9
},
"basePrice": {
"actual": {
"price": 15.92,
"quantity": 100,
"measure": "ml"
},
"sale": {
"price": 15.92,
"quantity": 100,
"measure": "ml"
}
},
"energyEfficiencyClass": "A+++",
"minEnergyEfficiencyClass": "A+++",
"maxEnergyEfficiencyClass": "A+++",
"energyCertifications": [
{
"certificationClass": "A+++",
"classRange": {
"min": "A+++",
"max": "A+++"
}
}
]
},
"products": [
{
"kind": "product",
"entityType": "product",
"groupId": "55fc5f71d6362321cb93b82b387e2f32",
"productId": "55fc5f71d6362321cb93b82b387e2f32",
"title": "Livingwalls Fototapete Walls by Patel iconic 3",
"deeplink": "http://mainUrl/site/5/product/55fc5f71d6362321cb93b82b387e2f32/details",
"brand": "Fender",
"productType": "guitar",
"image": {
"original": "http://mainUrl/image.jpg",
"thumbnail": "http://mainUrl/thumbnail-image.jpg"
},
"images": [
{
"original": "http://mainUrl/image.jpg",
"thumbnail": "http://mainUrl/thumbnail-image.jpg"
}
],
"price": {
"actual": 19.9,
"sale": 19.9
},
"basePrice": {
"actual": {
"price": 15.92,
"quantity": 100,
"measure": "ml"
},
"sale": {
"price": 15.92,
"quantity": 100,
"measure": "ml"
}
},
"energyEfficiencyClass": "A+++",
"minEnergyEfficiencyClass": "A+++",
"maxEnergyEfficiencyClass": "A+++",
"energyCertifications": [
{
"certificationClass": "A+++",
"classRange": {
"min": "A+++",
"max": "A+++"
}
}
]
}
]
},
"interactions": {
"dynamicFilters": [
{
"type": "categorical",
"column": "product_type",
"label": "Product Type",
"isPrimary": true,
"values": [
{
"value": [
"RnVybml0dXJl",
"SG9tZSAmIEdhcmRlbg"
],
"label": "Tische",
"active": true,
"selected": false
}
]
}
],
"suggestedSearchAreas": [
{
"rectangle": {
"left": 0.1728,
"top": 0.3641,
"width": 0.4575,
"height": 0.2917
}
}
],
"redirect": {
"url": "https://www.example.com/some-category"
}
},
"substitutions": [
{
"column": "product_type",
"value": {
"value": [
"RnVybml0dXJl",
"SG9tZSAmIEdhcmRlbg"
],
"label": "Tische"
}
}
]
}

Generic Error

Media typeapplication/json
object
message
string
Example
{
"message": "Generic Error"
}

Authentication Error

Media typeapplication/json
Example
{
"message": "Authentication Error"
}

Authorization Error

Media typeapplication/json
Example
{
"message": "Authorization Error"
}

Generic Error

Media typeapplication/json
object
message
string
Example
{
"message": "Generic Error"
}

Generic Error

Media typeapplication/json
object
message
string
Example
{
"message": "Generic Error"
}