요청 및 응답 예제
이 예제를 사용하여 통합을 구축하고 디버그하세요
샘플 HTTP 요청
POST https://{your-api-domain}/forgery_detection
헤더:
Authorization: Bearer {YOUR_API_TOKEN}
Content-Type: application/json; charset=UTF-8
Body:
{
"image": "<BASE64_IMAGE_WITHOUT_PREFIX>",
"return_heatmap": "false",
"detect_proportion": "false",
"restrict_probability": "0.8"
}샘플 응답
성공 응답
When the request is valid and the image is processed successfully, the API returns detection_result indicating whether the image is tampered (fake) or authentic (real), along with optional tampering confidence, heatmap, and location coordinates.
HTTP/1.1 200 OK
Content-Type: application/json; charset=UTF-8
{
"code": 0,
"data": {
"detection_result": "fake",
"tampered_proportion": 0.000587,
"heatmap": "<BASE64_HEATMAP_IMAGE>",
"tampered_location": [
{
"left": 100,
"top": 200,
"width": 150,
"height": 100,
"probability": 0.95
}
]
},
"message": "Success"
}비즈니스 오류 응답
업스트림 서비스가 비즈니스 오류를 보고하면 API는 오류 = "API_ERROR"와 0이 아닌 코드를 반환합니다. 아래 오류 코드 테이블을 사용하여 이 코드를 매핑할 수 있습니다.
HTTP/1.1 400 Bad Request
Content-Type: application/json; charset=UTF-8
{
"error": "API_ERROR",
"code": 1004,
"message": "Image size error. Please ensure the image is less than 5MB and the longest side is less than 4000px."
}API 소개
위조 감지에 특화된 인공지능 기술이 ImgAuth.com API를 사용하여 그 어느 때보다 쉬워졌습니다. 몇 줄의 코드만으로 이 기술을 애플리케이션에 통합할 수 있습니다.
패키지 구매
API 전용 패키지 구매
API 이메일 수신
구매 후 2시간 이내에 전용 API 도메인과 AppCode가 포함된 이메일을 받게 됩니다.
코드 샘플 사용
다음 코드 샘플을 사용하여 빠르게 시작
매개변수 조정
매개변수 참조로 돌아가 요청 조정
인증
전용 API 도메인과 계정별 Bearer 토큰을 사용하여 요청을 인증합니다. API 패키지를 구매한 후 고유한 API 도메인과 토큰을 이메일로 보내드립니다. 보안상의 이유로 API 토큰을 공개하지 마세요.
API 엔드포인트
{your-api-domain}을 구매 후 이메일로 보내드리는 API 도메인으로 교체하세요. 각 개발자에게는 전용 도메인과 토큰이 있습니다.
헤더
코드 예제
코드 샘플로 빠르게 시작하세요
#!/usr/bin/env bash
set -euo pipefail
# Domain and token for the image processing proxy
API_DOMAIN="https://{your-api-domain}"
API_PATH="/forgery_detection"
API_TOKEN="{YOUR_API_TOKEN}"
# Image file passed as first argument (default: testpaper.jpg)
IMAGE_FILE="${1:-testpaper.jpg}"
if [ ! -f "$IMAGE_FILE" ]; then
echo "Image file not found: $IMAGE_FILE" >&2
echo "Usage: $0 path/to/image.jpg" >&2
exit 1
fi
echo "Encoding image to Base64: $IMAGE_FILE"
# Encode image to Base64 and remove newlines (use -i for BSD base64 on macOS)
BASE64_IMAGE=$(base64 -i "$IMAGE_FILE" | tr -d '
')
echo "Building JSON body..."
read -r -d '' JSON_BODY <<EOF || true
{
"image": "$BASE64_IMAGE",
"return_heatmap": "false",
"detect_proportion": "false",
"restrict_probability": "0.8"
}
EOF
echo "Calling proxy API..."
curl -X POST "${API_DOMAIN}${API_PATH}" \
-H "Authorization: Bearer ${API_TOKEN}" \
-H "Content-Type: application/json; charset=UTF-8" \
-d "$JSON_BODY" \
-o response.json \
-s -w "\nHTTP status: %{http_code}\n"
echo "Response saved to response.json"요청 매개변수
이 매개변수로 API 요청 구성
| 매개변수 | 유형 | 설명 |
|---|---|---|
| image | string | Base64 encoded image data, urlencoded. Size must not exceed 10MB. Shortest side at least 512px, longest side max 8192px. Supports jpg/jpeg/png/bmp formats. Either image or url is required. |
| url | string | Complete image URL, length not exceeding 1024 bytes. Image size must not exceed 10MB after base64 encoding. Shortest side at least 512px, longest side max 8192px. Supports jpg/jpeg/png/bmp formats. Either image or url is required. Please disable URL hotlink protection. |
| return_heatmap | string | Whether to return forgery region heatmap. Default: false. true: returns base64-encoded heatmap, false: does not return |
| detect_proportion | string | Whether to return image tampering confidence. Default: false. true: returns tampering confidence, false: does not return |
| restrict_probability | string | Threshold for returning forgery region coordinates. Range: 0.1 to 1, supports 1 decimal place. Default: 0.8. When forgery region coordinate confidence score (probability) ≥ threshold, tampered_location returns coordinates meeting the threshold, otherwise does not return coordinates |
Response Parameters
Reference for API response fields
| Parameter | Type | Description |
|---|---|---|
| detection_result | string | Tampering detection result: "fake" indicates tampering detected, "real" indicates no tampering |
| tampered_proportion | float | Image tampering confidence (returned when detect_proportion = true in request) |
| heatmap | string | Base64-encoded heatmap of tampered regions (returned when return_heatmap = true in request) |
| tampered_location | array | Array of forgery region coordinate information (returned when probability ≥ restrict_probability threshold). Each item contains: left, top, width, height (coordinates), and probability (confidence score) |
| left | uint32 | Horizontal coordinate of the top-left vertex of the forgery region |
| top | uint32 | Vertical coordinate of the top-left vertex of the forgery region |
| width | uint32 | Width of the forgery region |
| height | uint32 | Height of the forgery region |
| probability | float | Confidence score indicating the probability of forgery in this region |
오류 코드
API 응답 코드 참조
| 오류 코드 | 오류 메시지 | 설명 |
|---|---|---|
| 0 | success | Success |
| 1000 | body error | Request body error |
| 1001 | param error | Request parameter error |
| 1002 | content type error | Content-Type error |
| 1003 | image not exists | Image file not found |
| 1004 | image size error | Image size error |
| 1005 | image format error | Image format error |
| 1006 | invalid signature | Invalid signature |
| 1007 | body size error | Body size error |
| 1008 | no authorization | Authorization failed |
| 2000 | server unknown error | Server unknown error |
| 2001 | server timeout | Server timeout |
| 2003 | no content recognition | No content recognized |
| 2004 | validate data error | Validation data error |
| 3000 | remote server error | Remote server error |
| 4000 | base server error | Base server error |
API 가격 플랜
다음 플랜은 API 전용입니다
Starter
- 대부분의 이미지 형식 지원
- 문서 수정 및 향상
- 문서 위조 감지
- 이미지 모아레 패턴 제거
- 처리 속도 ~2초
Popular
- 대부분의 이미지 형식 지원
- 문서 수정 및 향상
- 문서 위조 감지
- 이미지 모아레 패턴 제거
- 처리 속도 ~2초
Business
- 대부분의 이미지 형식 지원
- 문서 수정 및 향상
- 문서 위조 감지
- 이미지 모아레 패턴 제거
- 처리 속도 ~2초
Enterprise
- 대부분의 이미지 형식 지원
- 문서 수정 및 향상
- 문서 위조 감지
- 이미지 모아레 패턴 제거
- 처리 속도 ~2초
개발자가 우리 API를 신뢰하는 이유
프로덕션 워크로드를 위해 구축된 우리의 위조 감지 API는 품질, 성능 및 비용의 균형을 맞춰 실제 애플리케이션에서 신뢰할 수 있습니다.
프로덕션 준비 신뢰성
실제 트래픽에 최적화된 높은 가용성과 안정적인 성능.
위조 감지에 최적화
더 일관된 결과를 위해 조작 감지 기능이 있는 문서, 인증서 및 청구서에 중점을 둔 모델.
예측 가능한 API 전용 가격
장기 통합을 위한 명확한 크레딧당 비용이 있는 전용 API 플랜.
필요할 때 지원
문제를 진단하고 시간이 지남에 따라 통합을 개선하는 데 도움이 되는 이메일 지원.