---
title: Detect Faces from Image File API
slug: detect-faces
url: https://apyhub.com/dosvak/service/detect-faces
provider: Dosvak LLC
categories: [Artificial Intelligence, Image Processing]
tags: [face-detection, computer-vision, image-analysis, bounding-box, object-detection]
auth: api_key
---

# Detect Faces from Image File API

Send an image file and get back face bounding boxes with face_count and image_size. Useful for cropping, overlays, and image workflows.

## Endpoints

| Method | URL | Description | Atoms |
| --- | --- | --- | --- |
| POST | `https://api.eu.apyhub.com/dosvak/detect-faces` | What it does Detects frontal faces in an uploaded image file and returns bounding boxes for each fa… | 100 |

## Examples

### Detect frontal faces and return bounding boxes for each face found

#### Quickstart

Upload an image file to detect any faces in it.

```bash
curl -X POST "https://api.eu.apyhub.com/dosvak/detect-faces" \
  -H "apy-token: $APY_TOKEN" \
  -F "file=@/path/to/image.jpg"
```

#### What you'll get back

Returns a JSON object with optional `faces`, `face_count`, and `image_size` fields.

- `faces` is an array of face rectangles, where each item may include `h`, `w`, `x`, and `y` integer values.
- `face_count` is an integer with the number of faces detected.
- `image_size` is an object with `h` and `w` integer values for the image dimensions.

```json
{
  "faces": [
    { "h": 120, "w": 100, "x": 340, "y": 210 }
  ],
  "face_count": 1,
  "image_size": { "h": 1080, "w": 1920 }
}
```

## About

## What it does
Face Detection finds frontal faces in an image and returns a bounding box for each one. Send a binary `file` in the request body, and get back the face locations in pixel coordinates.

The response includes `faces`, `face_count`, and `image_size`. Each face entry contains `x`, `y`, `w`, and `h`, so you can draw overlays, crop faces, or feed the results into moderation, tagging, or photo-management workflows.

Use Face Detection when you need to identify people in uploaded images, build automatic thumbnail crops, or pre-process images before running another vision step. The `image_size` field gives you the dimensions of the source image, which helps you map detections accurately to your UI or downstream processing.

If no faces are found, the service still returns a structured response, making it easy to handle empty results without special-case parsing.

## Usage

Base URL: `https://api.eu.apyhub.com` (default region — see
`GET https://apyhub.com/api/public/regions` for the rest).

Authenticate with an ApyHub API key in the `apy-token` header.
Full docs and a live playground: https://apyhub.com/dosvak/service/detect-faces
