Get a Dynamic Image

Filter Specification

Each filter parameter corresponds to a constraint for the recommendations to be returned in a recommendation set. If more than one filter parameter is used, the result will be interpreted as the intersection of the filters, i.e. filter1 ∩ filter2 ∩... For example, adding filters ?filter=resource-type::article&filter=keywords::dogs would filter the section to articles with the "dogs" keyword.

Filters are specified in the format name:operator:value as follows:

name - A string that indicates which field of your resource the filter will be applied to, e.g. "resource-type", "pubDate", "keywords".
operator - The operator for the filter. Filter operators allow you to specify relations between the filter values. Supported filters include:

OperatorValues AcceptedInterpretationExample
afterA single ISO-8601 Duration string.Can only be applied to timestamp fields such as pubDate and modDate. Returns resources with a timestamp after the end of the provided duration.?filter=pubdate:after:-P7D // pubDate after seven days ago.
beforeA single ISO-8601 Duration string.Can only be applied to timestamp fields such as pubDate and modDate. Returns resources with a timestamp before the beginning of the provided duration.?filter=expDate:before:P1D // expDate before 1 day from now.
betweenTwo ISO-8601 Duration strings.Can only be applied to timestamp fields such as pubDate and modDate. Returns resources with a timestamp after the first provided value and before the second provided value. ?filter=pubDate:between:-P2D|-P1D // pubDate between 2 days ago and 1 day ago.
notAny number of strings.Returns results where the field does not match any of the provided values.?filter=keyword:not:dogs|cats // keywords contains neither dogs nor cats.
If no operator is specified, we check the fields for equality. For example:
  • The filter ?filter=keywords::dogs|cats will filter to resources that contain either "dogs" or "cats" as a keyword. Note that resource fields with an array type will consider an equality operation to be "true" if _any_ of the values in the array matches the specified value.
  • The filter ?filter=colors::red will filter to resources with the "red" value in the "colors" field.

values - Strings representing the fields of the resource to filter the recommendation to, separated by '|' characters.

📘

Special Character Encoding

Note that all filters should be URL-encoded (e.g. commas should be %2C, spaces should be %20).

Language
Click Try It! to start a request and see the response here!