GET /v1/autocomplete
Primary ranked search endpoint.
When the tenant is in search proxy mode, this path forwards to the connected search API. Hosted mode, merchandising, synonyms, personalization, and graph ranking are not applied.
Important query params
queryrequired, minimum 1 characterindexlogical index ID, defaults todefaultlimitfrom 1 to 50modeone offts_only,vector_only,hybrid,fts_rerankbypass_cacheorX-Bypass-Cacheto skip cached responsesfiltersas a JSON string for exact and range filteringuser_idfor personalization-aware ranking- operators in
query: see Query syntax
Query syntax
By default, every word in query must match. diaphragm pump returns only documents that contain both words. The last word matches as a prefix, so diaphragm pu also finds “pump”.
Two operators change this. Put them directly in front of a word, with no space.
| Syntax | Meaning | Example |
|---|---|---|
+word |
Required. The document must contain the word. | +climate |
-word |
Excluded. Documents containing the word are removed. | -coal |
Mixed queries. When a query has at least one +word, only the + words are required. The other words become optional: they do not filter results, but documents that contain them rank higher.
+climate policy: every result contains “climate”. Results that also contain “policy” rank first.+climate +policy report: results contain both “climate” and “policy”. “report” only affects ranking.climate policy: no+, so both words are required (the default).
Exclusions work with or without +:
climate -policy: results contain “climate” and never “policy”.+policy brief -energy -coal: “policy” is required, “brief” is optional, and documents containing “energy” or “coal” are removed.
Excluded words match whole words only, never as a prefix. While a user is still typing -pol, documents containing “policy” are not removed.
Edge cases
- A
-counts as an operator only when a letter follows it.-20 sleeping bagsearches for “-20”. Hyphenated words such ast-shirtare plain text. - A
+counts as an operator only when a letter or digit follows it.c++and a lone+are plain text. - A query that contains only excluded words, such as
-policy, returns no results. Add at least one word to search for. - Spell correction keeps operators, so
+runnigis corrected to+running. Synonyms are not expanded for excluded words. A synonym of a+wordis added as an optional word. - In
hybridandvector_onlymodes, exclusions also apply to semantic matches. - Operators apply to
/v1/autocompleteon hosted search only. In search proxy mode, the query is forwarded unchanged and the connected search API interprets it./v1/typeaheaddoes not support operators.
Response shape
The response includes:
- normalized and optionally corrected query values
- the effective mode used
suggestionswith titles, subtitles, descriptions, URLs, images, price, currency, score, and extra metadata
Example
curl "https://api.suggestapi.com/v1/autocomplete?index=products&query=diaphragm%20pump&limit=8&mode=hybrid" \
-H "x-api-key: <public-key>"
GET /v1/typeahead
Fast prefix suggestion endpoint for search-as-you-type experiences.
Important query params
queryrequiredindexlogical index IDlimitfrom 1 to 50bypass_cacheorX-Bypass-Cache
Notes
- optimized for low-latency suggestion UIs
- supports spell correction and typo-tolerant fuzzy matching on hosted search
- returns simpler suggestion payloads than
/autocomplete - does not support query operators:
+and-are matched as literal text, so+climatefinds only suggestions that start with “+climate” - in search proxy mode, suggestions come from the connected search API