Skip to content

Search API

GET
View MD

Use the search endpoint to build fulltext search with advanced filtering, faceting, ranking, and merchandising capabilities.

To use Search well, make sure your product data is synchronized with Luigi’s Box. See Indexing for setup details. Search relevance can also learn from user behavior, so you should integrate Analytics alongside the API.

ParameterTypeRequiredDescription
tracker_idstringYour unique site identifier within Luigi’s Box.
qstringThe user’s search query. Optional when f[] filters are provided.
ParameterTypeDescription
user_idstringIdentifier used for personalization. For authenticated users, use the analytics customer_id. For anonymous users, use the analytics client_id. Omit for non-personalized requests. See User identification and Events API common parameters.
client_idstringStable anonymous identifier. Must match the client_id sent in analytics. See Events API common parameters.
ParameterTypeDescription
f[]stringFilter results using key:value syntax, for example category:Shoes. Filters on the same field are combined with OR, filters on different fields are combined with AND, and numeric/date ranges use the pipe character such as `price:10
neg_f[]stringExclude results using key:value syntax, for example category:Shoes. Negative filters on the same field exclude hits matching any of the provided values. Numeric and date attributes support ranges using the pipe character, such as `price:10
f_must[]stringApplies filters with strict AND logic. Useful when you need multiple required values on the same field.
sizeintegerNumber of hits to return. Default: 10. Maximum: 200.
sortstringSort order in field:direction format, for example price:asc. Explicit sorting overrides the default AI ranking. Sorting by distance requires context[geo_location].
sort_typestringSorts specific result types only, for example sort_item=price:asc.
quicksearch_typesstringComma-separated secondary content types to include in quicksearch_hits, such as category,brand.
facetsstringComma-separated list of facets to return. You can limit values per facet using :count, for example brand,color:5.
dynamic_facets_sizeintegerMaximum number of additional AI-selected facets. Default: 0.
pageintegerResult page number. Default: 1.
fromintegerResult offset. Alternative to page.
use_fixitsbooleanControls automatic typo correction and redirects. Default: true.
prefer[]stringSoft filters used for query-time boosting. Syntax is the same as f[], but non-matching items are not excluded.
ParameterTypeDescription
ctx[]stringArbitrary context tags for model selection, for example warehouse:berlin. These must match analytics contexts.
qubooleanEnables Query Understanding. When true, Search may return a suggested_url. Send it only together with user_id.
ParameterTypeDescription
hit_fieldsstringComma-separated list of fields to include in the response attributes.
remove_fieldsstringComma-separated list of fields to exclude from the response.
non_collapsed_variantsbooleanReturns variants as individual hits instead of nesting them under a parent product. Default: false.
ParameterTypeDescription
context[geo_location]stringUser coordinates in lat,lon format. Required for distance filtering and distance sorting.
context[geo_location_field]stringCatalog field that contains coordinates. Default: geo_location.
context[availability_field]stringCustom field used for availability ranking. Must contain 0 or 1.
context[availability_rank_field]stringCustom field for detailed availability ranking with integer values 1 to 15.
context[boost_field]stringCustom numeric boost field with values 0 to 3.
context[freshness_field]stringCustom ISO 8601 date field used for freshness ranking.
HeaderValueRequiredDescription
Accept-Encodinggzip, deflateRecommendedEnables compressed responses.

To make a request:

  1. Send a GET request to https://live.luigisbox.com/search.
  2. Include tracker_id and optionally q.
  3. Pass filters, facets, sorting, and personalization through query parameters.
  4. Keep hit_fields tight to reduce payload size when building a custom UI.

For a full walkthrough, see Quickstart: Search.

The response is a structured JSON object containing top-level results and next_page fields.

FieldDescription
queryRequested query string.
corrected_queryQuery correction markup when the query was altered.
total_hitsTotal number of hits for the requested type.
hitsResult objects for the requested type.
facetsFacets and their counts. Filtered facets return all values to support multi-select.
filtersFilters applied to the results.
quicksearch_hitsResults for secondary types requested via quicksearch_types.
suggested_facetOptional facet suggested for narrowing the result set.
suggested_urlOptional redirect URL for direct-match or fixit behavior.
campaignsBanner campaigns associated with the query.
FieldDescription
urlUnique identifier of the result object.
attributesCatalog fields stored for the hit, such as title, brand, or price.
pinnedPresent when the result was added by customization.
typeResult type, for example item.
nestedNested objects associated with the hit, such as variants.

The API uses standard HTTP status codes to indicate success or failure.

HTTP StatusDescription
200 OKThe request succeeded and results are returned.
400 Bad RequestThe request was malformed — missing or invalid parameters.
404 Not FoundThe tracker_id does not match any known catalog.
500 Server ErrorInternal error. If persistent, contact support.
504 Gateway TimeoutThe request took too long to process. Retrying may succeed.