API v2 · Detection
Detect NSFW
Detect NSFW content in an image or video URL.
POST
/api/v2/detect/nsfwAuthentication
Send your API key as a bearer token on every request.
Header
Authorization: Bearer vba_your_api_keyRequest Body
Send JSON with these fields. Required fields must be present unless marked optional.
| Field | Type | Required | Description |
|---|---|---|---|
| media_url | string URL | Yes | Image or video URL to classify. |
| media_type | image | video | No | Set video for video sampling. Defaults to image. |
⚠
Media must be publicly accessible. Pass a direct URL from a public storage bucket — e.g. AWS S3, Google Cloud Storage, Cloudinary, Cloudflare R2, Backblaze B2, Uploadcare, or any CDN URL. Private, signed, or localhost URLs will fail.
JSON
{
"media_url": "https://example.com/frame.jpg",
"media_type": "image"
}Response
Successful responses use JSON. Video feature endpoints return an async job_id rather than the final processed video immediately.
| Field | Type | Required | Description |
|---|---|---|---|
| success | boolean | Yes | True when classification completed. |
| is_nsfw | boolean | Yes | Whether media is classified as NSFW. |
| score | number | null | Yes | Confidence score when available. |
JSON
{
"success": true,
"is_nsfw": false,
"score": 0.03
}Example
curl
curl -X POST https://www.bgblur.com/api/v2/detect/nsfw \
-H "Authorization: Bearer vba_your_api_key" \
-H "Content-Type: application/json" \
-d '{
"media_url": "https://example.com/frame.jpg",
"media_type": "image"
}'Tips
- media_type can be image or video.
- Video detection samples up to 15 frames.
- For videos, the detector samples frames. Use it as a moderation signal, not a full frame-by-frame report.