Content Moderation API

Enterprise-grade AI-powered content moderation for safe online communities. Real-time text analysis with 16 comprehensive moderation categories and custom filtering.

Real-time Processing AI-Powered Enterprise Ready 99.9% Uptime
16
Moderation Categories
99%
Accuracy Rate

Content Moderation API

Protect your platform with AI-powered content filtering

Our Content Moderation API uses advanced machine learning to analyze text content in real-time, identifying potentially harmful, toxic, or inappropriate material across 16 comprehensive categories.

Enterprise Ready: Trusted by leading platforms worldwide with 99.9% uptime SLA, GDPR compliance, and 24/7 support.

Key Features

Everything you need for comprehensive content moderation

Real-time Analysis

Instant content moderation with sub-second response times

16 Categories

Comprehensive coverage from toxicity to finance, health to legal content

Confidence Scores

Precise confidence ratings for each detected category

Text Highlighting

Pinpoint specific words and phrases that trigger moderation

Custom Instructions

Tailor moderation rules to your specific platform needs

RESTful API

Simple integration with comprehensive documentation

Authentication

Secure API access with enterprise-grade security

Base URL: https://contentmoderationapi.net/api/moderate

Authentication is required for all API requests. Obtain your API key by subscribing to one of our plans.

All API requests are encrypted with TLS 1.3 and include rate limiting protection.
API Key Usage
curl -X POST https://contentmoderationapi.net/api/moderate \ -H "Content-Type: application/json" \ -H "Authorization: Bearer YOUR_API_KEY" \ -d '{"text": "Your content to moderate"}'

Moderation Categories

16 comprehensive categories with confidence scoring

Our AI model analyzes content across these key areas:

Toxic
Harmful, abusive, or offensive content
Insult
Personal attacks and insulting language
Legal
Legal advice, lawsuits, litigation
Finance
Financial advice, money, investments
Health
Medical advice, health claims
Death, Harm & Tragedy
Violence, death, disasters
Religion & Belief
Religious content, beliefs
Firearms & Weapons
Weapons, firearms, violence
Illicit Drugs
Drug references, substance abuse
Public Safety
Safety concerns, emergencies
Violent
Violent content, aggression
Profanity
Swear words, profane language
Politics
Political content, elections
War & Conflict
War, conflict, military
Derogatory
Discriminatory language
Sexual
Sexual content, adult material

Text Moderation Endpoint

Real-time content analysis with detailed results

POST https://contentmoderationapi.net/api/moderate
Request Parameters
Parameter Type Required Description
text string Text content to moderate
api_key string Your API authentication key
custom_instructions string Custom moderation rules (premium feature)
Example Request
curl -X POST https://contentmoderationapi.net/api/moderate \ -H "Content-Type: application/json" \ -H "Authorization: Bearer your_api_key" \ -d '{ "text": "The company lawsuit was a disaster, raising questions about its financial health. What a stupid idiot, their actions were completely toxic.", "custom_instructions": "Flag any financial discussion as high risk" }'
Example Response
{ "moderation": [ {"category": "Finance", "confidence": 0.8211}, {"category": "Toxic", "confidence": 0.7093}, {"category": "Legal", "confidence": 0.6831}, {"category": "Insult", "confidence": 0.6975}, {"category": "Health", "confidence": 0.6460} ], "moderation_words": [ ["lawsuit", "Legal"], ["disaster", "Death, Harm & Tragedy"], ["financial", "Finance"], ["stupid idiot", "Insult"], ["toxic", "Toxic"] ], "status": 200, "processing_time_ms": 147, "text_length": 156, "flagged": true, "risk_score": 0.7634 }

Custom Moderation Instructions

Tailor AI behavior to your platform's specific needs

Premium subscribers can provide custom instructions to fine-tune moderation behavior for their specific use case and community guidelines.

Premium Feature: Custom instructions are available to Pro and Enterprise plan subscribers only.
Example Custom Instructions
{ "text": "Investment advice content here...", "custom_instructions": "Be extra sensitive to financial advice that could be construed as investment recommendations. Flag any discussion of specific stocks or crypto with confidence > 0.3 as high risk." }
Sensitivity Tuning

Adjust detection thresholds for specific categories

Category Focus

Emphasize or de-emphasize specific moderation categories

Context Awareness

Provide context about your platform or use case

Implementation Examples

Ready-to-use code for popular programming languages

Python
import requests import json def moderate_content(text, api_key, custom_instructions=None): url = "https://contentmoderationapi.net/api/moderate" headers = { "Authorization": f"Bearer {api_key}", "Content-Type": "application/json" } payload = {"text": text} if custom_instructions: payload["custom_instructions"] = custom_instructions response = requests.post(url, headers=headers, json=payload) return response.json() # Usage result = moderate_content( "Your text to moderate here", "your_api_key_here", "Custom moderation instructions" ) print(f"Risk Score: {result['risk_score']}") for category in result['moderation'][:3]: print(f"{category['category']}: {category['confidence']:.2%}")
JavaScript
async function moderateContent(text, apiKey, customInstructions) { const response = await fetch('https://contentmoderationapi.net/api/moderate', { method: 'POST', headers: { 'Authorization': `Bearer ${apiKey}`, 'Content-Type': 'application/json' }, body: JSON.stringify({ text: text, custom_instructions: customInstructions }) }); return await response.json(); } // Usage moderateContent( "Your text to moderate here", "your_api_key_here", "Custom moderation instructions" ).then(result => { console.log(`Risk Score: ${result.risk_score}`); result.moderation.slice(0, 3).forEach(category => { console.log(`${category.category}: ${(category.confidence * 100).toFixed(1)}%`); }); });
PHP
function moderateContent($text, $apiKey, $customInstructions = null) { $url = 'https://contentmoderationapi.net/api/moderate'; $data = ['text' => $text]; if ($customInstructions) { $data['custom_instructions'] = $customInstructions; } $ch = curl_init($url); curl_setopt($ch, CURLOPT_POST, true); curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($data)); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_HTTPHEADER, [ 'Authorization: Bearer ' . $apiKey, 'Content-Type: application/json' ]); $response = curl_exec($ch); curl_close($ch); return json_decode($response, true); } // Usage $result = moderateContent( "Your text to moderate here", "your_api_key_here", "Custom moderation instructions" ); echo "Risk Score: " . $result['risk_score'] . "\n"; foreach (array_slice($result['moderation'], 0, 3) as $category) { printf("%s: %.1f%%\n", $category['category'], $category['confidence'] * 100); }
Node.js
const axios = require('axios'); async function moderateContent(text, apiKey, customInstructions = null) { try { const response = await axios.post( 'https://contentmoderationapi.net/api/moderate', { text: text, ...(customInstructions && { custom_instructions: customInstructions }) }, { headers: { 'Authorization': `Bearer ${apiKey}`, 'Content-Type': 'application/json' } } ); return response.data; } catch (error) { throw new Error(`Moderation failed: ${error.response?.data?.message || error.message}`); } } // Usage moderateContent( "Your text to moderate here", "your_api_key_here", "Custom moderation instructions" ).then(result => { console.log(`Risk Score: ${result.risk_score}`); result.moderation.slice(0, 3).forEach(category => { console.log(`${category.category}: ${(category.confidence * 100).toFixed(1)}%`); }); }).catch(console.error);

Error Handling

HTTP status codes and error responses

The API returns standard HTTP status codes along with detailed error messages in JSON format.

Status Code Error Type Description Resolution
200 Success Request processed successfully -
400 Bad Request Invalid request format or missing parameters Check request format and required parameters
401 Unauthorized Invalid or missing API key Verify API key and subscription status
403 Quota Exceeded Monthly API quota exhausted Upgrade plan or purchase additional credits
422 Content Too Short Text content below minimum length Provide at least 10 characters of text
429 Rate Limited Too many requests in time window Implement exponential backoff
500 Server Error Internal processing error Retry request or contact support
Example Error Response
{ "error": "unauthorized", "message": "Invalid API key provided", "status": 401, "documentation": "https://contentmoderationapi.net/api#authentication" }

Ready to Get Started?

Join thousands of platforms using our moderation API

Start protecting your community today with our enterprise-grade content moderation API.

1M+
API Calls Daily
99.9%
Uptime SLA
< 200ms
Response Time
24/7
Support