Image Forgery Detection API
Developer Access
Detect document and image tampering with a production-ready REST API.
Request & Response Examples
Use these examples to build and debug your integration
Sample HTTP Request
POST https://{your-api-domain}/forgery_detection
Headers:
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"
}Sample Responses
Successful response
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"
}Business error response
When the upstream service reports a business error, the API returns error = "API_ERROR" and a non-zero code. You can map this code using the error code table below.
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 Introduction
The Artificial Intelligence technology specialized in Image Forgery Detection has been made easier than ever before using ImgAuth.com API. With just a few lines of code, you can bring this technology into your application.
Choose API Credits
Select the API credit package that fits your integration volume
Get API Access
After purchase, view your API key and endpoint from your account dashboard
Use Code Samples
Use the following code samples to get started quickly
Go Live
Monitor usage, adjust request parameters, and move to production
Authentication
Authenticate requests with your account API endpoint and bearer token. After purchasing API credits, you can view your endpoint and token in your account dashboard. Keep your token secret and never commit it to public repositories.
API Endpoint
Replace {your-api-domain} with the API endpoint shown in your account dashboard.
Headers
Code Examples
Get started quickly with our code samples
#!/usr/bin/env bash
set -euo pipefail
API_DOMAIN="https://{your-api-domain}"
API_PATH="/forgery_detection"
API_TOKEN="{YOUR_API_TOKEN}"
IMAGE_FILE="${1:-testpaper.jpg}"
BASE64_IMAGE=$(base64 -i "$IMAGE_FILE" | tr -d '
')
read -r -d '' JSON_BODY <<EOF || true
{
"image": "$BASE64_IMAGE",
"return_heatmap": "false",
"detect_proportion": "false",
"restrict_probability": "0.8"
}
EOF
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"Request Parameters
Configure your API requests with these parameters
| Parameter | Type | Description |
|---|---|---|
| image | string | Base64 encoded image data, URL-encoded. Max 10 MB. Shortest side at least 512 px, longest side at most 8192 px. Supports jpg/jpeg/png/bmp. Provide either image or url. |
| url | string | Complete image URL, up to 1024 bytes. The encoded image must stay within 10 MB. Shortest side at least 512 px, longest side at most 8192 px. Supports jpg/jpeg/png/bmp. Provide either image or url. Disable hotlink protection for the file URL. |
| return_heatmap | string | Whether to return a forgery heatmap. Default: false. true returns a Base64 heatmap, false omits it. |
| detect_proportion | string | Whether to return the tampering confidence score. Default: false. true returns the score, false omits it. |
| restrict_probability | string | Threshold for returning forgery coordinates. Range: 0.1 to 1 with 1 decimal place. Default: 0.8. tampered_location is returned only when probability meets or exceeds the threshold. |
Response Parameters
Reference for API response fields
| Parameter | Type | Description |
|---|---|---|
| detection_result | string | Tampering result: "fake" means tampering detected, "real" means no tampering detected. |
| tampered_proportion | float | Tampering confidence score, returned when detect_proportion = true. |
| heatmap | string | Base64 heatmap of tampered regions, returned when return_heatmap = true. |
| tampered_location | array | Array of suspicious region coordinates returned when probability is greater than or equal to restrict_probability. Each item includes left, top, width, height, and probability. |
| left | uint32 | Horizontal coordinate of the suspicious region top-left corner. |
| top | uint32 | Vertical coordinate of the suspicious region top-left corner. |
| width | uint32 | Width of the suspicious region. |
| height | uint32 | Height of the suspicious region. |
| probability | float | Confidence score for this suspicious region. |
Error Codes
Reference for API response codes
| Error Code | Error Message |
|---|---|
| 0 | success |
| 1000 | body error |
| 1001 | param error |
| 1002 | content type error |
| 1003 | image not exists |
| 1004 | image size error |
| 1005 | image format error |
| 1006 | invalid signature |
| 1007 | body size error |
| 1008 | no authorization |
| 2000 | server unknown error |
| 2001 | server timeout |
| 2003 | no content recognition |
| 2004 | validate data error |
| 3000 | remote server error |
| 4000 | base server error |
API messages are shown as raw upstream values so they match production responses exactly.
API Pricing Plans
Discounted versus one-time credits. Subscriptions remain the lowest-cost option for recurring usage.
Developer
Best for evaluation and early integration
- Bearer token authentication
- Forgery result, confidence, heatmap, and region coordinates
- Built for document and image tampering review workflows
- Dashboard access to API endpoint and token after purchase
Growth
Best for production pilots and steady usage
- Bearer token authentication
- Forgery result, confidence, heatmap, and region coordinates
- Built for document and image tampering review workflows
- Dashboard access to API endpoint and token after purchase
Scale
Best for batch workflows and multi-project teams
- Bearer token authentication
- Forgery result, confidence, heatmap, and region coordinates
- Built for document and image tampering review workflows
- Dashboard access to API endpoint and token after purchase
Business
Best for long-term production workloads
- Bearer token authentication
- Forgery result, confidence, heatmap, and region coordinates
- Built for document and image tampering review workflows
- Dashboard access to API endpoint and token after purchase
Why developers trust our API
Built for production workloads, our forgery detection API balances quality, performance, and cost so you can rely on it in real-world apps.
Production-ready reliability
High availability and stable performance tuned for real-world traffic.
Optimized for forgery detection
Models focused on documents, certificates, and invoices with tampering detection for more consistent results.
Predictable, API-only pricing
Dedicated API plans with clear per-credit costs for long-term integrations.
Support when you need it
Email support to help you diagnose issues and improve your integration over time.
1 API credit = 1 API request. API pricing is lower than one-time credit packs, while subscriptions remain the lowest-cost option for recurring usage.