Detector24
Recreational & Medical Drugs Detector
ImageRestricted Content

Recreational & Medical Drugs Detector

Detect pills, cannabis, joints, syringes, heroin...

Accuracy
94.5%
Avg. Speed
5.0s
Per Request
$0.0060
API Name
drugs-detection

API Reference

Version
2601
Jan 3, 2026
Avg. Processing
5.0s
Per Request
$0.006
Required Plan
trial

Input Parameters

Open-vocabulary object detection with segmentation. Detects objects using text prompts.

image_urlstringRequired

URL of the image for object detection

Example:
https://example.com/image.jpg

Response Fields

Object detection results with bounding boxes and segmentation masks

num_detectionsinteger

Number of objects detected

Example:
3
detectionsarray

Array of detected objects

Array Item Properties:
bboxobject

Bounding box {x1, y1, x2, y2}

{"x1":100,"y1":150,"x2":300,"y2":400}
scorefloat

Detection confidence (0.0-1.0)

0.95
class_idinteger

Class index

0
class_namestring

Detected object class name

person
mask_pngstring

Base64-encoded PNG segmentation mask

data:image/png;base64,...
image_sizeobject

Original image dimensions

Example:
{ "width": 1920, "height": 1080 }

Complete Example

Request

{
  "model": "drugs-detection",
  "image_url": "https://example.com/image.jpg"
}

Response

{
  "success": true,
  "data": {
    "num_detections": 2,
    "detections": [
      {
        "bbox": {
          "x1": 100,
          "y1": 150,
          "x2": 300,
          "y2": 400
        },
        "score": 0.95,
        "class_id": 0,
        "class_name": "person",
        "mask_png": "data:image/png;base64,iVBORw0KGgo..."
      },
      {
        "bbox": {
          "x1": 400,
          "y1": 200,
          "x2": 600,
          "y2": 450
        },
        "score": 0.87,
        "class_id": 1,
        "class_name": "car",
        "mask_png": "data:image/png;base64,iVBORw0KGgo..."
      }
    ],
    "image_size": {
      "width": 1920,
      "height": 1080
    }
  }
}

Additional Information

Rate Limiting
If we throttle your request, you will receive a 429 HTTP error code along with an error message. You should then retry with an exponential back-off strategy, meaning that you should retry after 4 seconds, then 8 seconds, then 16 seconds, etc.
Supported Formats
gif, jpeg, jpg, png, webp
Maximum File Size
20MB
Tags:drugscontrolled-substancesage-restrictedsegmentation

Ready to get started?

Integrate Recreational & Medical Drugs Detector into your application today with our easy-to-use API.