Eureka Suggestion API
  • 02 May 2024
  • 1 Minute to read

    Eureka Suggestion API


      Article Summary

      Overview

      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 like category and brand. This feature notably improves the user experience, accelerating the search process and effectively directing users to their intended queries.

      Endpoint 

      You can use two domains to use the Suggestion API:

      • eureka.api.useinsider.com
      • ineureka.api.useinsider.com

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

      Your title goes here
      We suggest you use the domain ineureka.api.useinsider.com due to security convenience.

      When the request is sent in 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 searchedStringl=en_USYes
      pThis is your partner ID. Navigate to InOne > InOne Settings > Account Preferences to copy your partner ID.String10000000Yes
      lLocale is required to get partner products in the current language of the website. Stringq=sneakersYes
      Your title goes here
      The q parameter in the query should include a minimum of 2 characters and a maximum of 280 characters. Otherwise, a validation exception will occur.

      Sample Responses

      API 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 where suggested phrases and their types are kept as a result of the given query.
      validationsWhen the request is incorrect (HTTP 4XX), this field is filled with 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": [
          "..."
        ]
      }

      Fail Records Messages

      • Business Exceptions
      MessageDefinitionHTTP Code
      PartnerConfigNotFound
      Partner config cannot be gathered from the cache.400
      • Validation Exceptions
      MessageDefinitionHTTP Code
      QueryNotFoundq parameter is not provided in the request.400
      QueryInvalidFormat
      The wrong query format is provided in the request.
      400
      QueryInvalidLength
      The query must contain the number of characters between 2 and 280.200

      Was this article helpful?

      ESC

      Eddy, a super-smart generative AI, opening up ways to have tailored queries and responses