Skip to main content

Image Analysis

Detect NSFW content, explicit images, and inappropriate visual content with high accuracy. Supports batch processing for analyzing multiple images in a single request.

NSFW Detection

Identify explicit, suggestive, and adult content.

Multiple Formats

Supports JPG, PNG, GIF, and WebP images.

Batch Processing

Analyze up to 10 images in a single request.

Endpoint

POST https://api.discuse.com/api/v2/check

Request Format

Provide publicly accessible image URLs in the image_urls array.

Single Image

{
  "content": {
    "image_urls": ["https://example.com/image.jpg"]
  }
}

Multiple Images (Batch)

{
  "content": {
    "image_urls": [
      "https://example.com/image1.jpg",
      "https://example.com/image2.png"
    ]
  }
}

Request Parameters

ParameterTypeRequiredDescription
content.image_urlsstring[]Yes Array of image URLs (max 10 per request)

Note: Images must be publicly accessible URLs. The API will fetch and analyze each image. Private or authentication-protected URLs will fail.

Response Format

Safe Image Response

{
  "has_violations": false,
  "cached": false,
  "message": "Content appears safe",
  "results": {
    "hits": false,
    "images": {
      "status": "ok",
      "hit": false,
      "neutral": 0.97,
      "sexual": 0.02,
      "porn": 0.01,
      "result": {
        "category": "neutral",
        "confidence": 0.97
      }
    }
  },
  "processing_time_ms": 125,
  "usage": {
    "api_requests_used": 151,
    "api_requests_limit": 10000,
    "api_requests_remaining": 9849
  }
}

NSFW Content Detected

{
  "has_violations": true,
  "cached": false,
  "message": "NSFW content detected",
  "results": {
    "hits": true,
    "images": {
      "status": "ok",
      "hit": true,
      "neutral": 0.03,
      "sexual": 0.12,
      "porn": 0.85,
      "result": {
        "category": "porn",
        "confidence": 0.85
      }
    }
  },
  "processing_time_ms": 120,
  "usage": {
    "api_requests_used": 152,
    "api_requests_limit": 10000,
    "api_requests_remaining": 9848
  }
}

Sexual Content Detected

{
  "has_violations": true,
  "cached": false,
  "message": "NSFW content detected",
  "results": {
    "hits": true,
    "images": {
      "status": "ok",
      "hit": true,
      "neutral": 0.08,
      "sexual": 0.87,
      "porn": 0.05,
      "result": {
        "category": "sexual",
        "confidence": 0.87
      }
    }
  },
  "processing_time_ms": 115
}

Response Fields

Image Analysis Fields

FieldTypeDescription
hitboolean True if NSFW content detected (sexual or porn above threshold)
neutralnumber Safe content confidence score (0.0 - 1.0)
sexualnumber Sexually suggestive content confidence (0.0 - 1.0)
pornnumber Explicit/pornographic content confidence (0.0 - 1.0)
result.categorystring Highest scoring category (neutral, sexual, porn)
result.confidencenumber Confidence score of the detected category

Content Categories

CategoryDescriptionHit Flag
neutral Safe for work, family-friendly content false
sexual Sexually suggestive but not explicit content true
porn Explicit adult/pornographic content true

Supported Image Formats

JPG

JPEG images

PNG

PNG images

GIF

Static GIFs

WebP

WebP images

Maximum file size: 10MB per image. Animated GIFs are analyzed as static images (first frame).

Limitations

LimitValue
Max images per request10
Max file size10 MB
Max dimensions 4096 x 4096 pixels
URL timeout30 seconds

Best Practices

  • 1

    Use CDN-hosted images

    For best performance, use CDN-hosted image URLs that load quickly and reliably.

  • 2

    Batch similar images

    When analyzing multiple images from the same source, batch them in a single request for efficiency.

  • 3

    Handle errors gracefully

    If an image fails to load, the API will return an error for that specific image while still processing others in the batch.

  • 4

    Leverage caching

    The API caches results for identical image URLs. Cached responses do not count against your usage quota - you only pay for actual checks.

Try Image Analysis

Test image analysis with our interactive demo. No API key required.

Open Demo