API v2 · Detection

Contact

Detect NSFW

Detect NSFW content in an image or video URL.

POST/api/v2/detect/nsfw

Authentication

Send your API key as a bearer token on every request.

Header
Authorization: Bearer vba_your_api_key

Request Body

Send JSON with these fields. Required fields must be present unless marked optional.

FieldTypeRequiredDescription
media_urlstring URLYesImage or video URL to classify.
media_typeimage | videoNoSet 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.

FieldTypeRequiredDescription
successbooleanYesTrue when classification completed.
is_nsfwbooleanYesWhether media is classified as NSFW.
scorenumber | nullYesConfidence 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.
Back to API Reference