Image Moderation API
API Endpoint
기본 API Endpoint는 아래와 같으며, 현재 최신 버전은 2024-07 입니다.
https://api.kr.omnicommerce.ai/2024-07/
Moderation API
GET /image-moderation/tags/<product id>: 분석 결과 전달
해당하는 상품 아이디에 대한 Image Moderation Tag를 전달합니다.
Request Header
| Name | Required | Type | Description |
|---|---|---|---|
| X-Api-Key | 필수 | String | API Key (참조: API 인증 가이드) |
| Content-Type | 필수 | String | 요청 Type. Application/json 만 지원합니다. |
| Accept-Language | 필수 | String | 태그 정보를 받을 언어를 선택합니다. KO, ko-KR (한국어) | EN, en-US(영어(미국)) | en-UK(영어(영국)) | ZH(중국어) | JA(일본어) 중 하나 선택. (default: en-US) |
Response
| Name | Type | Description |
|---|---|---|
| imageModeration[] | List[Object] | 이미지를 기준으로 한 Moderation Tag |
| ├ imageModeration[].id | String | Moderation 속성 아이디 |
| ├ imageModeration[].group | String | Modereation Group |
| ├ imageModeration[].name | String | Moderation 속성명 (언어팩 적용) |
| └ imageModeration[].confidence | String | AI 모델이 예측한 속성에 대한 Confidence |
| productInfo | Object | 상품 정보 |
| ├ productInfo.id | String | 상품 아이디 |
| ├ productInfo.url | String | 상품의 대표 이미지 URL |
| ├ productInfo.salesUrl | String | 상품이 판매되고 있는 페이지의 URL |
| ├ productInfo.mobileSalesUrl | String | 상품이 판매되고 있는 페이지의 모바일 버전 URL |
| ├ productInfo.detection | String | 상품에 대한 Detection 정보 (참조: Detection 정보) |
| └ productInfo.metadata | Object | 상품에 대한 메타정보 (참조: 상품 Meta 정보) |
Response Example
400 Bad Request
{
"errors": "invalid request format."
}
201 Created
{
"imageModeration": [
{
"id": "exMODG05F001",
"group": "IMAGE_INFO",
"name": "backgrounds",
"confidence": 0.9995
},
{
"id": "exMODG04F001",
"group": "DOMAIN",
"name": "fashion",
"confidence": 0.998
},
{
"id": "moMODG03F001",
"group": "GENDER",
"name": "female",
"confidence": 0.995
},
{
"id": "exMODG02F001",
"group": "IMAGE_INFO",
"name": "collage",
"confidence": 0.9995
},
{
"id": "exMODG01F001",
"group": "IMAGE_INFO",
"name": "text-overlay",
"confidence": 0.9995
},
{
"id": "exMODG07F001",
"group": "FIGURE",
"name": "human_figure",
"confidence": 0.9996
},
{
"id": "exMODG06F002",
"group": "DIRECTION",
"name": "diagnoal_view",
"confidence": 0.9995
},
{
"id": "exMODG08F002",
"group": "POSE",
"name": "stand",
"confidence": 0.9999
}
],
"productInfo": {
"detection": "TOP",
"id": "A1000",
"metadata": {
"brand": "다밍",
"currency": "KRW",
"discountPrice": 39000.0,
"gender": "WOMEN",
"mobileCurrency": "",
"mobilePrice": 0.0,
"name": "호웰니트",
"price": 39000.0
},
"mobileSalesUrl": null,
"salesUrl": "https://salesUrl.com/products/A1000",
"url": "https://image.url.com/image.jpg"
}
}
200 OK
빈 값인 경우
{
"imageModeration": [],
"productInfo": {
"detection": "TOP",
"id": "A1000",
"metadata": {
"brand": "다밍",
"currency": "KRW",
"discountPrice": 39000.0,
"gender": "WOMEN",
"mobileCurrency": "",
"mobilePrice": 0.0,
"name": "호웰니트",
"price": 39000.0
},
"mobileSalesUrl": null,
"salesUrl": "https://salesUrl.com/products/A1000",
"url": "https://image.url.com/image.jpg"
}
}
POST /image-moderation/tags/<product id>: 여러 상품의 분석 결과 전달
여러 상품 아이디에 대한 Image Moderation Tag를 전달합니다. (최대 100개 까지)
Request Header
| Name | Required | Type | Description |
|---|---|---|---|
| X-Api-Key | 필수 | String | API Key (참조: API 인증 가이드) |
| Content-Type | 필수 | String | 요청 Type. Application/json 만 지원합니다. |
| Accept-Language | 필수 | String | Moderation 결과를 받을 언어를 선택합니다. KO, ko-KR (한국어) | EN, en-US(영어(미국)) | en-UK(영어(영국)) | ZH(중국어) | JA(일본어) 중 하나 선택. (default: en-US) |
Request Body
| Name | Required | Type | Description |
|---|---|---|---|
| productIds | 필수 | List[String] | 상품 아이디의 List. 최대 100개 까지 가능합니다. |
Request Example
{
"productIds": [
"A1000", "A1001", "A1002"
]
}
Response
| Name | Type | Description |
|---|---|---|
| complete | Object | 요청한 상품 중 분석이 완료된 상품에 대한 정보 |
| ├ complete.count | Integer | 요청한 상품 중 분석이 완료된 상품의 수량 |
| └ complete.products | List[Products] | 분석이 완료된 상품의 태깅 정보 (아래의 Products 참조) |
| failed | Object | 요청한 상품 중 분석에 실패한 상품에 대한 정보 |
| ├ failed.count | Integer | 요청한 상품 중 분석에 실패한 상품의 수량 |
| └ failed.errors | List[Object] | 분석에 실패한 상품의 상세 오류 정보 |
| ㅤ├ failed.errors[].id | String | 분석에 실패한 상품의 아이디 |
| ㅤ└ failed.errors[].errors | String | 분석에 실패한 상품의 오류에 대한 설명 |
Products
| Name | Type | Description |
|---|---|---|
| imageModeration[] | List[Object] | 이미지를 기준으로 한 성별 정보 |
| ├ imageModeration[].id | String | Moderation 속성 아이디 |
| ├ imageModeration[].group | String | Modereation Group |
| ├ imageModeration[].name | String | Moderation 속성명 (언어팩 적용) |
| └ imageModeration[].confidence | String | AI 모델이 예측한 속성에 대한 Confidence |
| productInfo | Object | 상품 정보 |
| ├ productInfo.id | String | 상품 아이디 |
| ├ productInfo.url | String | 상품의 대표 이미지 URL |
| ├ productInfo.salesUrl | String | 상품이 판매되고 있는 페이지의 URL |
| ├ productInfo.mobileSalesUrl | String | 상품이 판매되고 있는 페이지의 모바일 버전 URL |
| ├ productInfo.detection | String | 상품에 대한 Detection 정보 (참조: Detection 정보) |
| └ productInfo.metadata | Object | 상품에 대한 메타정보 (참조: 상품 Meta 정보) |
Response Example
400 Bad Request
{
"errors": "json format error."
}
201 Created
{
"complete": {
"count": 1,
"products": [
...//GET /image-moderation/tags/<product_id> 의 결과 값과 동일
]
},
"failed": {
"count": 1,
"errors": [
{
"id": "A1000",
"errors": "fail to prove image from url."
}
]
}
}
Full Example
{
"complete": {
"count": 1,
"products": [
{
"imageModeration": [
{
"id": "exMODG05F001",
"group": "IMAGE_INFO",
"name": "backgrounds",
"confidence": 0.9995
},
{
"id": "moMODG03F001",
"group": "GENDER",
"name": "female",
"confidence": 0.995
},
{
"id": "exMODG04F001",
"group": "DOMAIN",
"name": "fashion",
"confidence": 0.998
},
{
"id": "exMODG02F001",
"group": "IMAGE_INFO",
"name": "collage",
"confidence": 0.9995
},
{
"id": "exMODG01F001",
"group": "IMAGE_INFO",
"name": "text-overlay",
"confidence": 0.9995
},
{
"id": "exMODG07F001",
"group": "FIGURE",
"name": "human_figure",
"confidence": 0.9996
},
{
"id": "exMODG06F002",
"group": "DIRECTION",
"name": "diagnoal_view",
"confidence": 0.9995
},
{
"id": "exMODG08F002",
"group": "POSE",
"name": "stand",
"confidence": 0.9999
}
],
"productInfo": {
"detection": "TOP",
"id": "A1000",
"metadata": {
"brand": "다밍",
"currency": "KRW",
"discountPrice": 39000.0,
"gender": "WOMEN",
"mobileCurrency": "",
"mobilePrice": 0.0,
"name": "호웰니트",
"price": 39000.0
},
"mobileSalesUrl": null,
"salesUrl": "https://salesUrl.com/products/A1000",
"url": "https://image.url.com/image.jpg"
}
}
]
},
"failed": {
"count": 1,
"errors": [
{
"id": "A1000",
"errors": "fail to prove image from url."
}
]
}
}