Page Comparison - API requests (current functional) (v.3 vs v.4) - EN documentation - REES46 Manual
Page tree

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

NameTypeRequirementDescription
codestringrequiredUnique code of the recommendation block. See this value in the "data-recommender-code" attribute of the block created in REES46 personal account.
itemnumber/stringrequired in some casesProduct ID. This parameter is mandatory for the requests of blocks that use the algorithms "Similar" and "Also bought".
excludearrayoptionallyProduct IDs array, which should be excluded from the recommended products list.
categorynumber/stringrequired in some casesCategory ID. This parameter is mandatory for all blocks set on category pages.
search_querystringrequired in some casesThe text of the search query. This parameter is mandatory for the requests of blocks that use the "Search" algorithm.
limitnumberoptionallyA maximum number of products in the API response.
locationsarrayoptionallyArray with location IDs. If used, the API response will return products available in the listed locations. Locations must be specified in the XML product feed.
brandsarrayoptionallyArray with brand names. If used, only the products of the listed brands will be returned in the API response. Brands must be specified in the XML product feed.
exclude_brandsarrayoptionallyArray with brand names. If used, the API response will exclude the products of the listed brands. Brands must be specified in the XML product feed.
categoriesarrayoptionallyArray with category IDs. If used, the API response will only return products that are included in the listed categories.
discountbooleanoptionallyIf used with "true" value, then only those products, the value of which is less than the "oldprice" value, will be returned in the API response. The old price must be specified in the XML product feed.

...

Code Block
languagejs
r46("recommend", "dynamic", {item: 100500, exclude: [3, 14, 159, 26535], category: 146, search_query: "To be or not to be", limit: 15, brands: ["Alas", "poor", "Yorick"], categories: [1, 146, 100500]}, function(response) {
  // the functionality of rendering a block of product recommendations
}, function(error) {
  // when something went wrong
});

...