Credential Detection Service

Updated at:

The Credential Detection Service provides an API operation that uses a Large Language Model (LLM) to detect tampering and forgery in credential images. It can identify various forgery risks, such as Photoshop tampering, screen recaptures, screenshots, printed copies, and watermarks.

API information

Important

Before calling this API, read the integration process and activate the service.

  • API name: CredentialVerifyV2

  • Description: Submits a credential image for tampering, forgery, and returns the risk detection results.

    Note
    1. The Credential Detection Service is an AI-powered predictive product that achieves 90% accuracy on our internal test datasets. Actual accuracy may vary depending on the specific use case and sample images.

    2. Detecting Photoshop alterations in digitally synthesized images is more challenging. The service performs better on images from a native camera than on digitally synthesized images.

    3. Do not use the detection result as the sole basis for determining a credential's authenticity. Use it as a supplementary tool for manual review or to improve review efficiency.

    4. Credential detection only identifies tampering and forgery in images and does not verify whether the type of the submitted image matches the expected type. For optimal detection results, submit images of the correct type.

  • QPS limits: This API is subject to dedicated QPS limits. For more information, see QPS Limits for Identity Verification APIs.

  • Service endpoint:

    Region

    IPv4

    IPv6

    common

    cloudauth.aliyuncs.com

    cloudauth-dualstack.aliyuncs.com

    China (Beijing)

    cloudauth.cn-beijing.aliyuncs.com

    cloudauth-dualstack.cn-beijing.aliyuncs.com

    China (Shanghai)

    cloudauth.cn-shanghai.aliyuncs.com

    cloudauth-dualstack.cn-shanghai.aliyuncs.com

    Note
    • To reduce latency, select an endpoint that is geographically close to your servers.

    • You can also create a list of endpoints and poll them in rotation to improve availability.

    Important

    The Information Verification Service does not support a hard cap or automatic deactivation based on the number of calls. To control costs and prevent high bills, we recommend configuring spending alert rules:

    1. Configure spending alerts: Set High-Spending Alert thresholds to monitor your expenses in real time.

    2. Monitor your resource package balance: If you have purchased a resource package, also Set Resource Package Balance Alert. This lets you promptly replenish the package or adjust your call strategy.

    3. Configure business monitoring: See security management to monitor business requests for anomalies and fluctuations.

Request parameters

The image specified in the ImageUrl, ImageFileObject, or ImageContext parameter must meet the following requirements:

  • Image format: Supports PNG, JPG, JPEG, BMP, and WebP.

  • Image dimensions: Image width and height must be greater than 15 pixels and less than 8,192 pixels. The aspect ratio must be less than 50.

    Note

    For optimal recognition results, we recommend that both the width and height of the image are greater than 500 pixels.

  • Image size: The image size limit is 10 MB for URLs and 5 MB for Base64-encoded content.

    Note

    Large images can increase API response time. For best performance, use images smaller than 3 MB.

Parameter

Type

Required

Description

Example

CredType

String

Yes

The credential type. Valid values:

  • 01: Personal cards and certificates

01

CredName

String

Yes

The credential name, specified by a numeric code. Valid values:

  • Codes starting with 01 are for personal cards and certificates:

    • 0101: ID card

    • 0104: Teacher's qualification certificate

    • 0108: Chinese Driving License

Note

Credential types not listed here are not supported.

0101

ProductCode

String

Yes

The invocation mode. Valid values: ANTI_FAKE_CHECK: Performs anti-forgery detection to verify image authenticity.

ANTI_FAKE_CHECK

imageUrl

String

Yes

  • imageUrl: The URL of the image.

  • ImageFileObject: The InputStream object of the image.

  • ImageContext: The Base64-encoded image content.

Important

You must specify one of imageUrl, ImageFileObject, or ImageContext.

https://aliyundoc.com/picture*****.jpeg

ImageFileObject

InputStream

Yes

For more information about how to use this parameter, see Configure advanced file uploads.

ImageContext

String

Yes

iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mP8z8BQDwAEhQGA...

MerchantId

String

No

The merchant ID.

Important

This parameter is required if the CredName value starts with 02.

N/A

UserName

String

No

The name on the credential.

John Smith

IdentifyNum

String

No

The ID card number.

142702******

CertNum

String

No

The number of the certificate being verified.

N/A

Response parameters

Parameter

Type

Description

Example

RequestId

String

The ID of the request.

130A2C10-B9EE-4D84-88E3-5384********

Message

String

The returned message.

success

Code

String

The response code. A value of 200 indicates that the call was successful. Other values indicate that the call failed.

Important
  • This parameter indicates whether the API call was successful. For detailed descriptions of the return codes, refer to server-side error codes.

  • To see the business verification result, check the fields in ResultObject.

200

ResultObject

Result

String

  • 0: Low risk

  • 1: High risk

  • 2: Suspicious

1

RiskTag

String

The risk tags. Multiple tags are separated by commas. Valid values include:

  • PS: Photoshop alteration

  • SCREEN_PHOTO: Screen photo

  • SCREENSHOT: Screenshot

  • WATERMARK: Watermark

  • SAME_BACKGROUND: Similar background

  • ORIGINAL_PHOTO: Not an original image

PS

RiskScore

Map<String,String>

The risk scores.

{
"PS": "0.0211",
"SCREEN_PHOTO": "0.0101",
"SCREENSHOT": "0.0521",
"WATERMARK": "0.0001",
"SAME_BACKGROUND": "0.0861"
}

MaterialInfo

String

Additional information in JSON format.

{
 "sameBackgroundDetail": {
 // Request ID of the original image that has a similar background
 "originalRequestId": "130A2C10-B9EE-4D84-88E3-5384FF03****";
 // Merchant ID from the request for the original image that has a similar background
 "originalMerchantId": "xxxxxxxx" 
 }
}

SDK call examples

Important

Before you integrate, read the integration process, activate the service, and get an AccessKey and configure the environment variables.

Get SDK samples and installation packages:

  • On the online API debugging page in OpenAPI, find the SDK sample code on the right. Click SDK installation information in the upper-right corner of the code sample to view installation details.

    Note

    Select the required programming language.

    image

  • For offline installation, go to the SDK installation page, select the SDK for your programming language, and download it from the publishing address.

    image