API reference / Document AI
Document forgery check
Scores one or two document images (public https URLs) for tampering. threshold (0-100, default 20) sets the sensitivity; text_fields lets you check printed values.
POST
/v1/read/forgery- Authentication
- Bearer token
- Scope
read:document
Before you integrate
- The answer is returned in this reply; there is nothing to poll for later.
Request body
| Field | Type | Required | Description |
|---|---|---|---|
urls | array | Yes | One or two public https URLs of document images to check, each up to 2040 characters. |
threshold | integer | No | Sensitivity from 0 to 100; defaults to 20. A lower number flags more images. |
text_fields | object | No | Printed values to compare with the image, as name and value pairs; names are 1 to 40 letters, digits or underscores and values up to 200 characters. |
Sample code
Set your key in the GRAPPI_API_KEY environment variable. Sample values are placeholders.
curl -sS -X POST 'https://grappi.ai/v1/read/forgery' \
-H "Authorization: Bearer $GRAPPI_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"urls": [
"https://example.com/kyc/pan-front.jpg"
]
}'Sample response
{
"request_id": "req_01HZY3K8M2",
"result": {
"image_results": [
{
"copymove_detection": {
"info": "No copy-move forgery found",
"score": 0,
"locations": [],
"regions_of_concern": []
},
"photocopy_detection": {
"info": "Not a photocopy",
"score": "0.02"
},
"webcheck_detection": {
"info": "Not found on the web",
"score": "0.01"
},
"screenshot_detection": {
"info": "Not a screenshot",
"score": "0.03"
},
"splice_detection": {
"info": "No splicing found",
"forged": "no",
"score": "0.04"
}
}
],
"image_correlation_results": {}
}
}Response fields
| Field | Type | Description |
|---|---|---|
image_results | array | One entry per image, in the order you sent them. |
image_results[].copymove_detection | object | Check for areas copied and pasted within the image, with info and score. |
image_results[].photocopy_detection | object | Check for a photocopy of a document, with info and score. |
image_results[].webcheck_detection | object | Check for an image taken from the web, with info and score. |
image_results[].screenshot_detection | object | Check for a screenshot, with info and score. |
image_results[].metadata_detection | object | What the image's embedded details show, such as software and camera. |
image_results[].splice_detection | object | Check for parts joined from other images, with info, forged, score and region_of_concern. |
image_results[].textmatch | object | Comparison of your text_fields with the printed text, with a score for each field. |
image_correlation_results | object | Comparison between the two images, when two were sent. |
Errors
Every failure has the same shape. A call that fails on our side or at the data source is refunded to your wallet; a "no record found" answer is charged. See the error reference.