SearchService class (accessed via client.search) provides keyword search, type-ahead suggestions, and semantic search.
Methods
searchProducts
Fast, keyword-based search optimized for exact matches, SKUs, and product names. It uses case-insensitive partial matching to find relevant results quickly.
Response
Misspellings
When exact matching finds nothing, the query is retried against a similarity match over product names and brands, so a typo still reaches the product. Those results carry amatchReason of Similar name or Similar brand rather than Text match,
which lets you label them — “showing results for snowboard” — instead of presenting an approximate
match as an exact one. Exact matches always rank first: the fallback runs only when there were none,
so a query that already worked behaves exactly as before.
Response
autocompleteSearch
Suggestions for a partial query, for a search box that completes as the shopper types. Call it on
each keystroke from the second character; it returns terms to suggest, not products, so run
searchProducts once the shopper picks one.
Suggestions come from what the store actually sells — its product names, its brands, and the
merchant’s own subcategories — so there is nothing to configure and nothing that drifts from the
catalogue. Each carries a kind so you can group or badge them.
Prefixes match first, with similarity as a fallback, so a suggestion still appears when the first
characters are already mistyped. Fewer than two characters returns an empty list with a 200 — a
shopper mid-word has not done anything wrong.
Response
semanticSearch
AI-powered, meaning-based search that understands intent and context. This allows customers to find products using natural language descriptions even if they don’t know the exact product name.
Key Support: Both Secret Keys and Publishable Keys are supported for semantic search, allowing you to implement AI-powered search directly in your frontend.
Response
Personalized results
Passpersonalize: true together with a credential identifying the shopper to nudge results toward
their preferences. Query relevance stays primary — relevance is blended with the shopper’s
preference signal, not replaced — so results remain on-topic. Without a customer session, or for a
shopper with no preference signal yet, ranking is by query relevance only.
Send whichever credential matches how the shopper signed in — the same three this API accepts
everywhere a shopper is identified:
Personalization is best-effort: an absent, expired, or invalid credential returns unpersonalized
results rather than an error, so search never fails because a session lapsed.
Merchandising
A merchant can place results deliberately for a query or a family of queries, from their own admin. There is nothing to request or configure on the client — the order you receive already reflects it, and a store with no rules behaves exactly as it did before.
A rule matches a query either exactly or by substring, can be limited to a date range, and carries a
priority that decides the winner where two rules overlap. Each rule can name up to twenty products.
Rules reorder; they never conjure. They are applied after ranking and only to products the query
already matched, so a rule cannot introduce an unrelated product, and a pinned product that has been
deleted, taken offline, or is otherwise not sellable simply does not appear. Nothing a merchant hides
becomes visible through a pin.
One consequence is worth building for: a pinned product is fetched and merged in even if it ranked
below the page you asked for, because “float it to the top” would otherwise do nothing for exactly the
products a merchant most wants pinned. The
limit you asked for is still honoured.
Pinned and boosted results carry a matchReason of Featured by the store. That is the signal to
build against if you want to distinguish a deliberate placement from an earned one:
Merchandising rules are authored in the merchant’s admin, not through this API — placing your own
products in someone’s search results is not something an integration should be able to do. The API
reflects the merchant’s decisions; it does not set them.
Comparison: Text vs. Semantic
Why is
semanticSearch a POST? POST /v1/search is intentionally accessible to publishable keys despite using the POST verb. It is a read-only operation — POST is used purely to support complex JSON request bodies (query, minScore, filters). No state is mutated and no 403 is returned for publishable keys.Response Codes
Both methods accept publishable and secret keys.searchProducts is GET; semanticSearch is POST (read-only).

