Eureka Suggestion API

Prev Next

The Suggestion API offers query recommendations as users type into a search bar. It analyzes the input text and returns a list of relevant suggestions in real time, based on user history and other contextual information such as category and brand. This feature notably improves the user experience, accelerating the search process and effectively directing users to their intended queries.

Endpoint 

GET https://{domain_name}/api/web/suggestions/query

Visit our Postman collection to test this request.

When the request is sent this way, an authentication exception is thrown for security reasons. Therefore, when sending the request, you need to set the X-AUTH-TOKEN field in the header with the token shared with you and send the request.

Request Parameters

ParameterDescriptionData TypeSampleRequired
qQuery String that will be searchedStringq=sneakersYes
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. Stringl=en_USYes
The q parameter in the query should be between 2 and 280 characters. Otherwise, a validation exception will occur.

Sample Responses

ParameterDefinition
statusIt is the field that shows the result of the suggestion. This field can be:
- Success: Suggestion API response is valid.
- Error: Unexpected internal server errors.
- Invalid: Suggestion API returns a Validation Exception. The request is invalid.
- BusinessException: Eureka Search API returns a Business Exception. Details are shared in Validation Exceptions section.
dataIt is the object that stores the suggested phrases and their types resulting from the given query.
validationsWhen the request is incorrect (HTTP 4XX), this field contains an array of type and message details.

200 Search

{ 
  "status": "Success",
  "data": [
    {
      "phrase": "..."
      "phraseType": "..."
    }, ...
  ],
  "error": null,
  "validations": null
}

500 Internal Server Error

{ 
  "status": "Error",
  "data": null,
  "redirection": null,
  "partnerResources": null,
  "error": {
    "code": "500 INTERNAL_SERVER_ERROR",
    "message": "..." 
  },
  "validations": null,
  "appliedSearchStrategy": null 
}

400 Validation Exception

{
  "status": "ValidationException",
  "data": null,
  "error": null,
  "validations": [
    "..."
  ]
}

429 Rate Limit Exceeded Exception

{
    "status": "RateLimitExceeded",
    "data": null,
    "redirection": null,
    "partnerResources": null,
    "error": {
        "code": "RATE_LIMIT_EXCEEDED",
        "message": "Rate limit exceeded. Please retry after 1 seconds."
    },
    "validations": null,
    "appliedSearchStrategy": null,
    "merchandisingRuleBanner": null
}

Fail Records Messages

  • Business Exceptions
MessageDefinitionHTTP Code
PartnerConfigNotFoundThe partner config cannot be retrieved from the cache.400
  • Validation Exceptions
MessageDefinitionHTTP Code
QueryNotFoundq parameter is not provided in the request.400
QueryInvalidFormatThe request provides an incorrect query format.400
QueryInvalidLengthThe query must contain between 2 and 280 characters.200
  • Rate Limit Exceeded Exception
MessageDefinitionHTTP Code
RateLimitExceeded
Indicates that the request rate exceeded the allowed limit per account-locale pair.
429
Please note that the Suggestion API has a rate limit of 450 requests per second (RPS) per account-locale pair. If you would like to request a higher limit, contact the Insider One team.