Search API Call

This page explains the request and the response formats for the search API call

  1. Use - 'collection-search' endpoint for collection pages

  2. 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 Format for string filter values- filter_name:filter_value Format for numberial filter values- filter_name<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 values is set in Portal.

page_index

integer

Page index, starts from 0.

user_id

string

User Id associated with the request (only required for personalization)

config_id

string

id for A/B test

headless

boolean

for headless users sent true, else false

shop

string

name of the Shopify Store. (required for shopify stores)

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

Headers

Name
Type
Description

X-Frenzy-Authorization*

string

API key provided at the time of account creation.

{    
    "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
}

Response Object

Key

Type

Value

correct_query

string

Spell corrected user query by SpellCheck

page_count

integer

Total number of possible pages with 'results_per_page' number of products on each page.

facet_fileds

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.

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'

Last updated

Was this helpful?