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.

1

Choose API Credits

Select the API credit package that fits your integration volume

2

Get API Access

After purchase, view your API key and endpoint from your account dashboard

3

Use Code Samples

Use the following code samples to get started quickly

4

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

POST https://{your-api-domain}/forgery_detection

Replace {your-api-domain} with the API endpoint shown in your account dashboard.

Headers

Authorization:
Bearer {YOUR_API_TOKEN}
Replace {YOUR_API_TOKEN} with the bearer token shown in your account dashboard. Keep it secret and never commit it to public repositories.
Content-Type:
application/json; charset=UTF-8

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

ParameterTypeDescription
imagestringBase64 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.
urlstringComplete 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_heatmapstringWhether to return a forgery heatmap. Default: false. true returns a Base64 heatmap, false omits it.
detect_proportionstringWhether to return the tampering confidence score. Default: false. true returns the score, false omits it.
restrict_probabilitystringThreshold 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

ParameterTypeDescription
detection_resultstringTampering result: "fake" means tampering detected, "real" means no tampering detected.
tampered_proportionfloatTampering confidence score, returned when detect_proportion = true.
heatmapstringBase64 heatmap of tampered regions, returned when return_heatmap = true.
tampered_locationarrayArray of suspicious region coordinates returned when probability is greater than or equal to restrict_probability. Each item includes left, top, width, height, and probability.
leftuint32Horizontal coordinate of the suspicious region top-left corner.
topuint32Vertical coordinate of the suspicious region top-left corner.
widthuint32Width of the suspicious region.
heightuint32Height of the suspicious region.
probabilityfloatConfidence score for this suspicious region.

Error Codes

Reference for API response codes

Error CodeError Message
0success
1000body error
1001param error
1002content type error
1003image not exists
1004image size error
1005image format error
1006invalid signature
1007body size error
1008no authorization
2000server unknown error
2001server timeout
2003no content recognition
2004validate data error
3000remote server error
4000base 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

$99
500 Credits
12-month validity

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
Most Popular

Growth

$359
2,000 Credits
12-month validity

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

$899
5,000 Credits
12-month validity

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
Best Value

Business

$2,499
15,000 Credits
12-month validity

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.