The Searchspring Suggest API is powerful and flexible endpoint, designed to generate helpful query suggestions based on a shopper's input text. This endpoint powers the mainline AutoComplete feature for all Angular v3 implementations and beyond.
See Also: Response Format
This API includes all query suggestion logic that used to be done on the front-end, so now you can get advanced query suggestions even with custom installations that don't use Searchspring's v3 module.
- Spell-check is baked in, and enabled by default
- Doesn't include any front-end formatting (such as HTML <em> tags) in its response, so it can be used more freely.
API Endpoint URL
https://[siteId].a.searchspring.io/api/suggest/query
Request Parameters
Format |
String |
Description |
The siteId parameter identifies your site. You can find your siteId on the My Account page. |
Example Value |
"scmq7n" |
Format |
String |
Description |
The user's input query, which is used to generate search suggestions. |
Example Value |
"dres" |
Format |
String |
Description |
Determines the language model that we will use in spelling correction. |
Default Value |
"en" |
Format |
Integer |
Description |
The number of suggestions to be returned to show the end user. |
Default Value |
4 |
Format |
Integer |
Description |
The number of products on a site to scan (Name and SKU core fields) in order to find matches against the query. |
Default Value |
20 |
Example Request
cURL
curl -XGET "https://scmq7n.a.searchspring.io/api/suggest/query?siteId=scmq7n&query=dres" -H 'Content-Type: application/json'
The following parameters are hidden from public view for now.
Format |
Integer |
Description |
The number of popular search queries on the site to scan in order to find matches against the query. Popular search queries are always sorted by most popular first, regardless of this number. |
Default Value |
20 |
Format |
Boolean |
Description |
Disables spelling correction from potentially changing the input query. |
Default Value |
false |
Format |
Boolean |
Description |
Allows merchandising to affect the order that products are scanned (See "Product Count" above). If the query matches a merchandising campaign trigger, the product order will be affected with that campaign's rules. The global merchandising campaign will also apply. |
Default Value |
false |
Format |
Boolean |
Description |
Allows IntelliSuggest elevations to affect the order that products are scanned (See "Product Count" above). If the query is normally affected by IntelliSuggest elevations, the product order will be affected accordingly. |
Default Value |
false |
Format |
Boolean |
Description |
If enabled, will return a "debug" array that returns more information explaining logic and context. This includes the list of popular queries and products being scanned for generated suggestions & exact matches. |
Default |
false |
Standby as we redirect you to this article in our new developer portal...
Comments
0 comments
Article is closed for comments.