Eureka Search API

Prev Next

Eureka’s Search API lets you quickly and smoothly implement our search engine within your website(s) or mobile application(s). Insider One's powerful search engine processes millions of queries monthly, delivering relevant results in under 150-400 ms, regardless of location.

The first step is to send your data in the correct format to Insider One. Eureka will return the results in JSON. The response will include products matching the search criteria, available facet options to refine the results further, and configured merchandising content.

Requirements for Search API

  • The Insider One team should activate Eureka.
  • Product Catalog integration methods (XML, Catalog API, and Clickstream) should be created for product details.
  • Eureka settings, such as facets, sorting options, synonyms, URL redirections, etc., should be defined on the Insider One's InOne panel.

Endpoint 

GET https://ineureka.api.useinsider.com/api/web/search

For requests with a total length, which is the length of the entire URL, exceeding 2048 characters, a POST request must be sent to the base URL (https://ineureka.api.useinsider.com/api/web/search). Although the specification of the HTTP protocol does not specify any maximum length, practical limits are imposed by web browsers and server software. We take the length limitation as a precaution to meet these limits and avoid problems. GET requests may return faster responses, but we highly suggest you consider this when the payload length increases up to 2000+ characters.

Visit our Postman collection to test this request.

The only difference between GET and POST requests is that the values sent as URL parameters in GET requests must be sent as JSON body in POST requests, as you can see below:

{
  "q": "SEARCH_QUERY",
  "p": "PARTNER_ID",
  "l": "LOCALE",
  "c": "CURRENCY"
}

Bear in mind that, for security reasons, an authentication exception is thrown when the request is sent. To avoid this, you need to set the X-AUTH-TOKEN field in the header with the token while sending the request.

Request Parameters

ParameterDescriptionData TypeRequiredExample
qQuery String that will be searchedStringYesq=sneakers
pThis is your partner ID. To copy your partner ID, navigate to InOne > Inone Settings > Account Settings.StringYesp=10009999
lLocale is required to receive your products on the website in the current language. Depending on this, product data will be gathered, and the settings will be applied.StringYesl=en_US
cThe searched products will be displayed in the given currency, as written in the catalog(the current currency the end user selects on your website).StringYesc=USD
psPage size. The number of products will be displayed on the search results page. For example, if the phone is searched with ps=6, the API will bring the most relevant 6 phones to the current page. The default value is ps=6.IntegerNops=6
pfPage from. Index where the searched products will start in the response. It is used for pagination. For example, if "phone" is searched and the second page is clicked, the request must be sent with pf=6 if ps is set as 6. Results from the 6th product will be displayed. The default value is pf=0.IntegerNopf=12
aFilter the products with the following pattern: a={field}~{value}. It is applied when the end-user selects a filter from the facet section.List of StringNoa=size~38~39
stSorting type of the searched products. It only takes one of the predefined sorting types. The default value is relevancy.StringNost=Relevancy
uThe User ID. It can be found in local storage under the key name spUID. This key stores a stringified object containing data (the User ID) and expiration (the expiration timestamp). The User ID or Unique User ID must be sent if the personalized search is enabled.StringNou=15ca72d9c3.61d3
uuidThe Unique User ID. You define and manage the unique user ID. If u is not provided, the uuid must be sent to enable personalized search results. If both uuid and u parameters are provided, the u parameter takes priority.StringNouuid=26522777
oiThe searched products will only be displayed as item IDs. The default value is false.BooleanNooi=False
qsApplied strategies of the search query. It only takes an encoded string auto-generated by the first query in the response.StringNoqs=UCxQUA==
The query q parameter should contain at least 2 and 280 characters. Otherwise, a validation exception will be thrown.
The qs parameter should not be included in the initial request made by the end user for a query. You can find it in the response body after the first result returns. However, it needs to be added in subsequent requests when applying the facet filter for the same query. Otherwise, the request is accepted as a new query, and the search results may differ.

Sorting

The st parameter in the request can only have one value from the predefined sorting types. These types select the sorting algorithm for the searched products. Depending on your data, the sorting types can be active or inactive. You can view these settings on the InOne panel.

ParameterSorting Type
stRelevancy
stPriceAsc
stPriceDesc
stMostPopularFirst
stBestRatedFirst
stMostRatedFirst
stNewestFirst
stMostFavoriteFirst
stMostDiscountedFirst

Filters

Search results can be filtered using fields in filter settings defined in faceting on the Insider One's InOne panel.

Sample Filter Result Regarding the Filter Config

Sample filter request:

&a=category~Skin~Body Lotions&a=price~5~10

As a result of this filter request, you can see the matched facets in the related result section below:

{
  "itemProperties": {
    "item_card": {
      "price": {
        "EUR": 7.75,
        ...
      },
      "category": [
        "Skin",
        "Body Lotions",
        ...
      ],
      "in_stock": 1,
      ...
    },
    ...
  },
  ...
}

The field values you can use for facet filtering are provided under data.aggregations in the result.

[
  {
    "name": "price",
    "label": "Price",
    "style": "Slider",
    "items": [
      {
        "name": "0~5",
        "min": 0.0,
        "max": 5.0
      },
      {
        "name": "5~10",
        "min": 5.0,
        "max": 10.0
      },
      ...
    ],
    "sequence": 1,
    "itemOrderType": "KeyAsc"
  },
  {
    "name": "category",
    "label": "Category",
    "style": "List",
    "items": [
      {
        "name": "Skin",
        "selected": true,
        "documentCount": 66
      },
      {
        "name": "Body Lotion",
        "selected": true,
        "documentCount": 61
      },
      ...
    ],
    "sequence": 2,
    "itemOrderType": "CountDesc"
  },
  {
    "name": "in_stock",
    "label": "In Stock",
    "style": "Checkboxes",
    "items": [
      {
        "name": "1",
        "selected": false,
        "documentCount": 12
      },
      ...
    ],
    "sequence": 3,
    "itemOrderType": "CountDesc"
  },
  ...
]

"a" parameter should be passed to the request as a query string when the request method is GET, or it should be passed as a list of strings when the request method is POST. The "a" can take multiple fields; each must be stated separately. Also, the field can take multiple values separated by a tilde (~). Field values should be different; if there is more than one value, they should be separated according to the filter pattern.

?a={field}~{value}&a={field}~{value}
{"a": ["{field}~{value}", "{field}~{value}"]}
Filter StyleData Type
PriceNumeric
RatingNumeric
RangeNumeric
SliderNumeric
CheckboxesString
ListString
ToggleBoolean

For filters with numeric data types, such as Slider style, there should be only two values: min and max.

{field}~{minValue}~{maxValue}

Sample Filter Parameters

&a=brand~Mybrand
&a=category~Birds~Cats~Dogs
&a=price~50~100
&a=brand~Mybrand&a=price~50~100

Sample Responses

ParameterDefinition
statusIt is the field that shows the result of the search. This field can be:
- Success: Search API response is valid.
- SuccessFallback: If Search API returns an empty item list, Eureka Search API - sends a request to Recommendation API and returns the items.
- Error: Unexpected internal server errors.
- Invalid: Eureka Search 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 items, sortings, aggregations, navigations, and noResultPageText are kept as a result of a given query.
data.itemsThis field holds the list of properties for the returned items.
data.items.itemIdIt shows the item ID.
* In the case of item variants, the ID refers to the item to be displayed in search results. The item details are kept under data.items.itemProperties. In addition to that, all the variants, including the item displayed, are also stored in data.items.itemVariants
data.items.itemProperties.item_cardThis field holds all of the fields such as original_price, product_attributes (includes list of fields such as review_count, product_brand etc.).
* It includes the price and original_price fields. If this product does not have a discount, these two fields are the same. However, if there is a discount, the price field is equal to the discounted price.
* These fields might vary depending on your account.
data.items.itemVariantsThis field holds all of the variants of an item. The first element of the list is the item to be displayed in search results. The format of data.items.itemVariants items is the same as the data.items.itemProperties.item_card.
* Variants are options of the same item that have different properties. For instance, yellow and red color options of the same t-shirt might be variants of the t-shirt.
* Use of variants may be active or passive, depending on your account.
data.aggregationsThis field holds a list of different aggregations.
data.aggregations.nameThis field holds the aggregation name.
data.aggregations.labelThis field holds the aggregation label (which shows the aggregation's name to the end user).
data.aggregations.styleThis field holds the aggregation style. Possible values:
Checkboxes, Toggle, Rating, Range, Slider, List, None
data.aggregations.itemsThis field holds a list of item fields for the specified aggregation.
data.aggregations.items.nameThis field holds the aggregation item name.
data.aggregations.items.labelThis field holds the aggregation item label.
data.aggregations.items.minThis field holds the minimum value of the aggregation item.
data.aggregations.items.maxThis field holds the maximum value of the aggregation item.
data.aggregations.items.selectedIt is a boolean field that indicates whether the aggregation item is selected.
data.aggregations.items.documentCountThis field holds the total number of documents of the aggregation item.
data.aggregations.suffixUnitThis field holds the suffix unit for the facet values as a string. For instance, for perfume_size facets, ml is the suffixUnit (50ml - 100ml)
data.aggregations.prefixUnitThis field holds the prefix unit for the facet values as a string.
data.aggregations.sequenceThis field holds the aggregation sequence to show the aggregations to the end-user in the correct order.
data.aggregations.itemOrderTypeThis field holds the item order type of the aggregation. Possible values: KeyAsc, KeyDesc, CountDesc, CountAsc, None
data.navigationThis dictionary shows information such as pagination and total item count.
data.navigation.totalPagesThis field shows how many pages are returned for a given query.
data.navigation.currentPageThis field specifies which page the returned result is.
data.navigation.totalItemsThis field shows how many items are returned for a given query.
data.navigation.itemPerPageIt is the field that shows how many items are on a page.
data.noResultPageTextIf a query does not return any results, this field is used for the empty result page. E.g., No Results
data.sortingsIt is the list where the details about sorting are kept.
data.sortings.typeIt is the field where the sorting type is located. Possible sorting types: Relevancy, PriceAsc, PriceDesc, MostPopularFirst, BestRatedFirst, MostRatedFirst,
NewestFirst, MostFavoriteFirst, MostDiscountedFirst
data.sortings.labelIt is the sorting label that is displayed to the end user.
data.sortings.selectedIt is a boolean field that indicates whether the relevant sorting is selected.
data.appliedSearchStrategyThis field holds the encoded string of applied search strategies.
data.brandsThis field holds the list of recommended brands for the given user, if there are any.
*This field is only available when the response status is SuccessFallback.
data.categoriesThis field holds the list of recommended categories for the given user, if there are any.
*This field is only available when the response status is SuccessFallback.
data.defaultSortingTypeIt is the field where the sorting type of the recommended items is located. It is null when no active sorting is found.
redirectionRedirections can be set from the InOne panel. If the given query matches a redirection rule, this field shows the details.
redirection.redirectToThis field holds the URL for the redirection rule.
redirection.redirectionTextThis field holds the redirection text for the redirection banner.
errorWhen there is a business exception (501), this field is filled with code and message fields.
validationsWhen the request is incorrect (400 Bad Request), this field is filled with an array of type and message fields.

200 Search

{ 
  "status": "Success",
  "data": {
    "items": [...],
    "aggregations": [...],
    "navigation": {...},
    "noResultPageText": "...",
    "sortings": [...]
  },
  "redirection": null,
  "partnerResources": {...},
  "error": null,
  "validations": null,
  "appliedSearchStrategy": "..."
}

200 Recommendation

{ 
  "status": "SuccessFallback",
  "data": {
    "items": [...],
    "brands": [...],
    "categories": [...],
    "noResultPageText": "...",
    "defaultSortingType": null
  },
  "redirection": null,
  "partnerResources": {...},
  "error": null,
  "validations": null,
  "appliedSearchStrategy": "..."
}

400 Validation Exception

{ 
  "status": "Invalid", 
  "data": null, 
  "redirection": null, 
  "partnerResources": null,
  "error": null,
  "validations": [
    {
      "type": "...",
      "message": "..."
    }
  ],
  "appliedSearchStrategy": null
}

400 Business Exception

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

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 second."
    },
    "validations": null,
    "appliedSearchStrategy": null,
    "merchandisingRuleBanner": null
}


500 Internal Server Error

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

Fail Records Messages

  • Business Exceptions
MessageDefinitionHTTP Code
AggregationStyleNotFoundAggregation style must be provided in the partner config.400
AggregationConfigNotFoundAggregation configs must be provided in the partner config.400
SortingConfigNotFoundSorting configs must be provided in the partner config400
SortingFieldNotFoundThe sorting field must be provided in the partner config.400
UnsuccessfulSearchResultThe search results cannot be collected as expected.400
InvalidPriceAggregationStyleThe incorrect style for price aggregation is provided in the partner config.400
PartnerConfigNotFoundPartner config cannot be gathered from the cache.400
AggregationResultNotFoundUnexpected aggregation results were received according to the aggregation configs.400
RecommendationApiBrandFieldNameNotFoundName for the brand field used by the Recommendation API cannot be found in the partner configuration.400
LocalizationLanguageSettingsNotFoundLocalization language settings are not defined.400
QueryStrategyIsNotValidThe query strategy parameter passed is not valid and must be taken from the initial response.400
  • Validation Exceptions
MessageDefinitionHTTP Code
PartnerIdNotFoundp parameter is not provided in the request.400
LocaleNotFoundl parameter is not provided in the request.400
LocaleInvalidFormatThe request provides an incorrect locale format.400
CurrencyNotFoundc parameter is not provided in the request.400
CurrencyInvalidFormatThe request provides the wrong currency format.400
QueryNotFoundq parameter is not provided in the request.400
QueryInvalidFormatThe request contains an incorrect query format. 400
QueryInvalidLengthThe query must contain the number of characters between 2 and 280.200
PaginationFromInvalidValueThe wrong pf value is provided in the request.400
PaginationSizeInvalidValueThe wrong ps value is provided in the request.400
PaginationMaxHitSizeExceededPagination exceeds the allowed maximum size.400
AggregationNameNotFoundAggregation name must be provided in the request.400
AggregationItemsNotFoundAggregation items must be provided in the request.400
AggregationInvalidValueAggregation items must be valid values.400
AppliedSearchStrategiesAreRepeatedApplies strategies must be unique.400
SortingTypeInvalidThe wrong st value is provided in the request.400
  • 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 Search API has a rate limit of 350 requests per second (RPS) per account-locale pair. If you would like to request a higher limit, contact the Insider One team.