Skip to main content

Suggestion

Request

Method: POST

Endpoint: /suggestion

curl --location 'https://<PA_SEARCH_END_POINT>/suggestion' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer cGFTZXXXXXXXXXXXXXXXA==' \
--data '{
"website_id": "XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX",
"q": "SEARCH STRING",
"client": "CLIENT_SHORTCODE"
}

Fields

FieldTypeRequiredDescription
website_idStringYesClient unique website ID provided by PA.
qStringYesInput search query string.
clientStringYesUnique client shortcode provided by PA.

Response

{
"type": 1,
"payload": {
"suggested_terms": [
{
"search_term": "dress",
"frequency": 1250
},
{
"search_term": "dress shoes",
"frequency": 890
}
],
"trending_terms": [
{
"search_term": "summer dress",
"frequency": 2100
},
{
"search_term": "new arrivals",
"frequency": 1800
}
],
"synthetic_suggested_terms": [
"dress shirts",
"dress pants",
"formal dress"
],
"synthetic_trending_terms": [
"wedding dress",
"summer collection",
"new arrivals"
]
}
}
Filtering Behavior
  • Suggested terms (suggested_terms and synthetic_suggested_terms) are filtered based on the search query q. Only terms that match the query are returned. For example, if the configured synthetic suggested terms are ["dress shirts", "dress pants", "winter jacket", "formal dress"] and the query is "dress", only ["dress shirts", "dress pants", "formal dress"] will be returned.
  • Trending terms (trending_terms and synthetic_trending_terms) are not filtered by the query. All trending terms are returned regardless of what the user is searching for.