Online Image Detection API

API Address

https://as.dun.163yun.com/V4/image/check

API Description

The API synchronously returns the real-time anti-spam detection result of the content security service, and the product can performs preliminary filtering according to the image classification result. Due to the influence of the network environment and the size of the picture itself (recommended to check after the product is compressed), some pictures may have a download timeout condition,and the part of the data will go to the offline detection module for offline processing of the machine until it is obtained result. After the offline detection, there may be some uncertain data that needs to be confirmed manually. Offline detection results and manual confirmation results require the product to periodically call offline image detection result acquisition.

Image Restrictions

Currently supported image file formats are: jpg, png, bmp, gif, webp, tiff;

Support picture size: single <10M;

Image size: not less than 50px*50px;

GIF/long image: Yidun will automatically detected by frame, up to 5, the billing is according to the actual number of frame;

Long image definition: aspect ratio is barger than 5;

Request Parameters

The public parameters have been omitted. See Public Request Parameters for details

Parameter NameTypeRequiredMaximum LengthDescription
imagesString(json array)Y32 or 10MBimages for json arrays, support for batch detection
accountStringN128User unique identifier, null if no login required
ipStringN32User IP Address
versionStringY4API version V4

Image parameter structure description

Field NameTypeRequiredMaximum LengthDescription
nameStringY1024Image name (or image identifier), this field is the callback signal field, the product can be designed according to the business situation, such as json structure, or picture url can be
typeNumberY4Type, respectively 1: Image URL, 2: Image BASE64 value
dataStringY32 or 10MBImage content, the value is the image URL if as type=1, then the value is the picture BASE64 value if as type=2. Image URL detection supports up to 32 single requests, and image BASE64 value detection single request size is limited to a maximum of 10MB

Response Result

The response field is as follows, the response common field has been omitted, see Response General Fields for details:

Anstispam Result

Antispam array data structure

Parameter NameTypeDescription
nameStringImage Name (or Image ID)
taskIdStringThis request data identifier, you can query the latest results of the data according to the identifier
statusNumberImage detection status code, defined as: 0: successful detection, 610: image download failed, 620: image format error, 630: other
actionjson objectAdvice action,2:suggest to delete,1:suggest to audit,0:suggest to pass
labelsjson arrayclassification information

labels data structure

Parameter NameTypeDescription
labelNumberClassified information, 100: porn, 110: sexy, 200: advertising, 210: two-dimension code, 300: horror, 400: prohibited, 500: political affairs
subLabelsNumberSubcategory information, which may contain more than one, may be empty
levelNumberClassification level, 0: Normal, 1: Uncertain, 2: OK
rateNumberThe confidence score is taken between 0 and 1, with 1 being the highest confidence and 0 being the lowest

subLabels data structure

Parameter NameTypeDescription
subLabelNumbersubclassification ,Please refer to the corresponding subclassification coding table below
rateNumberThe confidence score is taken between 0 and 1, with 1 being the highest confidence and 0 being the lowest
detailsNumberhtiInfos: Hit details

subclassification coding table

CodeCharacterDescription
10000PORN_COMMONporn
10001PORN_VAGINAvagina
10002PORN_NIPPLEnipple
10003PORN_PENNISpennis
10004PORN_SEXUALsexual
10005PORN_HIPhip
10006PORN_BLOWJOBblowjob
10007PORN_CARTOONcartoon porn
10008PORN_FACEporn face
10009PORN_CHILDchild porn
11000SEXY_COMMONsexy vulgar
20000AD_COMMONadvertising
21000QRCODE_COMMONQr code
30000TERRORISM_COMMONviolence
30001TERRORISM_GALLERYviolence gallery
30002TERRORISM_FLAGviolence flag
30003TERRORISM_FACEviolence face
30004TERRORISM_LOGOviolence logo
30005TERRORISM_SCENEterrorism scene
40000CONTRABAND_COMMONprohibited
40001CONTRABAND_GALLERYprohibited gallery
40002CONTRABAND_GOODcontraband
40003CONTRABAND_LOGOprohibited logo
40004CONTRABAND_BLOODbloody
40005CONTRABAND_OFFICE_DRESSoffice dress
40006CONTRABAND_INCIVILIZATIONincivilization
40007CONTRABAND_FACEprohibited face
40008CONTRABAND_SCENEprohibited scene
40009CONTRABAND_FIREfire
40010CONTRABAND_SKULLskull
40011CONTRABAND_CURRENCYcurrency
50000POLITICS_COMMONpolitics
50001POLITICS_GALLERYpolitics gallery
50002POLITICS_MAP_OF_CHINAChina map
50003POLITICS_LEADERPICpolitics face
50004POLITICS_FLAGpolitics flag
50005POLITICS_LOGOpolitics logo
50006POLITICS_SCENEpolitics scene
90000OTHER_COMMONothers
90002OTHER_USERcustom user list
90003OTHER_IPcustom IP list

OCR result

OCR function needs extra fee,If you need it, please contact your private business.

OCR array data structure

Parameter NameTypeDescription
nameStringImage Name (or Image ID)
taskIdStringThis request data identifier, you can query the latest results of the data according to the identifier
detailsStringOCR detailed information

details data structure

Parameter NameTypeDescription
contentStringThe collection of all text information in this image
lineContentsStringline information

lineContents data structure

Parameter NameTypeDescription
lineContentStringtext information per line
polygonStringline coordinates,The top left corner starts to return clockwise relative coordinate information of four points

The following is the schematic diagram of polygon coordinate information return:

 schematic diagram of polygon coordinate information return

Take the two lines of OCR information returned in the figure as an example. The polygon coordinate information of each line contains 8 relative coordinate points to be returned, starting from the origin of the upper left corner, and returning the origin coordinates of 1-4 points in clockwise sequence. The coordinates of each point from left to right are the distance to the X-axis and Y-axis of the upper left corner of the picture.

face result

face function needs extra fee,If you need it, please contact your private business.

face array data structure

Parameter NameTypeDescription
nameStringImage Name (or Image ID)
taskIdStringThis request data identifier, you can query the latest results of the data according to the identifier
detailsStringface detailed information

details data structure

Parameter NameTypeDescription
faceNumberNumberThe number of all faces contained in this image
faceContentsStringface detailed information

faceContents data structure

Parameter NameTypeDescription
nameStringface name,if it not be recognized will be empty
x1StringFace position information,corresponding to the relative coordinates of the upper left corner abscissa of the face rectangle
y1StringFace position information,corresponding to the relative coordinates of the upper left corner of the face rectangle
x2StringFace position information,corresponding to the relative coordinates of the lower right corner abscissa of the face rectangle
y2StringFace position information,corresponding to the relative coordinates of the lower right corner of the face rectangle

Request example

Java code

Python code

PHP code

C# code

js code

Response example

Output result:

Note: Classified information, 100: porn, 110: sexy, 200: advertising, 210: two-dimensional code, 300: horror, 400: prohibited, 500: political

{
	"code": 200,
	"msg": "ok",
	"antispam": [{
		"taskId": "2930cd4b13464676a0779ef09706e700",
		"status": 0,
		"action": 2,
		"name": "1234",
		"labels": [{
			"label": 500,
			"level": 2,
			"rate": 1.0,
			"subLabels": [{
				"subLabel": 50003,
				"rate": 1.0,
				"details": {
					"hitInfos": ["XXX"]
				}
			}]
		}, {
			"label": 200,
			"level": 1,
			"rate": 1.0,
			"subLabels": []
		}, {
			"label": 100,
			"level": 0,
			"rate": 0.9999522,
			"subLabels": []
		}, {
			"label": 110,
			"level": 0,
			"rate": 0.9999522,
			"subLabels": []
		}, {
			"label": 210,
			"level": 0,
			"rate": 1.0,
			"subLabels": []
		}, {
			"label": 300,
			"level": 0,
			"rate": 0.9642776,
			"subLabels": []
		}, {
			"label": 400,
			"level": 0,
			"rate": 1.0,
			"subLabels": []
		}]
	}, {
		"taskId": "0f6260acdb7647e281e41874189206e9",
		"status": 0,
		"action": 2,
		"name": "1234",
		"labels": [{
			"label": 500,
			"level": 2,
			"rate": 1.0,
			"subLabels": [{
				"subLabel": 50003,
				"rate": 1.0,
				"details": {
					"hitInfos": ["XXX"]
				}
			}]
		}, {
			"label": 200,
			"level": 1,
			"rate": 1.0,
			"subLabels": []
		}, {
			"label": 100,
			"level": 0,
			"rate": 0.9999522,
			"subLabels": []
		}, {
			"label": 110,
			"level": 0,
			"rate": 0.9999522,
			"subLabels": []
		}, {
			"label": 210,
			"level": 0,
			"rate": 1.0,
			"subLabels": []
		}, {
			"label": 300,
			"level": 0,
			"rate": 0.92121917,
			"subLabels": []
		}, {
			"label": 400,
			"level": 0,
			"rate": 1.0,
			"subLabels": []
		}]
	}],
	"ocr": [{
		"taskId": "2930cd4b13464676a0779ef09706e700",
		"name": "1234",
		"details": [{
			"content": "直播CCTV1综合",
			"lineContents": [{
				"lineContent": "直播",
				"polygon": [0.7745177268981933, 0.09276469945907592, 0.8768445968627929, 0.0939750075340271, 0.8766385078430176, 0.1636715531349182, 0.7743116855621338, 0.16246124505996704]
			}, {
				"lineContent": "CCTV1",
				"polygon": [0.12932851314544677, 0.09998217821121216, 0.23668222427368163, 0.10091289281845092, 0.2365492343902588, 0.16227685213088988, 0.12919551134109497, 0.16134613752365112]
			}, {
				"lineContent": "综合",
				"polygon": [0.14835870265960693, 0.15775651931762696, 0.23298816680908202, 0.15898795127868653, 0.23278720378875734, 0.21423439979553222, 0.14815772771835328, 0.21300296783447265]
			}]
		}]
	}, {
		"taskId": "0f6260acdb7647e281e41874189206e9",
		"name": "1234",
		"details": [{
			"content": "直播CCTV1综合",
			"lineContents": [{
				"lineContent": "直播",
				"polygon": [0.7745157241821289, 0.09276466369628907, 0.8768444061279297, 0.09396190643310547, 0.876640510559082, 0.1636584758758545, 0.7743117809295654, 0.1624612331390381]
			}, {
				"lineContent": "CCTV1",
				"polygon": [0.1293278932571411, 0.0999821662902832, 0.23668241500854492, 0.100907301902771, 0.2365502119064331, 0.16227684020996094, 0.1291956901550293, 0.16135170459747314]
			}, {
				"lineContent": "综合",
				"polygon": [0.14835870265960693, 0.15775651931762696, 0.23298816680908202, 0.15898795127868653, 0.23278720378875734, 0.21423439979553222, 0.14815772771835328, 0.21300296783447265]
			}]
		}]
	}]

	"face": [{
		"taskId": "57132814c2a24350a337d0a76dd49bbf",
		"name": "xxxx",
		"details": [{
			"faceNumber": 1,
			"faceContents": [{
				"name": "XXXX",
				"x1": 0.41362658,
				"y1": 0.18348134,
				"x2": 0.50894177,
				"y2": 0.37411177
			}]
		}]
	}]
	
	}
``
Online Chat Tel:95163223