Summarize this article with:
- A video explicit content detection API is a type of technology that is specifically designed to identify and classify potentially inappropriate or offensive content in video materials.
- Video explicit content detection APIs typically use machine learning algorithms and other advanced techniques to analyze the visual and audio content of a video and determine whether it contains explicit...
- Video explicit content detection APIs are often used in a variety of applications, such as social media platforms, online marketplaces, and content management systems, to automatically identify and flag...
- Developers can detect Explicit Content (porn, gore, violence) in a Video with JavaScript using a REST API that accepts standard inputs and returns structured JSON responses.
- The integration works with Python, JavaScript, PHP, and any HTTP-capable language with minimal setup.
In this tutorial, you will learn how to use Video Explicit Content Detection in 5 minutes using JavaScript. Eden AI provides an easy and developer-friendly API that allows you to detect explicit contents in videos.
What is Video Explicit Content Detection ?
A video explicit content detection API is a type of technology that is specifically designed to identify and classify potentially inappropriate or offensive content in video materials. This can include videos that contain explicit language, violence, or sexually suggestive content.
Video explicit content detection APIs typically use machine learning algorithms and other advanced techniques to analyze the visual and audio content of a video and determine whether it contains explicit material. They may also analyze other features of the video, such as its metadata, to help determine its appropriateness.
Video explicit content detection APIs are often used in a variety of applications, such as social media platforms, online marketplaces, and content management systems, to automatically identify and flag potentially inappropriate or offensive video content. This can help ensure that such content is not made available to a wider audience or is properly restricted or removed.
Getting Started with Video Moderation API
The first step is to set Axios, a promise-based HTTP client for the browser and Node.js, that will allow you to call Eden AI API.
.png)
Next, you'll need to initialize the File System module in order to access local files on your computer.
.png)
Finally, you'll need to create your multipart/formdata parameters form:

How to use Video Explicit Content Detection API with JavaScript
You are now ready to process your video file into Eden AI Video Explicit Content Detection API.
1. Get a Video Explicit Content Detection API Key on Eden AI
To perform Video Explicit Content Detection in videos, you just need to create an account on Eden AI for free. On the homepage, you will be able to get your API key with free credits offered by Eden AI.
2. Let’s Detect Explicit Content in your Video File
Now that you have initialized the required JavaScript modules and got your API key, you will be able to detect explicit contents in videos. Explicit content detection in videos now goes through a multimodal LLM that accepts video as input, called with Eden AI’s OpenAI-compatible chat completions endpoint: the model lists the segments that contain explicit content, with their category, a likelihood score from 1 to 5 and their time range. You can use any model that has video in its input_modalities: see our documentation here.
Here is the JavaScript code to add your video to the form data and set your API key:
form.append("file", fs.createReadStream("path/to/your/video.mp4"));
const apiKey = "Your_API_Key";
Once the file is added, you can configure your requests: the video is first uploaded to Eden AI, which returns a file_id, then the request asks a multimodal LLM, here google/gemini-2.5-flash, to detect explicit content and to answer in the JSON format set by the schema:
// Step 1: upload your video to Eden AI, which returns a file_id
const uploadOptions = {
method: "POST",
url: "https://api.edenai.run/v3/upload",
headers: {
authorization: `Bearer ${apiKey}`,
...form.getHeaders(),
},
data: form,
};
// Step 2: ask a multimodal LLM to detect explicit content, with the JSON format of the answer
const schema = {
type: "object",
properties: {
segments: {
type: "array",
items: {
type: "object",
properties: {
category: { type: "string" },
likelihood: { type: "integer" },
start_time: { type: "number" },
end_time: { type: "number" },
},
required: ["category", "likelihood", "start_time", "end_time"],
},
},
},
required: ["segments"],
};
const options = (fileId) => ({
method: "POST",
url: "https://api.edenai.run/v3/chat/completions",
headers: {
authorization: `Bearer ${apiKey}`,
},
data: {
model: "google/gemini-2.5-flash", // any model with video in its input_modalities
messages: [
{
role: "user",
content: [
{ type: "text", text: "List the segments of this video that contain explicit content (nudity, violence, gore, drugs, hate symbols), with the category, a likelihood from 1 (very unlikely) to 5 (very likely) and the time range in seconds." },
{ type: "file", file: { file_id: fileId } },
],
},
],
response_format: { type: "json_schema", json_schema: { name: "segments", schema: schema } },
},
});
Then, you need to create launchJob() function that will execute POST request:
.png)
Finally, create the run() function that uploads the video, launches the request and reads the answer. There is no job to poll, as the result comes back in the same response:
const run = async () => {
const upload = await axios.request(uploadOptions);
const response = await launchJob(options(upload.data.file_id));
console.log(response.data);
// The answer is a JSON string that follows the schema
const result = JSON.parse(response.data.choices[0].message.content);
console.log(result.segments);
};
run().catch((error) => {
console.error(error.response ? error.response.data : error);
});
You will get this response, where the answer is a JSON string in choices[0].message.content:
{
"status": "success",
"model": "gemini-2.5-flash",
"choices": [
{
"index": 0,
"message": {
"role": "assistant",
"content": "{\n \"segments\": [\n {\n \"category\": \"Violence\",\n \"likelihood\": 2,\n \"start_time\": 17.0,\n \"end_time\": 18.0\n },\n {\n \"category\": \"Violence\",\n \"likelihood\": 3,\n \"start_time\": 24.0,\n \"end_time\": 35.0\n }\n ]\n}"
},
"finish_reason": "stop"
}
],
"usage": {
"prompt_tokens": 15661,
"completion_tokens": 631,
"total_tokens": 16292
},
"provider": "google",
"cost": 0.0074455
}
Once parsed, this JSON string gives the result for Explicit Content Detection task (the time ranges are estimated by the model, so check them on a few of your own videos before relying on them in production):
[
{
"category": "Violence",
"likelihood": 2,
"start_time": 17,
"end_time": 18
},
{
"category": "Violence",
"likelihood": 3,
"start_time": 24,
"end_time": 35
}
]
Benefits of using Video Explicit Content Detection API with Eden AI
Using Video Explicit Content Detection with Eden AI API is quick and easy.
.gif)
Save time and cost
We offer a unified API for all providers: simple and standard to use, with a quick switch between providers and an access to the specificic features of each provider.
Easy to integrate
The JSON output format is the same for all suppliers thanks to Eden AI's standardisation work. The response elements are also standardised thanks to Eden AI's powerful matching algorithms.
Customization
With Eden AI you have the possibility to integrate a third party platform: we can quickly develop connectors. To go further and customize your video moderation request with specific parameters, check out our documentation.
.jpeg)
.jpg)

