Computer VisionFree tier available

Mask Detection API — Detect Face Masks in Images

Identify whether individuals in images are wearing face masks. Get per-person detection with confidence scores, bounding boxes, and a summary of mask compliance. Ideal for workplace safety and public health monitoring.

Features

Mask Status Detection

Detect whether each person in an image is wearing a face mask, with per-person confidence scores.

Compliance Summary

Get an instant summary categorizing all detected persons as masked, unmasked, or indeterminate.

Multi-Person Support

Analyze images with multiple people — each person is individually identified and assessed.

Bounding Boxes

Get precise bounding box coordinates for both persons and their masks for overlay visualization.

Flexible Input

Upload a file via multipart or pass a public image URL — both work seamlessly.

Cloud-Based

No GPU needed on your end. Fully managed cloud infrastructure handles the processing.

API Reference

1 endpoint, simple integration. Here's everything you need.

Supported Content Types

multipart/form-dataapplication/x-www-form-urlencoded
POSThttps://mask-detection2.p.rapidapi.com/detect-mask

Detect face coverings on individuals in an image. Returns per-person mask status with confidence scores, bounding boxes, and an overall summary.

imagefilerequired

Image file (JPEG, PNG, etc.) — use with multipart/form-data

urlstringrequired

Public URL of the image to process — use with application/x-www-form-urlencoded

Send either image (file upload) or url (form-encoded), not both.

Response Schema
{
  "statusCode": 200,
  "body": {
    "Persons": [
      {
        "Id": "person-1",
        "Confidence": 0.99,
        "Mask": {
          "Confidence": 0.97,
          "BoundingBox": { "left": 0.3, "top": 0.1, "width": 0.15, "height": 0.12 }
        },
        "BoundingBox": { "left": 0.2, "top": 0.05, "width": 0.3, "height": 0.8 }
      }
    ],
    "Summary": {
      "PersonsWithMask": ["person-1"],
      "PersonsWithoutMask": [],
      "PersonsIndeterminate": []
    }
  }
}

Response

200

Returns JSON with a list of detected persons (each with mask status, confidence, and bounding box) and a summary categorizing persons as with mask, without mask, or indeterminate.

Quick Start

Copy-paste code to get started in seconds. Replace YOUR_API_KEY with your RapidAPI key.

# File upload
curl -X POST "https://mask-detection2.p.rapidapi.com/detect-mask" \
  -H "x-rapidapi-key: YOUR_API_KEY" \
  -H "x-rapidapi-host: mask-detection2.p.rapidapi.com" \
  -F "image=@photo.jpg"

# URL input
curl -X POST "https://mask-detection2.p.rapidapi.com/detect-mask" \
  -H "x-rapidapi-key: YOUR_API_KEY" \
  -H "x-rapidapi-host: mask-detection2.p.rapidapi.com" \
  -H "Content-Type: application/x-www-form-urlencoded" \
  -d "url=https://example.com/photo.jpg"

Pricing

Start free, scale as you grow. All plans include full API access with no credit card required for the free tier.

Free

Basic

$0Free

30 requests/mo

  • Full API access
  • All endpoints
  • Standard support

Pro

$12.99/mo

5,000 requests/mo

  • Full API access
  • All endpoints
  • Standard support
Recommended

Ultra

$22.99/mo

10,000 requests/mo

  • Full API access
  • All endpoints
  • Standard support

Mega

$92.99/mo

50,000 requests/mo

  • Full API access
  • All endpoints
  • Standard support

Frequently Asked Questions

How does the mask detection API determine if someone is wearing a mask?
The mask detection API uses AI to detect each person in an image and analyze whether they are wearing a face covering. It returns per-person mask status with confidence scores and bounding boxes, plus an overall summary categorizing everyone as masked, unmasked, or indeterminate.
Can the API analyze images with multiple people for mask compliance?
Yes. The mask detection API supports multi-person analysis and individually assesses each detected person. The response includes a summary object listing all persons with masks, without masks, and those with indeterminate status, making it easy to calculate compliance rates.
What are common use cases for the face mask detection API?
The mask detection API is used for workplace safety monitoring, public health compliance checks, access control at building entrances, and automated auditing of safety protocols. It can process images from security cameras or uploaded photos to verify face covering requirements.

Start Using Mask Detection Today

Sign up on RapidAPI to get your API key. The free tier includes generous monthly requests — no credit card required.