cURL
curl --request POST \
--url https://api.contentmod.io/image \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"image": "This is a very cool api",
"options": {
"meta": {},
"callbackUrl": "<string>",
"defer": true,
"actorId": "<string>"
}
}
'import requests
url = "https://api.contentmod.io/image"
payload = {
"image": "This is a very cool api",
"options": {
"meta": {},
"callbackUrl": "<string>",
"defer": True,
"actorId": "<string>"
}
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
image: 'This is a very cool api',
options: {meta: {}, callbackUrl: '<string>', defer: true, actorId: '<string>'}
})
};
fetch('https://api.contentmod.io/image', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.contentmod.io/image",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'image' => 'This is a very cool api',
'options' => [
'meta' => [
],
'callbackUrl' => '<string>',
'defer' => true,
'actorId' => '<string>'
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.contentmod.io/image"
payload := strings.NewReader("{\n \"image\": \"This is a very cool api\",\n \"options\": {\n \"meta\": {},\n \"callbackUrl\": \"<string>\",\n \"defer\": true,\n \"actorId\": \"<string>\"\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.contentmod.io/image")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"image\": \"This is a very cool api\",\n \"options\": {\n \"meta\": {},\n \"callbackUrl\": \"<string>\",\n \"defer\": true,\n \"actorId\": \"<string>\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.contentmod.io/image")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"image\": \"This is a very cool api\",\n \"options\": {\n \"meta\": {},\n \"callbackUrl\": \"<string>\",\n \"defer\": true,\n \"actorId\": \"<string>\"\n }\n}"
response = http.request(request)
puts response.read_body{
"summary": {
"totalFlags": 1,
"contentRating": "G",
"language": "en"
},
"isSafe": true,
"confidence": 90,
"description": "This is a description",
"riskScores": {
"overall": 90,
"spam": 90,
"toxicity": 90
},
"topics": [
"politics",
"sports"
],
"nsfwCategories": [
{
"category": "sexual",
"severity": 90
}
],
"suggestedActions": {
"reject": true,
"review": true
},
"hash": "93a08bd10cd367bf83f12ba6590fcaef2f8deec8a47ce4ce88a15c7dda325ffa",
"meta": "This is the metadata"
}{
"id": "<string>"
}Image Moderation
Moderate Image
POST
/
image
cURL
curl --request POST \
--url https://api.contentmod.io/image \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"image": "This is a very cool api",
"options": {
"meta": {},
"callbackUrl": "<string>",
"defer": true,
"actorId": "<string>"
}
}
'import requests
url = "https://api.contentmod.io/image"
payload = {
"image": "This is a very cool api",
"options": {
"meta": {},
"callbackUrl": "<string>",
"defer": True,
"actorId": "<string>"
}
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
image: 'This is a very cool api',
options: {meta: {}, callbackUrl: '<string>', defer: true, actorId: '<string>'}
})
};
fetch('https://api.contentmod.io/image', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.contentmod.io/image",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'image' => 'This is a very cool api',
'options' => [
'meta' => [
],
'callbackUrl' => '<string>',
'defer' => true,
'actorId' => '<string>'
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.contentmod.io/image"
payload := strings.NewReader("{\n \"image\": \"This is a very cool api\",\n \"options\": {\n \"meta\": {},\n \"callbackUrl\": \"<string>\",\n \"defer\": true,\n \"actorId\": \"<string>\"\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.contentmod.io/image")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"image\": \"This is a very cool api\",\n \"options\": {\n \"meta\": {},\n \"callbackUrl\": \"<string>\",\n \"defer\": true,\n \"actorId\": \"<string>\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.contentmod.io/image")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"image\": \"This is a very cool api\",\n \"options\": {\n \"meta\": {},\n \"callbackUrl\": \"<string>\",\n \"defer\": true,\n \"actorId\": \"<string>\"\n }\n}"
response = http.request(request)
puts response.read_body{
"summary": {
"totalFlags": 1,
"contentRating": "G",
"language": "en"
},
"isSafe": true,
"confidence": 90,
"description": "This is a description",
"riskScores": {
"overall": 90,
"spam": 90,
"toxicity": 90
},
"topics": [
"politics",
"sports"
],
"nsfwCategories": [
{
"category": "sexual",
"severity": 90
}
],
"suggestedActions": {
"reject": true,
"review": true
},
"hash": "93a08bd10cd367bf83f12ba6590fcaef2f8deec8a47ce4ce88a15c7dda325ffa",
"meta": "This is the metadata"
}{
"id": "<string>"
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Body
application/json
image
Response
Response of the moderated image
Show child attributes
Show child attributes
Whether the image is considered safe
Example:
true
Confidence of the safety of the image from 1-100
Example:
90
A short description of what the image depicts
Example:
"This is a description"
Show child attributes
Show child attributes
General topics the image depicts, lowercase and no punctuation
Example:
["politics", "sports"]Show child attributes
Show child attributes
Example:
[{ "category": "sexual", "severity": 90 }]Show child attributes
Show child attributes
SHA-256 hash of the image
Example:
"93a08bd10cd367bf83f12ba6590fcaef2f8deec8a47ce4ce88a15c7dda325ffa"
The metadata of the request
Example:
"This is the metadata"
⌘I