Choosing the right NSFW detection API can save your platform from legal liability, app store removal, and advertiser pullbacks. Here's how the top image moderation APIs compare.
Quick Comparison
| API | Categories | Free Tier | Paid From | Setup |
|---|---|---|---|---|
| AI Engine NSFW Detect | 10 (hierarchical) | 30 req/mo | $12.99/mo | RapidAPI key |
| Amazon Rekognition | 7 top-level | 5K/mo (12 mo) | $0.001/image | AWS + IAM |
| Google Vision | 5 (SafeSearch) | 1K/mo | $1.50/1K | GCP + billing |
| Azure Content Safety | 4 severity levels | 5K/mo | $1.00/1K | Azure subscription |
| Clarifai | 5 concepts | 1K/mo | $1.20/1K | API key |
AI Engine NSFW Detect — Python Example
import requests
url = "https://nsfw-detect3.p.rapidapi.com/nsfw-detect"
headers = {
"x-rapidapi-host": "nsfw-detect3.p.rapidapi.com",
"x-rapidapi-key": "YOUR_API_KEY",
"Content-Type": "application/x-www-form-urlencoded",
}
response = requests.post(url, headers=headers, data={"url": "https://example.com/photo.jpg"})
result = response.json()
for label in result["body"]["ModerationLabels"]:
print(f"{label['Name']}: {label['Confidence']:.1f}%")
10 categories with hierarchical sub-labels: Explicit Nudity, Suggestive, Violence, Visually Disturbing, Rude Gestures, Drugs, Tobacco, Alcohol, Gambling, Hate Symbols.
Three-Tier Moderation Pipeline
BLOCK_CATEGORIES = {"Explicit Nudity", "Violence", "Hate Symbols"}
WARN_CATEGORIES = {"Suggestive", "Drugs", "Alcohol", "Tobacco"}
def moderate(image_url: str) -> str:
response = requests.post(url, headers=headers, data={"url": image_url})
labels = response.json()["body"]["ModerationLabels"]
for label in labels:
if label["Name"] in BLOCK_CATEGORIES and label["Confidence"] > 80:
return "block"
for label in labels:
if label["Name"] in WARN_CATEGORIES and label["Confidence"] > 70:
return "warn"
return "allow"
When to Choose Each
- Quick start, no cloud setup → AI Engine. One API key, running in 5 minutes
- Already on AWS with S3/Lambda → Amazon Rekognition
- Basic safe/unsafe filtering → Google Vision SafeSearch
- Enterprise compliance on Azure → Azure AI Content Safety
- Custom moderation rules → Clarifai (train your own models)
Pricing at 50K Images/Month
- AI Engine: $92.99/mo (flat rate)
- Rekognition: ~$50/mo
- Google Vision: ~$75/mo
- Azure: ~$50/mo
- Clarifai: ~$60/mo
At low-mid volume (<10K/mo), flat-rate plans are simpler. At high volume, pay-per-image wins.
👉 Read the full comparison with feature breakdowns and decision framework
Top comments (0)