Help Centre

<

Home
Search API Guide

You can use our Search API if you wish to build and maintain your own UI or integrate it into an existing search framework.

Search for products

This returns a list of products. The results are returned in sorted order, with the most relevant products to the search term appearing first.

Get https://aix.salesfire.co.uk/api/search

General parameters

  • client_id ( string ) - Required - Your site ID, this can be found within your Salesfire dashboard.
  • query ( string ) - Optional - The search term that you want to find products for. If there's no query string provided, products are returned in sorted order with the most purchased products appearing first.
  • limit ( int ) - Optional - Default: 100. A limit on the number of products to be returned, between 1 and 100.
  • Page ( int ) - Optional - Default: 1. Requested page. When specified this will retrieve a specific page, this should be used in conjunction with limit to achieve a paginated set of results.
  • query_spellchecker ( boolean ) - Optional - Default: False. Enable advanced spell checking, to make adjustments to the way spelling is calculated to potentially improve search results.
  • Sort_by  ( string ) - Optional - Accepted values: purchases, views, price, savings, null. Determines the primary sort value (what to sort by).
  • Sort_dir ( string ) - Optional - Accepted values: asc, desc, null. Determines the direction of sort.

Filter parameters

The array of categories, brands and attributes are the IDs of those returned in the response.

  • show_out_of_stock ( boolean ) - Optional - Default: true. If enabled, products that are out of stock will not be returned.
  • categories ( array ) - Optional - Return products that only belong to the provided categories.
  • brands ( array ) - Optional - Return products that only belong to the provided brands.
  • attributes( array ) - Optional - Return products that only have the provided attributes.

Weighting parameters

All values must be between 0 and 2.0, the higher the weighting the more the matching products will be boosted.

  • Title ( float ) - Optional - Default: 1.2. Weight results higher where the title contains the search term.
  • Brand ( float ) - Optional - Default: 1.2. Weight results higher where the brand contains the search term.
  • Category ( float ) - Optional - Default: 0.4. Weight results higher where the category contains the search term.
  • Description ( float ) - Optional - Default: 0.2. Weight results higher where the description contains the search term.
  • Synonyms ( float ) - Optional - Default: 0.1. Weight results higher where the synonyms contain the search term.
  • Colour ( float ) - Optional - Default: 1.0. Weight results higher where the colour contains the search term.
  • Size ( float ) - Optional - Default: 1.0. Weight results higher where the size contains the search term.
  • Gender ( float ) - Optional - Default 2.0. Weight results higher where the gender contains the search term.
  • Age_group ( float ) - Optional - Default: 1.2. Weight results higher where the age group contains the search term 
  • Stock_availability ( float ) - Optional - Default: 1.0. Weight results higher if they are in stock.
  • image_tag ( float ) - Optional - Default: 1.0. Weight results higher where the image alt tag matches the search term.

Example

curl -G -X GET https://aix.salesfire.co.uk/api/search \
  -d client_id={YOUR_CLIENT_ID} \
  -d query=chronograph \
  -d "filters[attributes][]=1ffd9e" \
  -d "weights[title]=0.12" \
  -d "weights[brand]=0.12" \
  -d "weights[description]=0.180" \
  -d limit=10
{
    "client": "3f32397c-21c6-47e5-9ebd-e9865ea03470",
    "original_query": "chronograph",
    "corrected_query": "chronograph",
    "products": [
        {
            "id": "s26369",
            "title": "AR2447 Emporio Black Leather Mens Chronograph Watch",
            "brand": "Armani",
            "price": {
                "min": 119.95,
                "max": 119.95,
                "savings": 130.05,
                "currency": "GBP",
                "unit": null
            },
            "image_url": "https://www.ticwatches.co.uk/images/armani-ar2447-emporio-black-leather-mens-chronograph-watch-p26010-13572_image.jpg",
            "images": {
                "black": "https://www.ticwatches.co.uk/images/armani-ar2447-emporio-black-leather-mens-chronograph-watch-p26010-13572_image.jpg"
            },
            "link": "https://www.ticwatches.co.uk/armani-ar2447-emporio-black-leather-mens-chronograph-watch-p26010/s26369?cid=GBP&glCurrency=GBP&glCountry=GB",
            "links": {
                "black": "https://www.ticwatches.co.uk/armani-ar2447-emporio-black-leather-mens-chronograph-watch-p26010/s26369?cid=GBP&glCurrency=GBP&glCountry=GB"
            },
            "in_stock": true,
            "docid": 5646,
            "score": 402.1394080193016
        }
        ...
    ],
    "suggested": [],
    "filters": [
        {
            "key": "categories",
            "items": [
                {
                    "id": "02b009",
                    "name": "Black Watches",
                    "breadcrumb": "Black Watches",
                    "link": "",
                    "count": 19
                },
                {
                    "id": "32df2c",
                    "name": "Mens Watches",
                    "breadcrumb": "Mens Watches",
                    "link": "",
                    "count": 108
                }
                ...
            ]
        },
        {
            "key": "brands",
            "items": [
                {
                    "id": "10b224",
                    "name": "Armani",
                    "count": 51
                },
                {
                    "id": "1428e3",
                    "name": "Tommy Hilfiger",
                    "count": 6
                }
                ...
            ]
        },
        {
            "key": "attributes",
            "items": [
                {
                    "id": "1ffd9e",
                    "name": "black",
                    "count": 81,
                    "type": "colour"
                },
                {
                    "id": "48d621",
                    "name": "blue",
                    "count": 29,
                    "type": "colour"
                }
                ...
            ]
        }
    ],
    "total_pages": 2,
    "promotions": [],
    "redirect": null,
    "time": 0.004701137542724609,
    "timestamp": 1611288637
}

Errors

500: Internal Server Error - The client may not exist or we have had a problem responding to your request.

{
    "status": 500,
    "error": "500 Internal Server Error",
    "message": "No client given",
    "class": "Exception"
}