Safe Image Moderation avatar
Safe Image Moderation

Pricing

from $10.00 / 1,000 results

Go to Apify Store
Safe Image Moderation

Safe Image Moderation

Screen images for adult, violent, racy, medical, and spoof content. Returns confidence scores for each category. Bring your own API key, pay only $0.01 per image. Perfect for UGC apps, e-commerce, social platforms, and ad networks.

Pricing

from $10.00 / 1,000 results

Rating

0.0

(0)

Developer

Marielise

Marielise

Maintained by Community

Actor stats

0

Bookmarked

2

Total users

1

Monthly active users

3 days ago

Last modified

Share

Image Content Moderation

AI-powered image content moderation using vision-capable LLMs. Analyze images for inappropriate content with high accuracy and get detailed confidence scores in seconds.

Why Use This Actor?

  • Multi-category detection: Screens for adult, violence, racy, medical, and spoof content in one API call
  • Multi-provider support: Choose from OpenAI GPT-4o, Claude, Gemini, or Groq models
  • Cost-effective: Process 1,000 images for ~$3-5 using GPT-4o-mini
  • Fast: Average processing time of 2-5 seconds per image
  • Transparent pricing: Pay only for what you use with detailed token tracking
  • No training required: Works out of the box with configurable thresholds

Features

Analyzes images for inappropriate content across five categories:

CategoryDescriptionDefault Threshold
AdultExplicit adult/NSFW content1.0 (strict)
ViolenceViolent or graphic content1.0 (strict)
RacySuggestive but not explicit content1.0 (strict)
MedicalMedical or graphic medical imagery0.5 (moderate)
SpoofMemes, edited, or manipulated images0.5 (moderate)

Returns:

  • Boolean safe verdict
  • Confidence scores (0-1) for each category
  • List of flagged categories
  • Token usage and cost tracking

Quick Start

1. Set up API keys

Add your LLM provider API key(s) in the Actor's Environment Variables:

  • OPENAI_API_KEY for OpenAI models
  • ANTHROPIC_API_KEY for Anthropic/Claude models
  • GOOGLE_API_KEY for Google/Gemini models
  • GROQ_API_KEY for Groq models

2. Run the Actor

Via Apify Console:

{
"imageUrl": "https://example.com/photo.jpg",
"model": "openai:gpt-4o"
}

Via Apify API (cURL):

curl -X POST "https://api.apify.com/v2/acts/YOUR_USERNAME~image-content-moderation/runs?token=YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{"imageUrl": "https://example.com/photo.jpg", "model": "openai:gpt-4o"}'

Via Node.js:

import { ApifyClient } from 'apify-client';
const client = new ApifyClient({ token: 'YOUR_TOKEN' });
const run = await client.actor('YOUR_USERNAME/image-content-moderation').call({
imageUrl: 'https://example.com/photo.jpg',
model: 'openai:gpt-4o',
});
const { items } = await client.dataset(run.defaultDatasetId).listItems();
console.log(items[0]); // Moderation result

Via Python:

from apify_client import ApifyClient
client = ApifyClient('YOUR_TOKEN')
run = client.actor('YOUR_USERNAME/image-content-moderation').call(run_input={
'imageUrl': 'https://example.com/photo.jpg',
'model': 'openai:gpt-4o',
})
items = client.dataset(run['defaultDatasetId']).list_items().items
print(items[0]) # Moderation result

Input Parameters

FieldTypeRequiredDefaultDescription
imageUrlstringOne of-Public URL of image to analyze (JPEG, PNG, GIF, WebP, BMP)
imageBase64stringOne of-Base64-encoded image data (max 20MB)
modelstringNoopenai:gpt-4oLLM model in provider:model format
configobjectNoSee belowOverride thresholds per category (0-1)

Supported Models

ProviderModelSpeedCostBest For
OpenAIopenai:gpt-4oMedium$$Best accuracy
OpenAIopenai:gpt-4o-miniFast$Cost-effective
Googlegoogle:gemini-2.0-flashFast$Speed
Googlegoogle:gemini-1.5-proMedium$$Accuracy
Anthropicanthropic:claude-sonnet-4-20250514Medium$$Nuanced analysis
Groqgroq:meta-llama/llama-4-scout-17b-16e-instructFastest$High throughput

Custom Thresholds

Override thresholds per category (0-1 scale, higher = stricter):

{
"imageUrl": "https://example.com/photo.jpg",
"model": "openai:gpt-4o-mini",
"config": {
"adult": 0.3,
"violence": 0.5,
"racy": 0.7,
"medical": 0,
"spoof": 0.5
}
}

Set to 0 to skip that category entirely.

Output Format

Safe Image

{
"safe": true,
"flagged": [],
"scores": {
"adult": 0.05,
"violence": 0.02,
"racy": 0.15,
"medical": 0.01,
"spoof": 0.08
},
"imageUrl": "https://example.com/photo.jpg",
"modelUsed": "openai:gpt-4o",
"configApplied": {
"adult": 1,
"violence": 1,
"racy": 1,
"medical": 0.5,
"spoof": 0.5
},
"processedAt": "2024-12-21T10:30:00.000Z",
"usage": {
"tokens": { "input": 1250, "output": 85, "total": 1335 },
"cost": 0.003825
}
}

Flagged Image

{
"safe": false,
"flagged": ["adult", "racy"],
"scores": {
"adult": 0.92,
"violence": 0.03,
"racy": 0.78,
"medical": 0.01,
"spoof": 0.05
},
"imageUrl": "https://example.com/flagged-photo.jpg",
"modelUsed": "openai:gpt-4o",
"processedAt": "2024-12-21T10:31:00.000Z",
"usage": {
"tokens": { "input": 1250, "output": 95, "total": 1345 },
"cost": 0.003875
}
}

Use Cases

User-Generated Content (UGC) Platforms

Filter uploads before publishing to protect your community and comply with platform guidelines.

E-commerce Product Images

Validate product photos meet marketplace standards and prevent policy violations that could result in account suspension.

Social Media Management

Automatically screen content before posting across platforms to maintain brand safety.

Ad Network Compliance

Ensure advertising creative meets network policies before campaign launch.

Media Library Management

Bulk classify and tag images in media asset management systems.

Dating App Photo Moderation

Screen user profile photos and messages for inappropriate content.

Pricing

This Actor uses a Pay Per Result model. You pay for successful moderation results based on the underlying LLM costs plus a small platform fee.

Estimated costs per 1,000 images:

  • GPT-4o-mini: ~$3-5
  • GPT-4o: ~$15-20
  • Gemini Flash: ~$2-4
  • Groq Llama: ~$1-2

Actual costs depend on image complexity and token usage. Each result includes detailed usage data for full cost transparency.

FAQ

What image formats are supported?

JPEG, PNG, GIF, BMP, and WebP. Images must be under 20MB.

Do I need multiple API keys?

No, you only need an API key for the provider you want to use. Most users start with OpenAI.

How accurate is the moderation?

Accuracy depends on the model used. GPT-4o and Claude Sonnet achieve high accuracy on standard benchmarks. Results include confidence scores so you can set appropriate thresholds for your use case.

Can I process multiple images at once?

Currently, the Actor processes one image per run. For batch processing, use the Apify API to run multiple instances in parallel or integrate with a dataset crawler.

What if my image URL requires authentication?

Use the imageBase64 input field instead. Convert your image to base64 and pass it directly.

How do I handle false positives/negatives?

Adjust the threshold values in the config parameter. Lower thresholds make detection more sensitive (fewer false negatives, more false positives). Higher thresholds are more permissive.

API Keys Setup

  1. OpenAI: platform.openai.com/api-keys
  2. Anthropic: console.anthropic.com
  3. Google AI: aistudio.google.com/apikey
  4. Groq: console.groq.com

Add your API key(s) to the Actor's Environment Variables section in the Apify Console.

Limitations

  • Maximum image size: 20MB
  • Image must be publicly accessible (for URL input) or base64-encoded
  • Processing time varies by model and image complexity (typically 2-10 seconds)
  • Rate limits depend on your LLM provider plan

Support

For issues or feature requests, please contact the Actor developer or leave a review on the Apify Store.