Skip to main content
This guide has not been updated for our v3 API. The endpoints section in the navigation has, though.
Depict Search and PLP is provided through a number of API endpoints:
  1. Search Results
  2. Search Query Suggestions
  3. Search recommendations
  4. Category Listings
Search and PLP have very similar functionality, which means that the API for Search Results and Category Listings are very similar. Ignoring everything besides the result page, the flow looks like this:
  1. User inputs a query and hits enter
  2. Website sends a POST request to https://api.depict.ai/v2/search/results containing a SearchRequest
  3. Depict responds with a SearchResponse -> the UI is updated.
  4. User refines the search, either through modifying the query or the filter states.
  5. Website sends another POST request with a modified SearchRequest.
  6. Depict responds with an updated SearchResponse -> the UI is once again updated.

API types specification

SearchRequest

TypeScript

SearchResponse

TypeScript

SortModel

Depending on merchant configuration, different sort modes might or might not be available. The default mode relevance is always available.
TypeScript

Filters

Which filters are available depends on the merchant configuration so need to be handled dynamically. Depending on the setup different filters might be available for a subset of product attributes are. There are currently three types of filters:
  1. RangeFilter - lets the user filter numeric values, such as “price between 100 and 500”
  2. ValueFilter - lets the user filter discrete values, such as “Color is red or blue” or “Only second hand”
  3. HierarchicalValueFilter - like ValueFilter but presents items in a hierarchy, typically used for categories
The base filter structure looks like this:
TypeScript
When a user have interacted with a filter it should be included in the filters array of a new SearchRequest. When doing so, field, data and op are what’s mandatory to include for every filter object. data is the field where the current state should be stored.

RangeFilter

For this filter data is an array containing the range selected, in the format [min, max].
TypeScript

ValuesFilter

The type of the filter represents the UI behaviour. In a radio filter only one value can be selected at a time, where in a checkbox filter multiple values can be selected. A checkbox-grid works the same as a checkbox filter, but the UI should be more compact by being formatted as a grid instead of a list. checkbox-grid is usually used for sizes of clothes, where there are many options available. For this filter data should be a list containing the selected values.
TypeScript

HierarchicalValuesFilter

The data represents a tree of values, some of which might be selected. Note that if a parent is selected all children must also be selected. Here’s an example of a category tree where the user has clicked on Shirts and Jeans:
  1. Clothes
    1. Shirts
      1. Cotton Shirts
      2. Linen Shirts
    2. Pants
      1. Jeans
      2. Shorts
The corresponding data is a list of lists representing the path of the selected nodes, like this:
TypeScript
TypeScript