Camera Search API
API Endpoint
The default API Endpoint is as follows, and the current latest version is 2023-02
.
https://api.kr.omnicommerce.ai/2022-08/
https://api.kr.omnicommerce.ai/2023-02/
New Search
POST /similar-items/search: New Search
Request a new search by uploading an image in url or Base64 format.
Request Header
Name | Required | Type | Description |
---|---|---|---|
X-Api-Key | Required | String | API Key (refer to API Authentication Guide) |
Request Body
The product ID is internally treated as a Unique Key and is also used in the form of a URL Path Parameter when calling API. Accordingly, the use of URL Unsafe Characters based on [RFC3986] is restricted.
<space> / % < > [ ] { } | \ ^
Name | Required | Type | Description |
---|---|---|---|
image | Required | Object | An object containing information about the image to be retrieved |
├ image.type | Required | String | Choose url or base64 depending on the type of the image |
└ image.content | Required | String | In the case of image.type is url : URL of the image to be retrieved In the case of image.type is base64 : base64-encoded image file to be retrieved (See: Image Guide) |
transactionId | Optional | String | ID to identify a request of the previous search. If there is no value, a random value is assigned. |
limit | Optional | String | Maximum number of items to recommend (default: 10, max: 100) |
showInfo | Optional | List[String] | Select additional information to be displayed along with a recommendation result (multiple selections possible) [METADATA, IMAGE_INFO, CONTEXT_INFO] |
metadataFilter | Optional | String | Metadata Filter Query (see: Metadata Filter) |
Request Example
When image.type
is base64
format
{
"image": {
"type": "base64",
"content": "iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVQYV2Poi5b8DwAEfwICWoNPegAAAABJRU5ErkJggg=="
},
"transactionId": "A14425770",
"showInfo" : ["METADATA", "IMAGE_INFO", "CONTEXT_INFO"]
}
When image.type
is url
{
"image": {
"type": "url",
"content": "http://imageserver.net/some/image.jpeg"
},
"transactionId": "A14425770",
"showInfo": ["METADATA", "IMAGE_INFO", "CONTEXT_INFO"]
}
When a filter condition exists
{
"image": {
"type": "url",
"content": "http://imageserver.net/some/image.jpeg"
},
"transactionId": "A14425770",
"limit": 100,
"showInfo": ["METADATA", "IMAGE_INFO", "CONTEXT_INFO"],
"metadataFilter" : {
"productName": {
"eq": "skirt"
}
}
}
Response
Name | Type | Description |
---|---|---|
transactionId | String | ID to identify a request of the previous search. |
limit | integer | Maximum number of items to recommend |
expirationDate | String | Expiration date (isoformat, UTC) |
showInfo | List[String] | Selected additional information to be displayed along with a recommendation result |
metadataFilter | Optional | Object |
results | List[Object] | Product information that is detected in the request image with related recommendation results |
├ results[].object | Object | Information about the object detected in the request image |
ㅤ├ results[].object.id | String | An ID of the detected object |
ㅤ├ results[].object.detection | String | Detection Category information predicted by the model (see [Detection Field]) |
ㅤ└ results[].object.position | Object | The information of the center position of the detected product from the request image |
ㅤㅤ├ results[].object.position.x | Number | The x-axis coordinate of the center position of the product |
ㅤㅤ└ results[].object.position.y | Number | The y-axis coordinate of the center position of the product |
└ results[].recommendation | List[Recommendation] | Recommendation results (see below) |
Recommendation
Name | Type | Description |
---|---|---|
order | Integer | An integer number as sorted in order by similarity (zero-based) |
id | String | Unique ID of the query product to be recommended |
similarityScore | float | Between 0 and 1, the higher the value, the higher the similarity. [This is available in 2023-02 version only.] |
metadata | Object | Various product information managed by the customer, such as product name, brand, price, season, and discount rate. (see Product metadata) Null if no value (default) |
imageInfo | Object | Image information of the recommended product. If there is IMAGE_INFO as the input value of showInfo field in the request, the value will be displayed. Null if no value (default) |
├ imageInfo.detection | String | The detection field which is provided by the client when the product information was put into the workspace. (see Detection Field) |
└ imageInfo.url | String | The URL of the representative image of the product. |
contextInfo | Object | Context information of the recommended product. If there is CONTEXT_INFO as the input value of showInfo field, the value will be displayed. Null if no value (default) |
├ contextInfo.salesUrl | String | URL of the page where the product is being sold |
└ contextInfo.mobileSalesUrl | String | Mobile version URL of the page where the product is being sold |
Response Example
400 Bad Request
Invalid Request Format
{
"errors": "json format error."
}
When product recommendations are temporarily unavailable due to the Index is not prepared yet
Index calculation occurs once a day at midnight. If new product information was added to the Workspace, recommendations will become available after a day has passed.
{
"errors": "No product id exists."
}
HTTP Status Code : 200
This response may occur in the following situations:
- No products were detected from the image.
- The product does not exist.
{
"transactionId": "b3057c85-676d-4dec-9b45-d2eec1594df8",
"limit": 10,
"expirationDate": "2022-09-20T00:05:23",
"showInfo": [
"METADATA",
"IMAGE_INFO",
"CONTEXT_INFO"
],
"results": [],
"metadataFilter" : {"productName": {"eq": "skirt"}}
}
When 3 objects are detected, but no recommendation results are found for all 3 detected objects from the request image
Click to Expand
{
"transactionId": "b3057c85-676d-4dec-9b45-d2eec1594df8",
"limit": 10,
"showInfo": [
"METADATA",
"IMAGE_INFO",
"CONTEXT_INFO"
],
"metadataFilter" : {"productName": {"eq": "skirt"}},
"expirationDate": "2022-09-20T00:05:23",
"results": [
{
"object": {
"id": "0",
"detection": "TOP",
"position": {
"x": 0.36875,
"y": 0.46640627500000004
}
},
"recommendation": []
},
{
"object": {
"id": "1",
"detection": "BAG",
"position": {
"x": 0.36875,
"y": 0.46640627500000004
}
},
"recommendation": []
},
{
"object": {
"id": "2",
"detection": "SHOES",
"position": {
"x": 0.36875,
"y": 0.46640627500000004
}
},
"recommendation": []
}
]
}
HTTP Status Code : 201
When 3 objects are detected, and there are recommendation results for at least one of the detected objects from the request image
Click to Expand
{
"transactionId": "b3057c85-676d-4dec-9b45-d2eec1594df8",
"limit": 10,
"showInfo": [
"METADATA",
"IMAGE_INFO",
"CONTEXT_INFO"
],
"expirationDate": "2022-09-20T00:05:23",
"metadataFilter" : {"productName": {"eq": "skirt"}},
"results": [
{
"object": {
"id": "0",
"detection": "TOP",
"position": {
"x": 0.36875,
"y": 0.46640627500000004
}
},
"recommendation": []
},
{
"object": {
"id": "1",
"detection": "BAG",
"position": {
"x": 0.36875,
"y": 0.46640627500000004
}
},
"recommendation": [
{
"order": 0,
"id": "66ff313a806eddfe0ffd8276d670131a",
"similarityScore": 0.99,
"metadata": {
"name": "d",
"price": 400
},
"imageInfo": {
"detection": "TOP",
"url": "http://imageserverurl/some.image.jpg"
},
"contextInfo": {
"salesUrl": "https://www.example.com/p/example",,
"mobileSalesUrl": "https://www.example.com/p/example",
}
},
{
"order": 1,
"id": "98deb22e5caf6239fcf7191e09630fa9",
"similarityScore": 0.98,
"metadata": {
"name": "d",
"price": 400
},
"imageInfo": {
"detection": "TOP",
"url": "http://imageserverurl/some.image.jpg"
},
"contextInfo": {
"salesUrl": "https://www.example.com/p/example",,
"mobileSalesUrl": "http://imageserverurl/some.image.jpg"
}
},
{
"order": 2,
"id": "df8335f51c53addbe3d4eee529eac8fb",
"similarityScore": 0.97,
"metadata": {
"name": "d",
"price": 400
},
"imageInfo": {
"detection": "TOP",
"url": "http://imageserverurl/some.image.jpg"
},
"contextInfo": {
"salesUrl": "https://www.example.com/p/example",
"mobileSalesUrl": "http://imageserverurl/m/example"
}
}
]
},
{
"object": {
"id": "2",
"detection": "SHOES",
"position": {
"x": 0.36875,
"y": 0.46640627500000004
}
},
"recommendation": []
}
]
}
Get search results from the previous result
Instead of uploading a new request image, the search result corresponding to the Transaction ID and Object ID received as a response of [POST /similar-items/search: New Search] can be quickly retrieved due to no need for running an inference job. Unlike a new search, you can receive a quick response and filter the recommended results based on Metadata.
Cached search results will expire after a certain period of time. The expiration date can be checked through the expirationDate
field of the response value, and if an expired result is requested, 400 Bad Request
will be returned.
GET /similar-items/search/<transaction id>/<object id>: Get search results from the previous result
Get the search results corresponding to Transaction ID and Object ID.
Request Header
Name | Required | Type | Description |
---|---|---|---|
X-Api-Key | Required | String | API Key (refer to API Authentication Guide) |
Path Parameter
Name | Required | Type | Description |
---|---|---|---|
transaction id | Required | String | ID to identify a request of the previous search, which is received as a response to the New Search API call |
object id | Required | String | ID to identify a specific object detected by the previous search (results[].id ) |
Request Parameter
Name | Required | Type | Description |
---|---|---|---|
limit | Optional | String | Maximum number of items to recommend (default: 10, max: 500) |
showInfo | Optional | List[String] | Select additional information to be displayed along with a recommendation result (multiple selections possible) [METADATA, IMAGE_INFO, CONTEXT_INFO] |
metadataFilter | Optional | Object | Metadata Filter Query (see: Metadata Filter) |
Request Example
1. In case of receiving up to 100 recommendation results, including all meta information such as metadata
, imageInfo
, and contextInfo
2. In case of only metadata
and contextInfo
information are included, up to 100 recommendations are received, and a metadata filter condition is that the name of the metadata of each product is skirt
3. In the case of requesting recommendations that include only contextInfo
information and receive up to 500 recommendation results, a metadata filter condition is that the name of the product is skirt
.
Response
Name | Type | Description |
---|---|---|
transactionId | String | ID to identify a request of the previous search, which is received as a response to the New Search API call |
limit | integer | Maximum number of items to recommend |
expirationDate | String | Expiration date (isoformat, UTC) |
showInfo | List[String] | Selected additional information to be displayed along with a recommendation result |
metadataFilter | Object | Metadata Filter Query (See: Metadata Filter) |
object | Object | Information about the object detected in the request image |
├ object.id | String | An ID of the detected object |
├ object.detection | String | Detection Category information predicted by the model (see [Detection Field]) |
└ object.position | Object | The information of the center position of the detected product from the request image |
ㅤ├ object.position.x | Number | The x-axis coordinate of the center position of the product |
ㅤ└ object.position.y | Number | The y-axis coordinate of the center position of the product |
recommendation | List[Recommendation] | Recommendation results (see below) |
Recommendation
Name | Type | Description |
---|---|---|
order | Integer | An integer number as sorted in order by similarity (zero-based) |
id | String | Unique ID of the query product to be recommended |
similarityScore | float | Between 0 and 1, the higher the value, the higher the similarity. [This is available in 2023-02 version only.] |
metadata | Object | Various product information managed by the customer, such as product name, brand, price, season, and discount rate. (see Product metadata) Null if no value (default) |
imageInfo | Object | Image information of the recommended product. If there is IMAGE_INFO as the input value of showInfo field in the request, the value will be displayed. Null if no value (default) |
├ imageInfo.detection | String | The detection field which is provided by the client when the product information was put into the workspace. (see Detection Field) |
└ imageInfo.url | String | The URL of the representative image of the product. |
contextInfo | Object | Context information of the recommended product. If there is CONTEXT_INFO as the input value of showInfo field, the value will be displayed. Null if no value (default) |
├ contextInfo.salesUrl | String | URL of the page where the product is being sold |
└ contextInfo.mobileSalesUrl | String | Mobile version URL of the page where the product is being sold |
Example Responses
HTTP Status Code: 400 Bad Request
In case of the result corresponding to the given transaction ID and object ID does not exist or has expired
{
"errors": "Transaction 'b3057c85-676d-4dec-9b45-d2eec1594df8' not exist or expired"
}
HTTP Status Code : 200
When recommendations does not exist
{
"transactionId": "b3057c85-676d-4dec-9b45-d2eec1594df8",
"limit": 10,
"expirationDate": "2022-09-20T00:05:23",
"showInfo": ["METADATA","IMAGE_INFO"],
"metadataFilter": {
"productName": {
"eq": "skirt"
}
},
"object": {
"id": "0",
"detection": "TOP",
"position": {
"x": 0.36875,
"y": 0.46640627500000004
}
},
"recommendation": []
}
HTTP Status Code : 201
When recommendations exist
Click to Expand
{
"transactionId": "b3057c85-676d-4dec-9b45-d2eec1594df8",
"limit": 10,
"expirationDate": "2022-09-20T00:05:23",
"showInfo": [],
"metadataFilter": {
"productName": {
"eq": "skirt"
}
},
"object": {
"id": "0",
"detection": "TOP",
"position": {
"x": 0.36875,
"y": 0.46640627500000004
}
},
"recommendation": [
{
"order": 0,
"id": "AT000123FB",
"similarityScore": 0.99,
"metadata": null,
"imageInfo": null,
"contextInfo": null
},
{
"order": 1,
"id": "AT00158AE",
"similarityScore": 0.98,
"metadata": null,
"imageInfo": null,
"contextInfo": null
},
{
"order": 2,
"id": "F800158GA",
"similarityScore": 0.97,
"metadata": null,
"imageInfo": null,
"contextInfo": null
},
{
"order": 3,
"id": "AF10881GK",
"similarityScore": 0.96,
"metadata": null,
"imageInfo": null,
"contextInfo": null
}
]
}
In case of receiving up to 10 recommendation results, including all meta information such as metadata
, imageInfo
, and contextInfo
Click to Expand
{
"transactionId": "b3057c85-676d-4dec-9b45-d2eec1594df8",
"limit": 10,
"expirationDate": "2022-09-20T00:05:23",
"showInfo": ["METADATA","IMAGE_INFO", "CONTEXT_INFO"],
"metadataFilter": {
"productName": {
"eq": "skirt"
}
},
"object": {
"id": "0",
"detection": "TOP",
"position": {
"x": 0.36875,
"y": 0.46640627500000004
}
},
"recommendation": [
{
"order": 0,
"id": "AT000123FB",
"similarityScore": 0.99,
"metadata": {
"productName": "a",
"originPrice": 100
},
"imageInfo": {
"detection": "TOP",
"url": "http://imageserverurl/some.image.jpg"
},
"contextInfo": {
"salesUrl": "http://imageserverurl/some.image.jpg",
"mobileSalesUrl": "http://imageserverurl/some.image.jpg"
}
},
{
"order": 1,
"id": "AT00158AE",
"similarityScore": 0.98,
"metadata": {
"productName": "b",
"originPrice": 200
},
"imageInfo": {
"detection": "TOP",
"url": "http://imageserverurl/some.image.jpg"
},
"contextInfo": {
"salesUrl": "http://imageserverurl/some.image.jpg",
"mobileSalesUrl": "http://imageserverurl/some.image.jpg"
}
},
{
"order": 2,
"id": "F800158GA",
"similarityScore": 0.97,
"metadata": {
"productName": "c",
"originPrice": 300
},
"imageInfo": {
"detection": "TOP",
"url": "http://imageserverurl/some.image.jpg"
},
"contextInfo": {
"salesUrl": "http://imageserverurl/some.image.jpg",
"mobileSalesUrl": null
}
},
{
"order": 3,
"id": "AF10881GK",
"similarityScore": 0.96,
"metadata": {
"productName": "d",
"originPrice": 400
},
"imageInfo": {
"detection": "TOP",
"url": "http://imageserverurl/some.image.jpg"
},
"contextInfo": {
"salesUrl": null,
"mobileSalesUrl": "http://imageserverurl/some.image.jpg"
}
}
]
}
POST /similar-items/search/<transaction id>/<object id>: Get search results from the previous result
Get the search results corresponding to Transaction ID and Object ID.
Request Header
Name | Required | Type | Description |
---|---|---|---|
X-Api-Key | Required | String | API Key (refer to API Authentication Guide) |
Content-Type | Required | String | Content Type. Only Application/json is supported. |
Path Parameter
Name | Required | Type | Description |
---|---|---|---|
transaction id | Required | String | ID to identify a request of the previous search, which is received as a response to the New Search API call |
object id | Required | String | ID to identify a specific object detected by the previous search (results[].id ) |
Request Body
Name | Required | Type | Description |
---|---|---|---|
limit | Optional | String | Maximum number of items to recommend (default: 10, max: 500) |
showInfo | Optional | List[String] | Select additional information to be displayed along with a recommendation result (multiple selections possible) [METADATA, IMAGE_INFO, CONTEXT_INFO] |
metadataFilter | Optional | Object | Metadata Filter Query (see: Metadata Filter) |
Request Example
In case of receiving up to 100 recommendation results, including all meta information such as metadata
, imageInfo
, and contextInfo
{
"limit": 100,
"showInfo": ["METADATA", "IMAGE_INFO", "CONTEXT_INFO"],
}
In case of only metadata
and contextInfo
information are included, up to 100 recommendations are received, and a metadata filter condition is that the name of the metadata of each product is skirt
{
"limit": 100,
"showInfo": ["METADATA", "CONTEXT_INFO"],
"metadataFilter" : {
"productName": {
"eq": "skirt"
}
}
}
Response
Name | Type | Description |
---|---|---|
transactionId | String | ID to identify a request of the previous search, which is received as a response to the New Search API call |
limit | integer | Maximum number of items to recommend |
expirationDate | String | Expiration date (isoformat, UTC) |
showInfo | List[String] | Selected additional information to be displayed along with a recommendation result |
metadataFilter | Object | Metadata Filter Query (See: Metadata Filter) |
object | Object | Information about the object detected in the request image |
├ object.id | String | An ID of the detected object |
├ object.detection | String | Detection Category information predicted by the model (see [Detection Field]) |
└ object.position | Object | The information of the center position of the detected product from the request image |
ㅤ├ object.position.x | Number | The x-axis coordinate of the center position of the product |
ㅤ└ object.position.y | Number | The y-axis coordinate of the center position of the product |
recommendation | List[Recommendation] | Recommendation results (see below) |
Recommendation
Name | Type | Description |
---|---|---|
order | Integer | An integer number as sorted in order by similarity (zero-based) |
id | String | Unique ID of the query product to be recommended |
similarityScore | float | Between 0 and 1, the higher the value, the higher the similarity. [This is available in 2023-02 version only.] |
metadata | Object | Various product information managed by the customer, such as product name, brand, price, season, and discount rate. (see Product metadata) Null if no value (default) |
imageInfo | Object | Image information of the recommended product. If there is IMAGE_INFO as the input value of showInfo field in the request, the value will be displayed. Null if no value (default) |
├ imageInfo.detection | String | The detection field which is provided by the client when the product information was put into the workspace. (see Detection Field) |
└ imageInfo.url | String | The URL of the representative image of the product. |
contextInfo | Object | Context information of the recommended product. If there is CONTEXT_INFO as the input value of showInfo field, the value will be displayed. Null if no value (default) |
├ contextInfo.salesUrl | String | URL of the page where the product is being sold |
└ contextInfo.mobileSalesUrl | String | Mobile version URL of the page where the product is being sold |
Example Responses
HTTP Status Code: 400 Bad Request
In case of the result corresponding to the given transaction ID and object ID does not exist or has expired
{
"errors": "Transaction 'b3057c85-676d-4dec-9b45-d2eec1594df8' not exist or expired"
}
HTTP Status Code : 200
When recommendations does not exist
{
"transactionId": "b3057c85-676d-4dec-9b45-d2eec1594df8",
"limit": 10,
"showInfo": ["METADATA","IMAGE_INFO"],
"metadataFilter": {
"productName": {
"eq": "skirt"
}
},
"object": {
"id": "0",
"detection": "TOP",
"position": {
"x": 0.36875,
"y": 0.46640627500000004
}
},
"recommendation": []
}
HTTP Status Code : 201
When recommendations exist
Click to Expand
{
"transactionId": "b3057c85-676d-4dec-9b45-d2eec1594df8",
"limit": 10,
"expirationDate": "2022-09-20T00:05:23",
"showInfo": [],
"metadataFilter": {
"productName": {
"eq": "skirt"
}
},
"object": {
"id": "0",
"detection": "TOP",
"position": {
"x": 0.36875,
"y": 0.46640627500000004
}
},
"recommendation": [
{
"order": 0,
"id": "AT000123FB",
"similarityScore": 0.99,
"metadata": null,
"imageInfo": null,
"contextInfo": null
},
{
"order": 1,
"id": "AT00158AE",
"similarityScore": 0.98,
"metadata": null,
"imageInfo": null,
"contextInfo": null
},
{
"order": 2,
"id": "F800158GA",
"similarityScore": 0.97,
"metadata": null,
"imageInfo": null,
"contextInfo": null
},
{
"order": 3,
"id": "AF10881GK",
"similarityScore": 0.96,
"metadata": null,
"imageInfo": null,
"contextInfo": null
}
]
}
In case of receiving up to 10 recommendation results, including all meta information such as metadata
, imageInfo
, and contextInfo
Click to Expand
{
"transactionId": "b3057c85-676d-4dec-9b45-d2eec1594df8",
"limit": 10,
"expirationDate": "2022-09-20T00:05:23",
"showInfo": ["METADATA","IMAGE_INFO", "CONTEXT_INFO"],
"metadataFilter": {
"productName": {
"eq": "skirt"
}
},
"object": {
"id": "0",
"detection": "TOP",
"position": {
"x": 0.36875,
"y": 0.46640627500000004
}
},
"recommendation": [
{
"order": 0,
"id": "AT000123FB",
"similarityScore": 0.99,
"metadata": {
"productName": "a",
"originPrice": 100
},
"imageInfo": {
"detection": "TOP",
"url": "http://imageserverurl/some.image.jpg"
},
"contextInfo": {
"salesUrl": "http://imageserverurl/some.image.jpg",
"mobileSalesUrl": "http://imageserverurl/some.image.jpg"
}
},
{
"order": 1,
"id": "AT00158AE",
"similarityScore": 0.98,
"metadata": {
"productName": "b",
"originPrice": 200
},
"imageInfo": {
"detection": "TOP",
"url": "http://imageserverurl/some.image.jpg"
},
"contextInfo": {
"salesUrl": "http://imageserverurl/some.image.jpg",
"mobileSalesUrl": "http://imageserverurl/some.image.jpg"
}
},
{
"order": 2,
"id": "F800158GA",
"similarityScore": 0.97,
"metadata": {
"productName": "c",
"originPrice": 300
},
"imageInfo": {
"detection": "TOP",
"url": "http://imageserverurl/some.image.jpg"
},
"contextInfo": {
"salesUrl": "http://imageserverurl/some.image.jpg",
"mobileSalesUrl": null
}
},
{
"order": 3,
"id": "AF10881GK",
"similarityScore": 0.96,
"metadata": {
"productName": "d",
"originPrice": 400
},
"imageInfo": {
"detection": "TOP",
"url": "http://imageserverurl/some.image.jpg"
},
"contextInfo": {
"salesUrl": null,
"mobileSalesUrl": "http://imageserverurl/some.image.jpg"
}
}
]
}