EmpathyX request flow

The purpose of this document is to explain a normal requests flow at EmpathyX. Which APIs are we calling, when are we calling them and which parameters are needed...

These requests are already explained under our Empathy Search REST API public documentation

Opening EmpathyX

Once EmpathyX opens, we make 2 requests.

One for the top clicked (Search REST API: TopClicked) products, and another one to get the popular searches (Search REST API: Empathize).

The purpose of this two requests is to show the most popular products and queries when the user has not typed any search query yet. Also, we usually show the user history in this state too, but as it is stored on the `localStorage`, we don't have to make any request.

Top clicked on empty search

Depending on where these top clicked products are shown on the designs (outside of the empathize, or inside of it), we send `empty_search` or `empathize_recommendations` as the origin parameter to the request, so the results come with an `ebTagging` property with the proper tagging URLs we need to call to when the user triggers one of those events (add to cart, click, or conversion).

For example, if the top-clicked products are shown outside the empathize we use this request:


On the other hand, if these top-clicked products are shown inside the empathize, we must tag them with the empathize_recommendations origin, using this call:


Popular searches

Popular searches are displayed commonly inside the empathize. For retrieving them, we just have to make a call to the empathize (Search REST API: Empathizeendpoint without a query.

Whenever a user clicks on one of these suggestions, we must track the query (Tagging REST API: TrackQuery), with the origin empathize_trending.

Next queries suggestions


This suggestions depends on the last query we have done. It will be shown when this last query has next queries associated. They are displayed differently depending on whether there is query in the search box or not.

To visualize these kind of suggestions we have to make a call of this type:



This is the call we use to show suggestions requested to the empathize endpoint:


Search response

This is the call we use to retrieve search results:


Related tags

Related Tags are a great tool to help users articulate a more specific query. They provide refinement suggestions that are inferred through collaborative filtering 

To visualize these related tags we have to make a call of this type:


Next queries

Next Queries: users get exposed (see use cases below) to the queries that are contextually relevant to their current ones. Next queries are generated from all users who previously searched with that/those terms, what they did next.

To visualize text queries we have to make a call of this type:


Partial results

When we search for more than one term and have no results, this functionality will show us the results for each of the queries.


Top clicked (no results)

This is the call we make to show top clicked when a user´s query has no results: