Visual Search Response API

This API fetches a list of objects identified from the uploaded image. It also returns similar product recommendations for the items detected in the image.

Endpoints


Path Parameters


ParameterTypeDescriptionRequired
widget_idstringThe ID of the widget, which can be found in the Widget Configurator in the Dashboard.required

Query Parameters


ParameterTypeDescription<!----->
account_idintegerYour site's numerical Bloomreach account ID. Your Bloomreach representative gives your site's account ID to you before or during your integration kickoff meeting.required
domain_keystringYour site domain's ID, which Bloomreach provides during initial scoping and integration. This ID is for the domain that you want to receive your Bloomreach API requests. This parameter identifies the specific site version when the one account ID hosts multiple site versions with unique characteristics, such as language versions.required
image_idstringYou’ll get this value in the Upload API response once an image is uploaded. You can use image_id to make any number of subsequent queries for widget responses (with different parameters/filters and objects) without the need to re-upload.required
urlstringThe absolute URL of the page where the request is initiated. Do not use a relative URL.required
_br_uid_2stringA first-party cookie created by the Bloomreach tracking pixel library (BrTrk). This cookie creates a unique, anonymous identifier for every browser or device. Use the default value provided, which is already encoded. &_br_uid_2=uid%3D7797686432023%3Av%3D11.5%3Ats%3D1428617911187%3Ahc%3D55required
fieldsstringA comma-separated list of fields to be sent in the request. Alternatively, you may configure the fields in the Widget Configurator in the Dashboard instead. This parameter is required if not sent via the Dashboard.optional
rowsintegerThe number of matching items to return per results page in the API response. The maximum value is 200. The result size is used from the Dashboard if it is not sent in the API. To enhance performance, limit this value to the number of items that you think is reasonable for a single page of search results.optional
object_idintegerBy default, you will get the recommendations for the whole image you uploaded if you make an API call without the object_id [denoted by -1]. To get more targeted results, you can also make API calls specific to object_ids.optional
filterstringThe filter parameter applies a faceted filter to the returned products, searching for products that fit your parameter values. Any facet that you want to filter must be in your feed. Attributes must be enabled and mapped by Bloomreach. Let your Bloomreach representative know which attributes in your content feed you want to apply as filters to search results. You can filter results based on numeric ranges. For example, &filter=(price:["100" TO "*"]). To provide multiple filters, send multiple filter parameters. For example, &filter=(price:["*" TO "100"])&filter=(color_groups: ("blue"))optional

Header


ParameterTypeDescriptionRequired
auth_keystringThe unique key shared during the integration phase. This is used to authenticate a merchant API call.required

Response Example


The response lists the identified objects and retrieves similar product recommendations for all the objects.

If you make a call with object_id, you’ll get targeted results. In the example below, product suggestions are displayed for the object with the "object_id": "1".

{
    "response": {
        "numFound": 2,
        "start": 0,
        "docs": [
            {
                "brand": "GA",
                "skuid": "sku211482439",
                "pid": "prod253090443",
                "thumb_image": "https://media.homeoasis.com/f_auto,q_auto/w_1200,h_1500/01/nm_4357250_100380_m",
                "variants": [
                    {
                        "skuid": "sku211482439"
                    }
                ],
                "price": 2095.0
            },
            {
                "brand": "GA",
                "skuid": "sku215611655",
                "pid": "prod258280236",
                "thumb_image": "https://media.homeoasis.com/f_auto,q_auto/w_1200,h_1500/01/nm_4484851_100380_m",
                "variants": [
                    {
                        "skuid": "sku215611655"
                    }
                ],
                "price": 3995.0
            }
        ]
    },
    "objects": [
        {
            "id": 1,
            "bbox": [
                0,
                180,
                490,
                817
            ]
        },
        {
            "id": 2,
            "bbox": [
                236,
                698,
                273,
                822
            ]
        },
        {
            "id": 3,
            "bbox": [
                193,
                745,
                245,
                878
            ]
        }
    ],
    "metadata": {
        "widget": {
            "id": "79opvm5j",
            "name": "preview",
            "description": "preview",
            "type": "visual_search",
            "rid": "e8811c01-a2f7-4907-a65d-ad42635f8d0e"
        },
        "response": {
            "personalized_results": false,
            "fallback": "",
            "recall": "pure"
        },
        "query": {
            "image_id": "3d4b4331763c31b39da02704d48e890f90c36ef6b4835eface4820a3e1127987",
            "object_id": "1"
        }
    }
}



Language
Click Try It! to start a request and see the response here!