Eureka Recent Search API

Prev Next

The Recent Search API provides endpoints to manage a user’s recent search history. It allows developers to clear all recent searches or remove specific search items as needed. These endpoints serve as utility functions to help maintain clean, relevant, and privacy-compliant recent search lists for each user.

Endpoint to Clear All Recent Searches

GET https://{domain_name}/api/web/query-history/recent-searches/clear

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

Endpoint to Clear a Single Recent Search Item

GET https://{domain_name}/api/web/query-history/recent-searches/clear/item

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
idUnique identifier of the specific recent search item to be removed (obtained from search-highlights response)Stringrs_001Yes

Endpoint to Get Recent Searches

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

This endpoint can return both Recent Searches and Popular Searches. However, this content focuses only on the Recent 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["recent"]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: Recent Search API response is valid.
- Error: Unexpected internal server errors.
- Invalid: Recent Search API returns a Validation Exception. The request is invalid.
- BusinessException: Recent Search API returns a Business Exception. Details are shared in the Validation Exceptions section.
dataContains the actual response payload with the Recent 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

Clear All Recent Searches Request

GET /api/web/query-history/recent-searches/clear?p=10000000&l=en_US&u=user_abc123
X-AUTH-TOKEN: your_token_here

Clear Single Recent Search Item Request

GET /api/web/query-history/recent-searches/clear/item?p=10000000&l=en_US&u=user_abc123&id=rs_001
X-AUTH-TOKEN: your_token_here

Get Recent and Popular Searches Request

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

Success 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": null
  },
  "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
UserIdNotFoundUser ID is not provided. The required parameter u is missing from the request400
ItemIdNotFoundGiven recent search item ID not found. The specified ID parameter does not match any recent search item for the user400