# Face Detection API
> Detect human faces in an image and analyse each one with on-device machine learning: get the bounding box and a detection confidence, an estimated age, the predicted gender with its probability, and the dominant facial expression together with the full per-expression breakdown (neutral, happy, sad, angry, fearful, disgusted and surprised). A lightweight count endpoint returns just the number of faces and their boxes for fast gating. Supply an image by public URL, base64 or a raw binary request body; only public http/https URLs are accepted and private or internal hosts are blocked, and large images are downscaled automatically. Runs locally on TensorFlow (face-api) — no third-party upstream and no per-image cloud cost — with warm models that keep inference fast. Ideal for photo and avatar apps, audience analytics, smart cameras, auto-cropping and accessibility.

## Authentication
All requests require your oanor API key in the `x-oanor-key` header. Get one at https://www.oanor.com/developer/keys.

```bash
curl -H "x-oanor-key: oanor_live_…" "https://api.oanor.com/facedetect-api/..."
```

## Pricing
- **Free** (Free) — 1,500 calls/Mo, 1 req/s
- **Basic** ($15/Mo) — 30,000 calls/Mo, 3 req/s
- **Pro** ($42/Mo) — 220,000 calls/Mo, 8 req/s
- **Mega** ($109/Mo) — 1,000,000 calls/Mo, 20 req/s

## Endpoints

### Face

#### `GET /v1/count` — Count faces (detection only)

**Parameters:**
- `url` (query, optional, string) — Image URL (or base64/raw body)
- `base64` (query, optional, string) — Base64 image data

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/facedetect-api/v1/count"
```

#### `GET /v1/detect` — Detect faces with age/gender/expression

**Parameters:**
- `url` (query, optional, string) — Image URL (or base64/raw body) Example: `https://example.com/photo.jpg`
- `base64` (query, optional, string) — Base64 image data

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/facedetect-api/v1/detect?url=https%3A%2F%2Fexample.com%2Fphoto.jpg"
```


---
Marketplace page: https://www.oanor.com/api/facedetect-api
OpenAPI spec: https://www.oanor.com/api/facedetect-api/openapi.json
