- 02 May 2024
- 1 Minute to read
Eureka Suggestion API
- Updated on 02 May 2024
- 1 Minute to read
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
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
Parameter | Description | Data Type | Sample | Required |
---|---|---|---|---|
q | Query String that will be searched | String | l=en_US | Yes |
p | This is your partner ID. Navigate to InOne > InOne Settings > Account Preferences to copy your partner ID. | String | 10000000 | Yes |
l | Locale is required to get partner products in the current language of the website. | String | q=sneakers | Yes |
Sample Responses
API Responses
Parameter | Definition |
---|---|
status | It 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. |
data | It is the object where suggested phrases and their types are kept as a result of the given query. |
validations | When 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
Message | Definition | HTTP Code |
---|---|---|
PartnerConfigNotFound | Partner config cannot be gathered from the cache. | 400 |
- Validation Exceptions
Message | Definition | HTTP Code |
---|---|---|
QueryNotFound | q 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 |