# Face Detector API

> Face Detector is a face detection API that analyzes an image and reports whether it contains human faces. Paid plans add the face count and bounding box coordinates with a confidence score for each detected face.

**Endpoint:** `POST https://api.apiverve.com/v1/facedetect`  
**Category:** Images  
**Cost:** 10 credits per call  
**Canonical page:** https://apiverve.com/marketplace/facedetect

## Overview

Face Detector API uses advanced computer vision algorithms to identify human faces in images. It returns the precise coordinates (x, y, width, height) and confidence scores for each detected face, making it ideal for applications like photo organization, face cropping, presence detection, and privacy masking.

## Authentication

Every call carries your key in an `x-api-key` header. The same key works across the whole
APIVerve catalog — there are no per-API subscriptions. Responses always use the same three
top-level keys: `status`, `error`, and `data`.

## Example request

```bash
curl -X POST "https://api.apiverve.com/v1/facedetect" \
  -H "x-api-key: YOUR_API_KEY" \
  -F "image=@photo.jpg" \
  -F "confidence=0.5"
```

## Parameters

| Parameter | Type | Required | Description |
| --- | --- | --- | --- |
| `image` | string | Yes | Image file upload (JPG, PNG, GIF, WebP supported, max 10MB) |
| `confidence` | number | No | Minimum confidence threshold for face detection (0.1 to 1.0). default 0.5. range 0.1-1 |

## Response fields

  - `faces.0.x` — number · X coordinate of face bounding box top-left corner · (premium)
  - `faces.0.y` — number · Y coordinate of face bounding box top-left corner · (premium)
  - `faces.0.width` — number · Width of face bounding box in pixels · (premium)
  - `faces.0.height` — number · Height of face bounding box in pixels · (premium)
  - `faces.0.confidence` — number · Confidence score for face detection (0.0 to 1.0) · (premium)
- `faceCount` — number · Total number of faces detected in the image · (premium)
- `hasFaces` — boolean · Whether any faces were detected in the image
- `imageWidth` — number · Width of the analyzed image in pixels · (premium)
- `imageHeight` — number · Height of the analyzed image in pixels · (premium)
- `averageConfidence` — number · Average confidence score across all detected faces · (premium)
- `imageCoverage` — number · Percentage of image area covered by detected faces · (premium)

## Sample response

```json
{
  "status": "ok",
  "error": null,
  "data": {
    "faces": [
      {
        "x": 142,
        "y": 85,
        "width": 98,
        "height": 112,
        "confidence": 0.9847
      },
      {
        "x": 312,
        "y": 92,
        "width": 87,
        "height": 103,
        "confidence": 0.9623
      },
      {
        "x": 478,
        "y": 78,
        "width": 95,
        "height": 118,
        "confidence": 0.9412
      }
    ],
    "faceCount": 3,
    "hasFaces": true,
    "imageWidth": 640,
    "imageHeight": 480,
    "averageConfidence": 0.9627,
    "imageCoverage": 10.23
  },
  "code": 200
}
```

## Use cases

- **Smart Avatar Cropping** — Profile editors center user avatars around the detected face bounding box coordinates instead of cutting off heads with fixed center crops.
- **Privacy Photo Blurring** — Blur sensitive facial areas automatically across community upload galleries before photos publish to public forums.
- **KYC Document Pre-Check** — When applicants submit identity documents, check that exactly one face is present before triggering costly third-party identity checks.
- **Stock Library Categorization** — Digital asset managers scan bulk photo collections to tag portraits based on face counts and filter out group shots automatically.

## SDKs

- **npm** — `npm install @apiverve/facedetect` (https://www.npmjs.com/package/@apiverve/facedetect)
- **NuGet** — `dotnet add package APIVerve.API.FaceDetector` (https://www.nuget.org/packages/APIVerve.API.FaceDetector)
- **Source** — https://github.com/apiverve/facedetect-api

## More

- Full reference: https://docs.apiverve.com/ref/facedetect
- Get an API key: https://dashboard.apiverve.com
- Full catalog: https://apiverve.com/marketplace
