Eureka Popular Search API

Prev Next

The Popular Search API returns trending search terms for a specified account and locale. It powers the Popular Searches module in Eureka, helping users discover high-demand and trending queries in real time. By analyzing aggregated search behavior, this API enhances product discovery and increases user engagement within the search experience.

Endpoint

GET https://{domain_name}/api/web/suggestions/search-highlights

When the request is sent without proper authentication, an authentication exception is thrown for security reasons. Therefore, when sending the request, set the X-AUTH-TOKEN header to the token you were provided.

This endpoint can return both Recent Searches and Popular Searches. However, this content focuses only on the Popular Searches response.

Request Parameters

ParameterDescriptionData TypeSampleRequired
pThis is your partner ID. Navigate to InOne > Inone Settings > Account Settings to copy your partner ID.String10000000Yes
lLocale is required to get your products in the current language of the website. Stringen_USYes
uIdentifier for the end user making the requestStringuser_abc123Yes
insightTypesTypes of insights to retrieve.Array of String["popular"]Yes
The insightTypes parameter indicates the type of analysis you want to retrieve. It supports only two values: "recent" and "popular".
Therefore, insightTypes can be ["recent"], ["popular"], or a combination such as ["recent", "popular"].

Get Recent and Popular Searches in a single request

To retrieve both recent and popular searches in a single request, include both insight types in the insightTypes parameter:

Sample Request

GET /api/web/suggestions/search-highlights?p=10000000&l=en_US&u=user_abc123&insightTypes=recent&insightTypes=popular
X-AUTH-TOKEN: your_token_here

This will return both the user's recent search history and trending popular searches for the given locale in a single response.

Sample Response

{
  "status": "Success",
  "data": {
    "recent_searches": [
      {
        "id": "rs_001",
        "display": "wireless headphones"
      },
      {
        "id": "rs_002",
        "display": "laptop stand"
      },
      {
        "id": "rs_003",
        "display": "ergonomic keyboard"
      }
    ],
    "popular_searches": [
      "smart watch",
      "bluetooth speaker",
      "phone case",
      "charging cable",
      "screen protector"
    ]
  },
  "error": null,
  "validations": null
}

Sample Responses

ParameterDefinition
statusIt shows the results of popular searches. This field can be:
- Success: Popular Search API response is valid.
- Error: Unexpected internal server errors.
- Invalid: Popular Search API returns a Validation Exception. The request is invalid.
- BusinessException: Popular Search API returns a Business Exception. Details are shared in the Validation Exceptions section.
dataContains the actual response payload with the Popular Searches array.
errorArray of error messages when status is Error, BusinessException, or RuntimeException
validationsWhen the request is incorrect (HTTP 4XX), this field contains an array of type and message details.

200 Response Examples

Sample Request

GET /api/web/suggestions/search-highlights?p=10000000&l=en_US&insightTypes=popular
X-AUTH-TOKEN: your_token_here

Success Response

{
  "status": "Success",
  "data": {
    "recent_searches": null,
    "popular_searches": [
      "smart watch",
      "bluetooth speaker",
      "phone case",
      "charging cable",
      "screen protector"
    ]
  },
  "error": null,
  "validations": null
}

500 Internal Server Error

{
  "status": "Error",
  "data": null,
  "error": {
    "code": "500 INTERNAL_SERVER_ERROR",
    "message": "Something went wrong. We are working to solve it. If it continues, you can contact the team."
  },
  "validations": null
}

400 Validation Exception

{
  "status": "Invalid",
  "data": null,
  "error": null,
  "validations": [
    {
      "type": "InsightTypesNotFound",
      "message": "Insight types are not provided."
    }
  ]
}

Fail Records Messages

  • Business Exceptions
MessageDefinitionHTTP Code
PartnerConfigNotFoundYour config cannot be found in the Search Metadata Cache. The specified partner ID does not have configuration data available in the system.400
AnyInsightTypeNotFoundYou do not have any of the requested insight types enabled. Your configuration does not support the requested insight types (recent or popular).400
  • Validation Exceptions
MessageDefinitionHTTP Code
InsightTypesNotFoundInsight types are not provided. The required parameter insightTypes is missing from the request, or it is an empty array.400