Kuvaväärennösten Havaitseminen
API
Havaitse väärennökset missä tahansa kuvassa 1 API-kutsulla
Pyyntö- ja Vastausesimerkit
Käytä näitä esimerkkejä rakentaaksesi ja debugataksesi integraatiosi
Esimerkki HTTP-pyyntö
POST https://{your-api-domain}/forgery_detection
Otsakkeet:
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"
}Esimerkki vastaukset
Onnistunut vastaus
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"
}Liiketoimintavirheen vastaus
Kun ylävirran palvelu raportoi liiketoimintavirheen, API palauttaa virheen = "API_ERROR" ja nollasta poikkeavan koodin. Voit kartoittaa tämän koodin käyttämällä alla olevaa virhekooditaulukkoa.
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 Johdanto
Tekoälyteknologia, joka on erikoistunut kuvaväärennösten havaitsemiseen, on tehty helpommaksi kuin koskaan ImgAuth.com API:n avulla. Vain muutamalla koodirivillä voit tuoda tämän teknologian sovellukseesi.
Osta Paketti
Osta API:lle omistettu paketti
Vastaanota API Sähköposti
2 tunnin kuluessa ostoksestasi saat sähköpostin, jossa on omistettu API-verkkotunnuksesi ja AppCode.
Käytä Koodiesimerkkejä
Käytä seuraavia koodiesimerkkejä aloittaaksesi nopeasti
Säädä Parametrit
Palaa parametri-viitteeseen säätääksesi pyyntöä
Todennus
Tunnistamme pyynnöt käyttämällä omistettua API-verkkotunnusta ja tilikohtaista Bearer-tokenia. Kun olet ostanut API-paketin, lähetämme sinulle sähköpostin, jossa on ainutlaatuinen API-verkkotunnuksesi ja token. Turvallisuussyistä älä julkaise API-tokeniasi.
API Päätepiste
Korvaa {your-api-domain} API-verkkotunnuksella, jonka lähetämme sinulle sähköpostitse oston jälkeen. Jokaisella kehittäjällä on omistettu verkkotunnus ja token.
Otsakkeet
Koodiesimerkit
Aloita nopeasti koodiesimerkeillämme
#!/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"Pyyntöparametrit
Määritä API-pyyntösi näillä parametreilla
| Parametri | Tyyppi | Kuvaus |
|---|---|---|
| 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 |
Virhekoodit
Viite API-vastauskoodeille
| Virhekoodi | Virheilmoitus | Kuvaus |
|---|---|---|
| 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 Hinnoittelusuunnitelmat
Seuraavat suunnitelmat ovat API-eksklusiivisia
Starter
- Tukee useimpia kuvamuotoja
- Asiakirjan korjaus ja parantaminen
- Asiakirjan väärennösten havaitseminen
- Kuvan moiré-kuvion poistaminen
- Käsittelynopeus ~2 sekuntia
Popular
- Tukee useimpia kuvamuotoja
- Asiakirjan korjaus ja parantaminen
- Asiakirjan väärennösten havaitseminen
- Kuvan moiré-kuvion poistaminen
- Käsittelynopeus ~2 sekuntia
Business
- Tukee useimpia kuvamuotoja
- Asiakirjan korjaus ja parantaminen
- Asiakirjan väärennösten havaitseminen
- Kuvan moiré-kuvion poistaminen
- Käsittelynopeus ~2 sekuntia
Enterprise
- Tukee useimpia kuvamuotoja
- Asiakirjan korjaus ja parantaminen
- Asiakirjan väärennösten havaitseminen
- Kuvan moiré-kuvion poistaminen
- Käsittelynopeus ~2 sekuntia
Miksi kehittäjät luottavat API:imme
Rakennettu tuotantotyömääriä varten, väärennösten havaitsemisen API:imme tasapainottaa laadun, suorituskyvyn ja kustannukset, jotta voit luottaa siihen todellisissa sovelluksissa.
Tuotantovalmis luotettavuus
Korkea saatavuus ja vakaa suorituskyky viritetty todelliseen liikenteeseen.
Optimoitu väärennösten havaitsemiseen
Mallit keskittyvät asiakirjoihin, sertifikaatteihin ja laskuihin manipulointihavainnolla johdonmukaisempia tuloksia varten.
Ennustettava, vain API-hinnoittelu
Omistetut API-suunnitelmat selkeillä luottokustannuksilla pitkäaikaisille integraatioille.
Tuki kun sitä tarvitset
Sähköpostituki auttaa sinua diagnosoimaan ongelmia ja parantamaan integraatiotasi ajan myötä.