Visual Search API
Integrate Visual Search Functionality with Unbxd Visual Search API
Overview
The Visual Search API allows you to seamlessly integrate with the Unbxd platform and effortlessly incorporate all functionalities related to visual search. It enables you to display search results for an image from the array of products that match the visual cues.
Image Requirements And Best PracticesTo ensure optimal performance and accurate results, follow these image guidelines:
Recommended Limits File Size.
Ideal: ≤ 500 KB
Maximum recommended: ≤ 1 MB
Resolution
Recommended: ≤ 1000px (longest side) (Avoid: Images larger than 2000px)
- Large images (like 3–4MB, 4000px+) may result in API timeouts Return 0 results. In this case, be routed to alternate processing pipelines like mimir.image_search.
- Supported formats include JPEG, PNG, TIFF, HEIC, and HEIF.
❗Recommended : Approach Resize images on the client side before uploading Maintain ≤1000px resolution on the longest side Compress images before Base64 encoding
You can use the JSON /XML response format and leverage various built-in features. All API requests must be made over HTTPS.
Sample Request: Method POST
{
curl -X POST
'https://search.unbxd.io/v2.0/sites/{site_key}/images'
-H 'Authorization: API Key'
-H 'Content-Type: application/json'
}Sample Request: Method GET
{
curl -X GET "https://search.unbxd.io/v2.0/sites/(site_key)/images?imageUrl=https://some.site/images/image.png"
-H "Authorization: API Key"
}
Authentication
Log in to Netcore Unbxd console and naviagte to Configure Site > Keys.
Authentication is done using API Keys and Sitekeys, which are generated during the account creation process.
Uploading Images
Upload Using Public Image URL.
Sample Request: Method POST
curl --location '/v2.0/sites/{site_key}/images'
--header 'Content-Type: application/json'
--header 'Authorization: API Key'
--data '{ "imageUrl": "http://example.com/img/1.jpg" }'
Sample Request: Method GET
curl --location 'v2/sites/(site_key)/images?imageUrl=http%3A%2F%2Fexample.com%2Fimages%2F1.jpg' \\\
\--header 'Authorization: API Key'
Image Uploaded as Multipart/ Form-data
curl --location '/v2.0/sites/(site_key)/images' \\\
\--header 'Authorization: API Key' \
\--form 'image=@"./scripts/test/test.png"'
Upload Image by Sending Base64 Encoding
curl --location '/v2.0/sites/(site_key)/images' \\\
\--header 'Content-Type: image/png;base64' \
\--header 'Authorization: API Key' \
\--data 'iVBORw0KGgoAAAANSUhEUgAAAq4AAAIdCAYAAAD8of/......'
NoteEnsure (site_key) is replaced with your actual site key, and API Key with the API key you are using for authorisation.
Here is how an Image to Base64 Encoder splits out data
data:image/jpeg;base64,/9j/4AAQSkZJRgABAQAAAQABAAD/4QC2.....TP/9k=
Read this data as:
data:<mime-type>,<raw-image-data>
</raw-image-data></mime-type>
When using this API, emit the mime-type within the content-type header as shown above, along with raw-image-data within the body.
Here are the supported mime types:
- image/jpeg;base64
- image/png;base64
- image/tiff;base64
- image/heic
- image/heif
Headers
The following parameters are available:
| Parameter | Description |
|---|---|
| unbxd-user-id | The Unbxd Analytics JavaScript sets a unique identifier in your browser’s cookie referred to as the user ID. Example: uid-1466015353887-20419. |
| user-agent | In each HTTPS request, the user-agent identification information is passed to the web server. |
| unbxd-device-type | A custom Unbxd header that identifies if the request originated from an app. |
| X-Forwarded-For | In this header, the IP address of the end user is identified. Crucial for backend integrations, since Unbxd cannot get the IP directly from the browser. |
| Content-Type | This header signifies the content type of the request being sent. Supported types include application/json, image/*, base64image/* (JPG/JPEG, PNG, TIFF). |
unbxd-device-type
{ "type":"tablet" , "os": "iOS" , "source": "app" }
- Possible values of “type” : “desktop”, “tablet”, “mobile”
- Possible values of “os” : “android”, “ios”, “windows”
- Possible values of “source” : “browser”, “app”`
- Supported Image Types (Refer the table below)
| Format | MIME Type |
|---|---|
| PNG | image/png |
| JPEG/JPG | image/jpg |
| TIFF | image/tiff |
| HEIC | image/heic |
| HEIF | image/heif |
Request Parameters
The values of the request parameters are defined below:
Parameter | Description | Data Type | Possible Values / Format |
|---|---|---|---|
version | Specifies the API version. Always pass | String | Supported: |
user-type | Indicates the visit frequency of the user. | String |
|
uid | Unique ID to identify visitors. Obtained from | String | Format: |
format | Specifies response format. | String | Format: |
start | Offsets the results by a specific number. | Integer | Format: |
page | Displays the right set of products per page ( | Integer | Format: |
rows | Paginates query results OR sets number of buckets when used with bucketing. | Integer | Format: |
variants | Displays variants of the same product. | Boolean | Format: |
variants.count | Number of defined variants to show for a product. | Integer | Format: |
fields | Defines which product attributes to return (e.g., color, size). | String | Format: |
bucket.field | Groups products by a common field value into buckets. | String | Format: |
bucket.limit | Number of products to show in each bucket. | Integer | Format: |
bucket.offset | Paginates to the next set of products within a bucket. | Integer | Format: |
analytics | Enables or disables tracking for analytics. | String | Default: Tracking is enabled |
stats | Returns product info with highest and lowest field values (numerical fields only). | – | Format: |
API Response
"searchMeta"
...
"queryParams": { ... },
"image": {
"id": "ad85491c-9d2b-4cab-900a-df96aa11f0d9",
"boxes": [{
"id": 1089,
"vertices": [{
"x": 164.07107543945312,
"y": 352.81292724609375
},
{
"x": 188.38121032714844,
"y": 384.0833435058594
}
],
"url": "/v2.0/sites//images/ad85491c-9d2b-4cab-900a-df96aa11f0d9/boxes/1089"
}{
"id": 811,
"vertices": [{
"x": 147.3377685546875,
"y": 68.75267028808594
},
{
"x": 255.28317260742188,
"y": 340.2548522949219
}]
"url": "/v2.0/sites//images/ad85491c-9d2b-4cab-900a-df96aa11f0d9/boxes/811"
},
...
...
],
"selected": 1089
},
...
A search API response comprises of
- searchMetaData
- response
- And some other high level fields of the response.
The above JSON gets added in searchMetaData block, besides queryParams.
NoteThe
dd.tagfield is an internal Datadog logging tag used for monitoring and observability. It does not affect request routing or search results.All image search requests are handled by the mimir pipeline, which orchestrates calls to downstream AI services.
Response Components
Unbxd returns the list of products that match the search criteria. The response would be in application/JSON or application/XML content type format.
| Component | Description |
|---|---|
| ID | "id": "ad85491c-9d2b-4cab-900a-df96aa11f0d9" – A unique UUID assigned to each uploaded image. |
| Boxes | An array of bounding boxes for the image. Each box contains a URL (boxes: [{ box.url }]) which can be used to retrieve results specific to that region. |
| Selected (Box) | Stores the ID of the selected bounding box that the user has clicked or interacted with. |
| Status | HTTP response status code (e.g., 200 for OK, 404 for Not Found, 500 for Server Error). |
| QueryTime | Time taken by the system to process the shopper’s request. |
| QueryParams | Parameters that were sent as part of the image search request. |
| NumberOfProducts | Total number of products returned in the response. |
| Start | Offset value in the result set — determines from which point products are returned. |
| Products | Contains the product details that match the request; structure mirrors the product feed schema. |
| RelevantDocument | Indicates whether to display the parent or variant product in the UI. Values can be: "parent" or "variant". |
| Facets | Refers to filters shown in the UI that help users narrow down the product list based on specific fields (e.g., brand, price, color). |
| Breadcrumb | Represents the hierarchical position of a field (e.g., Category → Subcategory → Product). |
| Selected (Filter) | Represents currently selected filters by the user in the UI. |
Updated 17 days ago
