curl --request POST \
--url https://api.contentmod.io/text \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"text": "This is a very cool api",
"options": {
"meta": {},
"callbackUrl": "<string>",
"defer": true,
"actorId": "<string>",
"bannedWords": [
"<string>"
]
}
}
'import requests
url = "https://api.contentmod.io/text"
payload = {
"text": "This is a very cool api",
"options": {
"meta": {},
"callbackUrl": "<string>",
"defer": True,
"actorId": "<string>",
"bannedWords": ["<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({
text: 'This is a very cool api',
options: {
meta: {},
callbackUrl: '<string>',
defer: true,
actorId: '<string>',
bannedWords: ['<string>']
}
})
};
fetch('https://api.contentmod.io/text', 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/text",
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([
'text' => 'This is a very cool api',
'options' => [
'meta' => [
],
'callbackUrl' => '<string>',
'defer' => true,
'actorId' => '<string>',
'bannedWords' => [
'<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/text"
payload := strings.NewReader("{\n \"text\": \"This is a very cool api\",\n \"options\": {\n \"meta\": {},\n \"callbackUrl\": \"<string>\",\n \"defer\": true,\n \"actorId\": \"<string>\",\n \"bannedWords\": [\n \"<string>\"\n ]\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/text")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"text\": \"This is a very cool api\",\n \"options\": {\n \"meta\": {},\n \"callbackUrl\": \"<string>\",\n \"defer\": true,\n \"actorId\": \"<string>\",\n \"bannedWords\": [\n \"<string>\"\n ]\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.contentmod.io/text")
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 \"text\": \"This is a very cool api\",\n \"options\": {\n \"meta\": {},\n \"callbackUrl\": \"<string>\",\n \"defer\": true,\n \"actorId\": \"<string>\",\n \"bannedWords\": [\n \"<string>\"\n ]\n }\n}"
response = http.request(request)
puts response.read_body{
"id": "27fbdc0b-b295-46ce-93f5-81b2fc08a381",
"isSafe": true,
"confidence": 90,
"sentiment": "positive",
"sentimentScore": 90,
"riskScores": {
"overall": 90,
"spam": 90,
"toxicity": 90
},
"topics": [
"politics",
"sports"
],
"nsfwCategories": [
{
"category": "sexual",
"severity": 90
}
],
"summary": {
"profanity": true,
"totalFlags": 1,
"contentRating": "G",
"language": "en"
},
"suggestedActions": {
"reject": true,
"review": true
},
"filteredContent": "This is a filtered text",
"content": "This is the original text",
"request": {
"requestId": "27fbdc0b-b295-46ce-93f5-81b2fc08a381",
"timestamp": "2023-04-05T12:00:00.000Z"
},
"hash": "93a08bd10cd367bf83f12ba6590fcaef2f8deec8a47ce4ce88a15c7dda325ffa",
"meta": "This is the metadata"
}{
"id": "<string>"
}Moderate Text
curl --request POST \
--url https://api.contentmod.io/text \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"text": "This is a very cool api",
"options": {
"meta": {},
"callbackUrl": "<string>",
"defer": true,
"actorId": "<string>",
"bannedWords": [
"<string>"
]
}
}
'import requests
url = "https://api.contentmod.io/text"
payload = {
"text": "This is a very cool api",
"options": {
"meta": {},
"callbackUrl": "<string>",
"defer": True,
"actorId": "<string>",
"bannedWords": ["<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({
text: 'This is a very cool api',
options: {
meta: {},
callbackUrl: '<string>',
defer: true,
actorId: '<string>',
bannedWords: ['<string>']
}
})
};
fetch('https://api.contentmod.io/text', 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/text",
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([
'text' => 'This is a very cool api',
'options' => [
'meta' => [
],
'callbackUrl' => '<string>',
'defer' => true,
'actorId' => '<string>',
'bannedWords' => [
'<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/text"
payload := strings.NewReader("{\n \"text\": \"This is a very cool api\",\n \"options\": {\n \"meta\": {},\n \"callbackUrl\": \"<string>\",\n \"defer\": true,\n \"actorId\": \"<string>\",\n \"bannedWords\": [\n \"<string>\"\n ]\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/text")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"text\": \"This is a very cool api\",\n \"options\": {\n \"meta\": {},\n \"callbackUrl\": \"<string>\",\n \"defer\": true,\n \"actorId\": \"<string>\",\n \"bannedWords\": [\n \"<string>\"\n ]\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.contentmod.io/text")
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 \"text\": \"This is a very cool api\",\n \"options\": {\n \"meta\": {},\n \"callbackUrl\": \"<string>\",\n \"defer\": true,\n \"actorId\": \"<string>\",\n \"bannedWords\": [\n \"<string>\"\n ]\n }\n}"
response = http.request(request)
puts response.read_body{
"id": "27fbdc0b-b295-46ce-93f5-81b2fc08a381",
"isSafe": true,
"confidence": 90,
"sentiment": "positive",
"sentimentScore": 90,
"riskScores": {
"overall": 90,
"spam": 90,
"toxicity": 90
},
"topics": [
"politics",
"sports"
],
"nsfwCategories": [
{
"category": "sexual",
"severity": 90
}
],
"summary": {
"profanity": true,
"totalFlags": 1,
"contentRating": "G",
"language": "en"
},
"suggestedActions": {
"reject": true,
"review": true
},
"filteredContent": "This is a filtered text",
"content": "This is the original text",
"request": {
"requestId": "27fbdc0b-b295-46ce-93f5-81b2fc08a381",
"timestamp": "2023-04-05T12:00:00.000Z"
},
"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
The text to moderate
1"This is a very cool api"
Show child attributes
Show child attributes
Response
Response of the moderated text
The id of the text moderation
"27fbdc0b-b295-46ce-93f5-81b2fc08a381"
Whether the text is considered safe
true
Confidence of the safety of the text from 1-100
90
Sentiment of the text, either negative, neutral or positive
positive, negative, neutral "positive"
Sentiment score from 1-100 (negative, neutral, positive)
90
Show child attributes
Show child attributes
General topics the text depicts, lowercase and no punctuation
["politics", "sports"]
Show child attributes
Show child attributes
[{ "category": "sexual", "severity": 90 }]
Show child attributes
Show child attributes
Show child attributes
Show child attributes
The text with profanity replaced by *.
"This is a filtered text"
The original text
"This is the original text"
Show child attributes
Show child attributes
SHA-256 hash of the text
"93a08bd10cd367bf83f12ba6590fcaef2f8deec8a47ce4ce88a15c7dda325ffa"
The metadata of the request
"This is the metadata"