Video Nudity Detection Scan Endpoint
This endpoint is designed for developers who need to implement automated video content moderation using AI-powered detection of explicit or unwanted content.
It allows you to submit videos for analysis based on the settings configured in your dashboard, including detection strictness and specific content categories to flag or ignore. The AI model will evaluate each video and return a structured response indicating the presence of inappropriate content.
This endpoint allows you to:
- Analyze single or multiple videos for explicit content in a single request
- Customize detection sensitivity and categories via dashboard settings
- Receive results in either JSON format by specifying the desired response format in the endpoint URL
- Identify detected content types such as nudity, partial nudity, and sexually suggestive imagery
- Filter results based on predefined categories (e.g., explicit, suggestive, partial nudity)
- Automatically discard the processed videos after analysis to maintain data privacy
Data Privacy and Security
We strictly adhere to European data protection regulations, ensuring that all submitted videos and videos are not shared, sold, or made accessible to third parties under any circumstances. Once the analysis is complete, all uploaded content is immediately and permanently deleted from our servers, maintaining the highest standards of data security and user privacy.
Video Scan Request
Here’s a sample request to perform an video nudity detection scan:
POSTAPI key required
https://api.nudescan.io/v1/scan/video
curl -X POST https://api.nudescan.io/v1/scan/video \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Transfer-Encoding: chunked" \
-F "video=@/path/to/video1.mp4;type=application/octet-stream"
const axios = require('axios');
const fs = require('fs');
const FormData = require('form-data');
// Define the API endpoint
const apiUrl = 'https://api.nudescan.io/v1/scan/video';
const apiKey = 'YOUR_API_KEY';
// Define the function to make the POST request
async function sendPostRequest(video) {
try {
const form = new FormData();
// Add a single file as "video"
form.append('video', fs.createReadStream(video.path), video.filename);
const response = await axios.post(apiUrl, form, {
headers: {
...form.getHeaders(),
Authorization: `Bearer ${apiKey}`
}
});
const { results } = response.data;
// Update the video object with the 'abuse' value
video.abuse = results[0] ?? null;
return video;
} catch (error) {
console.error('Error sending video for classification:', error.message);
throw error;
}
}
// Example call
const video = { path: 'path/to/video1.mp4', filename: 'video1.mp4' };
sendPostRequest(video)
.then(result => console.log(result))
.catch(error => console.error(error));
<?php
// API URL
$apiUrl = 'https://api.nudescan.io/v1/scan/video';
$apiKey = 'YOUR_API_KEY';
// Funktion zum Senden des POST-Requests
function sendPostRequest(array $video) {
global $apiUrl, $apiKey;
$curl = curl_init();
$boundary = uniqid();
$delimiter = '-------------' . $boundary;
$eol = "\r\n";
$headers = [
"Authorization: Bearer $apiKey",
"Content-Type: multipart/form-data; boundary=" . $delimiter
];
$body = '';
$filePath = $video['path'];
$filename = $video['filename'];
if (file_exists($filePath)) {
$fileContents = file_get_contents($filePath);
$body .= "--" . $delimiter . $eol;
$body .= 'Content-Disposition: form-data; name="video"; filename="' . $filename . '"' . $eol;
$body .= 'Content-Type: application/octet-stream' . $eol . $eol;
$body .= $fileContents . $eol;
}
$body .= "--" . $delimiter . "--" . $eol;
curl_setopt_array($curl, [
CURLOPT_URL => $apiUrl,
CURLOPT_RETURNTRANSFER => true,
CURLOPT_POST => true,
CURLOPT_HTTPHEADER => $headers,
CURLOPT_POSTFIELDS => $body
]);
$response = curl_exec($curl);
$httpCode = curl_getinfo($curl, CURLINFO_HTTP_CODE);
if ($httpCode !== 200) {
echo "Error sending video for classification: " . curl_error($curl) . PHP_EOL;
curl_close($curl);
return false;
}
curl_close($curl);
$responseData = json_decode($response, true);
if (isset($responseData['results'][0])) {
$video['abuse'] = $responseData['results'][0];
}
return $video;
}
// Beispielaufruf
$video = [
'path' => 'path/to/video1.mp4',
'filename' => 'video1.mp4'
];
$result = sendPostRequest($video);
print_r($result);
import requests
# API URL
api_url = "https://api.nudescan.io/v1/scan/video"
api_key = "YOUR_API_KEY"
def send_post_request(video_file):
"""
Sendet eine einzelne Videodatei zur Analyse.
:param video_file: Ein Dictionary mit 'path' und 'filename'
:return: Ergebnis der Analyse
"""
headers = {
"Authorization": f"Bearer {api_key}"
}
try:
# Datei vorbereiten
file = ('video', (video_file['filename'], open(video_file['path'], 'rb'), 'application/octet-stream'))
# Senden der Anfrage
response = requests.post(api_url, headers=headers, video=[file])
response.raise_for_status()
response_data = response.json()
# Aktualisiere das Videoobjekt mit dem 'abuse' Wert
if 'results' in response_data:
video_file['abuse'] = response_data['results'][0]
return video_file
except requests.RequestException as e:
print(f"Error sending video for classification: {e}")
raise
# Beispielaufruf
video = {'path': 'path/to/video1.mp4', 'filename': 'video1.mp4'}
result = send_post_request(video)
print(result)
Parameters
(object) Max 1 file Max 4 GB / File REQUIRED
The file added to FormData is an object representing a file or binary data, typically consisting of properties like name, type, and size.
Response
The API returns a JSON array containing the results of the submitted video.
[
{
"category_scores": {
"sex": 0.82,
"porn": 0.65,
"exposed": 0.91,
"nude": 0.47
},
"detected_categories": [
{
"category": "sex",
"score": 0.82
},
{
"category": "porn",
"score": 0.65
},
{
"category": "exposed",
"score": 0.91
}
],
"isNude": true
}
]
Response Fields
(object)
A nested object containing the highest detection scores for each specified content category.
(float)
The detection score for sexually suggestive content.
(float)
The detection score for pornographic content.
(float)
The detection score for exposed nudity.
(float)
The detection score for nudity in general.
(array)
An array of detected categories that exceeded the abuse threshold, including the category name and its respective score.
(string)
The name of the detected content category (e.g., "sex", "porn", "exposed").
(float)
The confidence score for the detected category, ranging from 0.0 to 1.0.
(boolean)
A flag indicating whether any detected category's score has exceeded the predefined abuse threshold.
Error Responses
| Status Code | Description |
|---|---|
| 401 | Not authorized - Invalid or missing API key |
| 403 | Forbidden - You don’t have permission |
| 404 | Not Found - Account or user not found |
| 500 | Internal Server Error - An unexpected error occurred |
| 512 | Parameter error - Check your sent data |