VIDEO API DOC
General Notes
Our video moderation is an image per image analysis, so the cost depends on the video size and the interval (in seconds) between the analyzed images. The default value is 1, which means that one frame every second will be analyzed. Values less than 1 can be used. For example 0.1 means an image every 100 ms.
There is no time constraint for videos, but the longer they are, the longer the processing time will be. For faster processing, please apply a resolution reduction to the video.
- Video type: URL or file.
- Max video size: 50Mo for video file. 1Go for video URL.
Rate Limits
When you hit the rate limit you will receive a 429 error code in the response.
This limit can be increased upon request for legitimate reasons.
- Max requests per second: 1
POST request
Video API Endpoint
https://www.picpurify.com/analyse_video/1.0
Parameters
Parameter |
Type |
Description |
API_KEY |
String |
Personal client API key |
task |
String |
Moderation tasks: porn_moderation suggestive_nudity_moderation gore_moderation money_moderation weapon_moderation drug_moderation hate_sign_moderation obscene_gesture_moderation qr_code_moderation Detection tasks: face_detection face_age_detection face_gender_detection face_gender_age_detection Complete profile moderation task (full check of moderation and detection tasks - 12 units): content_moderation_profile |
file_video |
Object |
Video data loaded from your local file system |
url_video |
String |
URL of the video publicly accessible from internet. Only for tests, can increase latency. |
frame_interval |
Decimal |
Interval in seconds between the analyzed images. The default value is 1, which means that one frame every second will be analyzed. Values less than 1 can be used. For example 0.1 means an image every 100 ms. |
reference_id |
String |
Optional -A unique reference associated to the image in your information system. |
origin_id |
String |
Optional -A reference to retrieve the origin of the image, profile id, account id ... |
Examples
Result
Example of successful result:
{
"task_call": "porn_moderation,gore_moderation",
"nb_images": 2,
"final_decision": "OK",
"confidence_score_decision": 0.90897,
"nb_images_ok": 2,
"nb_images_ko": 0,
"media":{
"url_video": "",
"file_video": "file.mp4",
"media_id": "94fd30ddb3f3ebc37c1c4649f9d3ff16",
"reference_id": "xxxxxxxx",
"origin_id": "yyyyyyyyy"
},
"total_compute_time": 2.456799030304,
"images_results": [
{
"status": "success",
"porn_moderation": {
"confidence_score": 0.99996,
"compute_time": 0.052,
"porn_content": false
},
"confidence_score_decision": 0.81796,
"gore_moderation": {
"gore_content": false,
"compute_time": 0.045,
"confidence_score": 0.81796
},
"task_call": "porn_moderation,gore_moderation",
"reject_criteria": [],
"performed": [
"porn_moderation",
"gore_moderation"
],
"sub_calls": [
"porn_moderation",
"gore_moderation"
],
"final_decision": "OK",
"media": {
"url_image": "",
"file_image": "00000001.jpg",
"media_id": "f0b9a4d75917e9aa9fadd369a9694b6a",
"reference_id": "xxxxxxxx",
"origin_id": "yyyyyyyyy"
},
"total_compute_time": 0.49649596214294
},
{
"status": "success",
"porn_moderation": {
"confidence_score": 0.99998,
"compute_time": 0.072,
"porn_content": false
},
"confidence_score_decision": 0.99998,
"gore_moderation": {
"gore_content": false,
"compute_time": 0.069,
"confidence_score": 1
},
"task_call": "porn_moderation,gore_moderation",
"reject_criteria": [],
"performed": [
"porn_moderation",
"gore_moderation"
],
"sub_calls": [
"porn_moderation",
"gore_moderation"
],
"final_decision": "OK",
"media": {
"url_image": "",
"file_image": "00000002.jpg",
"media_id": "1179cddb6397c8f8fc6c6fc4dc914178",
"reference_id": "xxxxxxxx",
"origin_id": "yyyyyyyyy"
},
"total_compute_time": 0.4908709526062
}
]
}
Example of error:
{
"status":"failure",
"error":
{
"errorCode":60,
"errorMsg":"File is not in the good format"
}
}
Result fields |
Type |
Description |
final_decision |
String |
The result of the final décision "OK" or " KO". |
confidence_score_decision |
Number |
This value indicates the confidence of the final decision. The value varies from 0.5 to 1. 1 for being very confident; 0.5 for being unsure. |
nb_images |
Number |
Number of images analyzed in the video file. |
nb_images_ok |
Number |
Number of images that do not contain harmful content. |
nb_images_ko |
Number |
Number of images that contain harmful content. |
task_call |
String |
The main tasks called. |
total_compute_time |
String |
Total server side compute time. |
media:file_video |
String |
File video name. |
media:url_video |
String |
URL of the video publicly accessible from internet. |
media:media_id |
String |
Picpurify internal media_id generated. |
media:reference_id |
String |
A unique reference associated to the image in your information system. |
media:origin_id |
String |
A reference to retrieve the origin of the image, profile id, account id ... |
images_results |
Array |
An array with the detail of the results on each frame of the video analyzed. |
errorCode |
Number |
Error codes.
errorCode:10 (API key error)
errorCode:11 (Account error)
errorCode:12 (Parameters error)
errorCode:20 (No url or data information found in the request")
errorCode:50 (Errors of the API service)
errorCode:60 (Errors in the video to be analysed. E.g., the format is not supported, the size of the video is too large, or the size of the file is too big.)
errorCode:429 (Too many requests)
|
errorMsg |
String |
Detailed error messages. |