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
| Field | Type | Required | Description |
|---|---|---|---|
| website_id | String | Yes | Client unique website ID provided by PA. |
| q | String | Yes | Input search query string. |
| client | String | Yes | Unique 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_termsandsynthetic_suggested_terms) are filtered based on the search queryq. 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_termsandsynthetic_trending_terms) are not filtered by the query. All trending terms are returned regardless of what the user is searching for.