- Use - ‘collection-search’ endpoint for collection pages
- Use - ‘search’ endpoint for search pages
Search API
GET https://xyz.search.frenzy.ai/{search or collection-search}
Query Parameters
| Name | Type | Description |
|---|---|---|
| raw_query | string | User entered query. |
| filters | string | Filter selected by the user. String filters: filter_name:filter_valueNumeric filters: filter_name less than filter_value |
| sort | String | Possible values- 1. newest, 2. best match, 3. price asc, 4. price desc (Default best match) |
| results_per_page | integer | Number of results required. For Shopify customers, this value is set in the Portal. |
| page_index | integer | Page index, starts from 0. |
| user_id | string | User id associated with the request (only required for personalization). |
| session_id | string | Session id associated with the request. |
| config_id | string | Configuration id for search/collection pages. |
| ab_test_id | string | A/B test id when test is running. |
| headless | boolean | For headless users sent true, else false. |
| shop | string | Shopify’s myshopify url. (without https://) |
| suggestion | string | If the search query comes from Suggestion send true, else false. |
| extra_filters | string | Non UI filters to run prior finding the results. |
| collection_id | string | For collection pages sent the collection id. |
| collection_handle | string | For collection pages sent the collection handle. |
| currency | string | Currency code. |
| country | string | Country code. |
| state | string | State code. |
| company_id | string | Shopify B2B company id. |
| location_id | string | Shopify B2B location id. |
| publication_app_id | string | Shopify publication app id. |
Headers
| Name | Type | Description |
|---|---|---|
| X-Frenzy-Authorization* | string | API key provided at the time of account creation. |
| X-Shop | string | Shopify’s myshopify url. (without https://) |
- 200 Search results successfully retrieved.
- Success
- Failure
{
"corrected_query": "red bags",
"page_count": 15,
"results": [
{
"sku":"123-123"
},
{
"sku":"123-234"
},
{
"sku":"123-345"
}
],
"facet_fields": {
"closure": [
[
"zip",
106
],
[
"flap",
76
],
[
"open",
25
]
],
"handle": [
[
"top handle",
145
],
[
"leather handle",
11
],
[
"chain handle",
7
]
],
},
"filters": {
"category": [
"bags"
],
"price": {
"min": 10,
"max": 20000
},
"color": [
"red"
],
"style": [
"totes"
]
},
"products_found": 346
}
{'error': 'server_error'}
Response Object
| Key | Type | Value |
|---|---|---|
| correct_query | string | Spell-corrected user query returned by SpellCheck. |
| page_count | integer | Total number of possible pages with ‘results_per_page’ number of products on each page. |
| results | array | List of matching products |
| facet_fields | array | Facet data for filters |
| filters | object | User-selected filters |
| products_found | integer | Total number of products found for ‘raw_query’ |
| request_id | string | Id for tracking the request |
| filter_order | array | Mapping for filter display name. |
| color_swatches | object | Swatches to be displayed for Filters. |
Example Request [Collection Page]
curl --location --request GET 'https://xyz.search.frenzy.ai/collection-search?sort=best%20match&user_id=a7d4da7c-3605-44be-9d0a-237ff0303a83&page_index=0&filters=price%3E0&filters=price%3C1000000000&filters=collections:all&headless=true'
--header 'x-frenzy-authorization: API KEY'
Example Request [Search Page]
curl --location --request GET 'https://xyz.search.frenzy.ai/search?sort=best%20match&user_id=a7d4da7c-3605-44be-9d0a-237ff0303a83&page_index=0&filters=price%3E0&raw_query=tops&headless=true&filters=price%3C1000000000
' \
--header 'x-frenzy-authorization: API KEY'