POST/api/v1/hira-detect/detect
HIRA 약가코드 검출
HIRA 약가코드(9자리)를 검출하고 제약사별로 태깅합니다. API 키 하나로 바로 호출하세요.
무료 10회200원 / 호출OpenAPI 스펙(JSON)
데모 체험
이미지를 올려 실제 결과를 바로 확인하세요. (로그인 없이, 하루 횟수 제한)
엔드포인트
POST https://marketapi.nadoo.ai/api/v1/hira-detect/detect인증
| 헤더 | 타입 | 필수 | 설명 |
|---|---|---|---|
x-api-key | string | 필수 | 대시보드에서 발급한 API 키 (pk_live_…) |
요청
요청 헤더
| 헤더 | 타입 | 필수 | 설명 |
|---|---|---|---|
Content-Type | string | 필수 | image/jpeg, image/png (바이너리) 또는 application/json |
Idempotency-Key | string | 선택 | 동일 키 재요청 시 이중 과금 방지 (권장: UUID) |
요청 본문 — (A) 바이너리
Content-Type: image/jpeg(또는 png)로 이미지 바이트를 그대로 전송합니다. (최대 25MB)
요청 본문 — (B) JSON
| 필드 | 타입 | 필수 | 설명 |
|---|---|---|---|
image | string | 택1 | base64 인코딩된 이미지 |
imageUrl | string(uri) | 택1 | 이미지 https URL (서버가 다운로드). image와 택일 |
응답 200 OK
| 필드 | 타입 | 설명 |
|---|---|---|
requestId | string | 요청 식별자 (idempotency 키와 동일) |
items | object[] | 검출된 약가코드별 결과 (아래 items 스키마) |
items[].code | string | 9자리 약가코드 |
items[].manufacturer | string | null | 제약사명 (코마케팅 표기 반영, 미조회 시 null) |
items[].drugName | string | null | 의약품명 (미조회 시 null) |
items[].found | boolean | 마스터 조회 성공 여부 |
uniqueManufacturers | string[] | 검출된 제약사 목록 (중복 제거) |
tagged | boolean | 멀티 제약사면 true → 라벨 합성 이미지 반환 |
rotation | number | 자동 보정한 회전 각도 (0/90/180/270) |
unknownCodes | string[] | 검출됐으나 마스터 미조회된 코드 |
output | object | 결과 이미지 (아래 output 스키마) |
output.mode | "gcs" | "inline" | gcs=서명 URL, inline=base64 직접 |
output.url | string(uri) | (gcs) 결과 이미지 서명 URL, 기본 1시간 유효 |
output.base64 | string | (inline) base64 인코딩 결과 이미지 |
output.contentType | string | 결과 이미지 MIME (image/png 또는 image/jpeg) |
cost.krw | number | 이번 호출 과금액(원). 무료 처리 시 0 |
cost.free | boolean | 무료 제공량으로 처리됐는지 |
balanceKrw | number | 처리 후 크레딧 잔액(원) |
응답 예시
{
"requestId": "3f9a1c2e-...",
"items": [
{ "code": "658107190", "manufacturer": "한풍제약 주식회사",
"drugName": "아제나정(아젤라스틴염산염)", "found": true }
],
"uniqueManufacturers": ["한풍제약 주식회사"],
"tagged": false,
"rotation": 90,
"unknownCodes": [],
"output": {
"mode": "gcs",
"contentType": "image/jpeg",
"url": "https://storage.googleapis.com/cso-ai-results/annotated/...?X-Amz-..."
},
"cost": { "krw": 200, "free": false },
"balanceKrw": 49800
}에러 응답
본문: { "error": "<code>", ... }
| HTTP | error | 추가 필드 | 의미 |
|---|---|---|---|
| 401 | invalid_key | — | API 키 누락/무효 |
| 402 | insufficient_credit | freeUsed, freeQuota, applyUrl | 무료 소진 + 잔액 부족 |
| 404 | product_not_found | — | 없는/종료된 API |
| 422 | bad_image | — | 이미지/본문 해석 불가 |
| 502 | processor_error | refunded | 처리 실패 (자동 환불) |
// 402 예시
{ "error": "insufficient_credit", "freeUsed": 10, "freeQuota": 10,
"applyUrl": "https://cso.nadoo.ai/dashboard/apply" }예시 (cURL)
curl -X POST https://marketapi.nadoo.ai/api/v1/hira-detect/detect \
-H "x-api-key: pk_live_xxxxxxxx" \
-H "Content-Type: image/jpeg" \
-H "Idempotency-Key: $(uuidgen)" \
--data-binary @처방전.jpg