DocsUser guides

Product recommendation API

Campaigns

Product based recommendations

Format of the API request

URL: https://[ENV].custobar.com/api/recommendations/[product_id]/[type_of_recommendation]?[extra_parameters]

type_of_recommendation

  • This parameter can have 4 different values: similar, bought, viewed or all. All will return all types.

extra_parameters

  • ids_only=1 - API returns only IDs of the recommended products. Otherwise it will return all product data in Custobar of the recommended products as JSON.
  • count=x - you can specify the number of products you want to receive
  • boost=1 - boosts similar products (brand, category, type etc) higher. Boosted fields can be configured from company settings. Used in bought & viewed products. category | type | brand = - can be used for filtering results

Some examples

Other customers bought also these products (in these examples: Product ID = 0375704027):

GET https://[ENV].custobar.com/api/recommendations/0375704027/bought/ids_only=1

Example response

Response 1

Filter recommendations with product type:

GET https://[ENV].custobar.com/api/recommendations/0375704027/bought/?ids_only=1&type=Hard+Cover

Other customers viewed also these products:

GET https://[ENV].custobar.com/api/recommendations/0375704027/viewed/?ids_only=1

Similar products:

https://[ENV].custobar.com/api/recommendations/0375704027/similar/?ids_only=1

Top products

Most sold products (returns product ID and count)

- https://[ENV].custobar.com/api/products/bought/

Example response

Response 2


GET https://[ENV].custobar.com/api/products/bought/?category=Tablet

GET https://[ENV].custobar.com/api/products/bought/?brand=asus

GET https://[ENV].custobar.com/api/products/bought/?brand=hp&date=2016-01-01_2017-01-01

Most viewed products (returns product ID and count)

GET https://[ENV].custobar.com/api/products/viewed/

GET https://[ENV].custobar.com/api/products/viewed/?category=Tablet

GET https://[ENV].custobar.com/api/products/viewed/?brand=samsung

GET https://[ENV].custobar.com/api/products/viewed/?brand=hp&date=2016-01-01_2017-01-01

You can also include count, i.e:

GET https://[ENV].custobar.com/api/products/bought/?brand=asus&count=5

GET https://[ENV].custobar.com/api/products/bought/?brand=asus&count=50

Personalized product recommendations for customer

GET https://[ENV].custobar.com/api/customers/[Customer ID]/recommendations/?ids_only=1&count=10

Example:

https://[ENV].custobar.com/api/customers/294168/recommendations/?ids_only=1

Please note: The personalized product recommendations do not currently utilize the Custobar cookie information. The website has to always know the customer ID when requesting recommendations.