Skip to main content

API Parameters Reference

This page provides a comprehensive reference for all parameters supported by the Recommendations API.

Required Parameters

At least one of these parameters is required for every API call:

ParameterTypeDescription
currentUrlstringURL used to determine which route to use. Required unless routeName is provided.
routeNamestringDirectly specify which recommendation route to use. Can be used instead of currentUrl.

Common Parameters

These parameters are frequently used to customize recommendations:

ParameterTypeDefaultDescription
customerIdGUID-User identifier for personalized recommendations. Required for personalized results like Recently Viewed items.
refIdstring-Product ID/reference for PDP recommendations. Critical for "Similar Items" and "Frequently Bought Together" recommendations.
productsInCart[]array-Array of product IDs currently in the cart. Format: productsInCart[0]=product1&productsInCart[1]=product2
expandProductDetailsbooleanfalseWhen true, returns complete product information. When false, returns only refId and isInStock.
showInStockOnlybooleantrueControls whether out-of-stock products are included in recommendations.

Content Customization Parameters

These parameters control the content returned in recommendations:

ParameterTypeDefaultDescription
returnMultipleProductsInSlotbooleanfalseWhen true, may return multiple products per slot based on configuration.
maxNumberOfProductWithinASlotinteger-Limits the maximum number of products per slot. Only applies when returnMultipleProductsInSlot is true.
languageTagstring-Language code for localized content (e.g., "en-US", "fr-FR"). When provided, returns product information in this language if available.
currencyCodestring-ISO currency code (e.g., "USD", "EUR") for pricing. When provided, converts and displays prices in this currency if supported.

Advanced Filtering Parameters

These parameters provide advanced filtering capabilities:

ParameterTypeDescription
indexFilterValuestringFilters recommendations based on specific indexed values/attributes in your catalog.
searchQuerystringIncorporates a search term to influence recommendations, returning products related to both the current context and the search.
elementsarrayAdvanced targeting using CSS-like selectors and values. Each ElementSelector contains a selector (s) and array of values (v).
customerSegmentsarrayAudience Feed Ids that have been added in the Audience Feed.

Runtime Filters

Runtime filters allow you to narrow down recommendation results at request time without changing your campaign or tactic configuration. Filters are evaluated against each candidate product before the response is returned.

info

Limits: A maximum of 5 filters are evaluated per request — filters beyond the first 5 are ignored. Each filter value must be 50 characters or less — values exceeding this limit are ignored. Filters are applied in the following order: brandpriceref_idstring_attributescalar_attribute.

Filter Operators

Filters follow one of two structures, depending on whether the target field is a string or a numeric value:

String filter — for string fields (brand, ref_id, string_attribute)

OperatorQuery syntaxDescription
eqbrand[eq]=nikeExact match (case-insensitive).
inbrand[in]=nike,pumaIncludes only products whose value matches one of the listed values.
not_inbrand[not_in]=foo,barExcludes products whose value matches any of the listed values.

Scalar filter — for numeric fields (price, scalar_attribute)

OperatorQuery syntaxDescription
eqprice[eq]=99.99Exact numeric match.
gteprice[gte]=50Greater than or equal to.
gtprice[gt]=50Strictly greater than.
lteprice[lte]=200Less than or equal to.
ltprice[lt]=200Strictly less than.
Combining Filter Operators

AND conditions — Multiple operators on the same field are evaluated as AND. For example, price[gte]=50&price[lte]=200 matches only products priced between 50 and 200.

OR conditions — Multiple values inside a single in operator are evaluated as OR. For example, brand[in]=nike,puma matches products from either Nike or Puma.


Built-in Filter Parameters

ParameterQuery syntax examplesDescription
brandbrand[in]=nike,puma | brand[not_in]=fooFilter by product brand name.
ref_idref_id[not_in]=123,456 | ref_id[in]=789Include or exclude specific product reference IDs.
priceprice[gte]=50&price[lte]=200Filter by product price. Uses currencyCode when provided; otherwise falls back to the first available price. Applies to the discounted price when a discount is active.

Dynamic Attribute Filters

For product attributes beyond the built-ins, use the string_attribute and scalar_attribute dictionaries. The attribute name is specified as part of the query key.

string_attribute (string filter per attribute)

string_attribute[<attributeName>][<operator>]=<value>
ExampleDescription
string_attribute[category][in]=football,sportReturns only products in the football or sport category.
string_attribute[color][eq]=redReturns only products with a color value of red.
string_attribute[color][in]=red,blueReturns only products with a color value of red or blue.
string_attribute[color][not_in]=black,whiteExcludes products with a color value of black or white.

scalar_attribute (RangeFilter per attribute)

scalar_attribute[<attributeName>][<operator>]=<value>
ExampleDescription
scalar_attribute[rating][gte]=4.5Returns only products with a rating of 4.5 or higher.
scalar_attribute[weight][lte]=10Returns only products with a weight value of 10 or less.

ElementSelector Format

The elements parameter uses a special format for advanced content selection:

// Example elements parameter structure
elements: [
{
s: "category", // Selector
v: ["mens", "clothing"] // Values
},
{
s: "price-range",
v: ["100-200"]
}
]

When making API calls, these would be formatted as query parameters:

&elements[0][s]=category&elements[0][v][0]=mens&elements[0][v][1]=clothing&elements[1][s]=price-range&elements[1][v][0]=100-200

Parameter Usage Examples

Basic Product Detail Page Request

GET https://<PA_END_POINT>/3.0/recommendations?currentUrl=https://www.example.com/product/12345&refId=12345

Language and Currency Specific Request

GET https://<PA_END_POINT>/3.0/recommendations?currentUrl=https://www.example.com&languageTag=fr-FR&currencyCode=EUR

Personalized Recommendations with Cart Context

GET https://<PA_END_POINT>/3.0/recommendations?currentUrl=https://www.example.com&customerId=3fa85f64-5717-4562-b3fc-2c963f66afa6&productsInCart[0]=item1&productsInCart[1]=item2&expandProductDetails=true

Advanced filtering with audience feed IDs

GET https://<PA_END_POINT>/3.0/recommendations?currentUrl=https://www.example.com&customerSegments[0]=3fa85f64-5717-4562-b3fc-2c963f66afa6&customerSegments[1]=8b4fcb98-5b10-4e2a-9c7d-1a2b3c4d5e6f&indexFilterValue=department:electronics

Runtime Filter Examples

Filter by brand (inclusion)

GET https://<PA_END_POINT>/3.0/recommendations?currentUrl=https://www.example.com&brand[in]=nike,adidas

Filter by price range

GET https://<PA_END_POINT>/3.0/recommendations?currentUrl=https://www.example.com&price[gte]=50&price[lte]=200&currencyCode=USD

Exclude specific products from results

GET https://<PA_END_POINT>/3.0/recommendations?currentUrl=https://www.example.com&ref_id[not_in]=123,456,789

Filter by category and minimum rating

GET https://<PA_END_POINT>/3.0/recommendations?currentUrl=https://www.example.com&string_attribute[category][in]=football,sport&scalar_attribute[rating][gte]=4.0

Combine multiple filters

GET https://<PA_END_POINT>/3.0/recommendations
?currentUrl=https://www.example.com
&brand[in]=nike,puma
&price[gte]=30&price[lte]=150
&string_attribute[color][not_in]=black