Developer docs / Integrations

Search API

The storefront search and autocomplete endpoints, their parameters and answers, and the owner endpoints for the index.

In the dashboard: GET /api/search, GET /api/search/suggest, /api/owner/search/*

Why use it

Why: a headless storefront, an app or an agent needs the same search the store's own pages use, with its languages, synonyms, rules and ranking. How: two public endpoints on the store's address, and owner endpoints behind the owner token (Store APIs). The full schema is in the store's OpenAPI document at /api/openapi.json.

GET /api/search/suggest

Why: shoppers pick a suggestion while they type and never land on an empty page. How: from two characters, q and an optional locale (for prices). The answer: terms (popular searches and completions, each with how many products it finds), categories (collections with their size), up to four products (title, href, price, image), total and more (true when the words find more than total: show "200+"). Answers are the same for every shopper and kept a minute at the edge; 180 requests per client address a minute.

curl "https://<store>/api/search/suggest?q=cha&locale=de"

Owner endpoints

EndpointWhat it does
GET /api/owner/searchThe same search over all products (status=all, active or hidden), limit up to 100.
GET /api/owner/search/indexThe index: how many changed products wait, and the full reindex (status queued, running, done or failed; done and total products; reason; when it started and finished). Reading it also starts a reindex a new main language needs, and wakes one that stalled.
POST /api/owner/search/index/rebuildRebuild the whole index in the background (202). Searches use the current index until the new one is complete; a rebuild already running for the store's language goes on.
GET /api/owner/search/analyse?text=&locale=What the analysers make of a text: its index words, and a query's forms and translations.
/api/owner/search/synonyms, stop-words, rules, weights, personalisation, testsThe settings of the dash pages (see the OpenAPI document).

Reads per search

Why: the store's database bills every row a query reads, so a search's reads are its price. How: every search reads a bounded part of the index: at most 4,000 documents of each of two sets (title, collections and keywords; everything), ranked by bm25 with the field weights, then the best 1,000 products. On a 100,000-product store in four languages a search that finds 1,000 products reads about 40,000 to 65,000 rows, a precise one a few hundred; a suggestion 8,000 to 45,000 on a miss of the minute-long cache.