API Docs

Parameters Details:
Name Type Directions
image String | File

1. Acceptable values include image URL or file binary, but don’t mix 2 types of data in one request, and it will cause processing error
2. Multiple ‘image’ fields are accepted when posting with form-data, or using array in JSON.
3. It’s acceptable to pack multiple files in a ZIP file.
4. Only static image formats are acceptable, such as .png, .jpg, .jpeg, .bmp.
5. To optimize transmission efficiency, for most of recognition services, it’s suggested to reduce image size, for instance 256X256.

tag String Optional parameter for image’s additional information. It will be useful in later use for searching or connecting images.
1、If using multiple tag fields, they will be treated as one-to-one correspondence with image fields.
2、If the number of tag fields is less than the number of image fields, the rest image fields share the correspondence with the value of the last tag.
timestamp Number Unix timestamp generated by requester for verifying signature.
nonce Number Random value for verifying signature.
signature String

Base64 encoded signature string signed with RSA-SHA256 algorithm.
Signing steps:
1. Concatenate values of secret-id, timestamp, nonce and joint with comma.
2. Sign the string computed in step 1 with RSA-SHA256 algorithm algorithm and your private key

Please click Secret Key for more detail to generate your private key and how to upload your public key.
Result properties (in JSON format)
signature String The signature for verifying the result JSON string.Verifying the signature with RSA-SHA256 algorithm and TUPU public key (download from here).
1. Parse the received string using JSON.parse() to obtain a JSON object named “data”.
2. There are two keys in “data”: “signature” and “json”, where signature is the digital signature and json is the results you’re interested in.
3. You need to verify json by decoding signature with base64 and use it to verify json using RSA-SHA256.
4. After verification, parse json to a JSON object using JSON.parse() to obtain the final result, see "json", and click API SDK for code examples.
json String It’s a JSON string, please parse it before further process.
General properties in result JSON

code:0: Successful; 1: Authentication error; 2: Invalid model ID; 3: No file uploaded; 4: Invalid API version; 5: Deprecated API version; 6: Wrong secret ID; 7: Invalid task ID, you can’t perform this task with your secretId; 8: Secret ID errors; 9: No certificate uploaded; 10: Wrong pipe ID; 11: Callback parameter missing; 12: Time parameter error; 13: Task not configured or closed; 14: Image error: 404, 400, download failed, too large; 100: Server error; 101: Unknown error.

message:Text information of the result

timestamp:Unix timestamp from API server

nonce:Random value for verifying signature.

Other properties are service relevant. Please refer API Response for more detail

Example 1: pornography recognition: http://7u2rqb.com2.z0.glb.qiniucdn.com/1059726834gra_koisaya011.jpg?nrop

Example 2: advertisement recognition: http://7u2rqb.com2.z0.glb.qiniucdn.com/1059726834gra_koisaya011.jpg?ad

Example 3: pornography and advertisement recognition: http://7u2rqb.com2.z0.glb.qiniucdn.com/1059726834gra_koisaya011.jpg?tupu/ad/nrop

Example 4: pornography videos: http://7u2rqb.com2.z0.glb.qiniucdn.com/c.mkv?tupu-video/nrop

Example 5: pornography gif images: http://7u2rqb.com2.z0.glb.qiniucdn.com/bull.gif?tupu-video/nrop

1. The format of return value is the same as that when called from Tupu API, more details will be discussed below.
2. Contact us for any customization needs for using our technology with Qiniu.