---
title: AI Video Face Detection API
slug: face-detection
url: https://apyhub.com/apyhub/service/face-detection
provider: ApyHub
categories: [Model Kit, Media Kit]
tags: [face-detection, computer-vision, video-analysis, ai-vision]
auth: api_key
version: 1.0.0
service_type: sync
endpoints: 2
atoms: 500
mcp: true
alias: ai-video-detect-face
---

# AI Video Face Detection API

Detect faces in uploaded files or remote URLs using Azure or Google. Returns provider-specific results in a data object for media workflows.

## Endpoints

| Method | URL | Description | Atoms |
| --- | --- | --- | --- |
| POST | `https://api.eu.apyhub.com/apyhub/face-detection/file` | What it does Detects faces from an uploaded file and routes the request to either Azure or Google b… | 500 |
| POST | `https://api.eu.apyhub.com/apyhub/face-detection/url` | What it does Detects faces in a media file fetched from a URL. You send the media URL and choose wh… | 500 |

## Endpoint reference

### Face Detection via file upload

`POST https://api.eu.apyhub.com/apyhub/face-detection/file` · 500 atoms · accepts `multipart/form-data` · returns `application/json`

| Parameter | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `file` | body | string (binary) | yes |  |
| `azure_region` | body | string | no | Example: `trial`. |
| `azure_account_id` | body | string | no |  |
| `requested_service` | body | string | yes | One of: azure, google. Example: `azure`. |
| `azure_access_token` | body | string | no |  |
| `google_credential_file` | body | string (binary) | no | Service account JSON (Google routes). |

#### Quickstart

Upload a face image and request the Azure service.

```bash
curl -X POST "https://api.eu.apyhub.com/apyhub/face-detection/file" \
  -H "apy-token: $APY_TOKEN" \
  -F "file=@/path/to/face-image.jpg" \
  -F "requested_service=azure" \
  -F 'azure_access_token="your-azure_access_token"' \
  -F 'azure_account_id="your-azure_account_id"' \
  -F 'azure_region="your-azure_region"'
```

#### What you'll get back

Returns a JSON object with a `data` object. When `requested_service` is `azure`, the `data` object may include an `azure` object with the detection result.

```json
{
  "data": {
    "azure": {}
  }
}
```

### Face Detection via URL

`POST https://api.eu.apyhub.com/apyhub/face-detection/url` · 500 atoms · accepts `application/json` · returns `application/json`

| Parameter | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `url` | body | string (uri) | yes | Example: `https://assets.apyhub.com/samples/sample.mp4`. |
| `azure.region` | body | string | no | Example: `trial`. |
| `azure.account_id` | body | string | no | Example: `00000000-0000-0000-0000-000000000000`. |
| `azure.access_token` | body | string | no | Example: `eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.example`. |
| `google.google_language` | body | string | no | Example: `en-US`. |
| `google.google_credential_json.type` | body | string | no | Example: `service_account`. |
| `google.google_credential_json.auth_uri` | body | string | no | Example: `https://accounts.google.com/o/oauth2/auth`. |
| `google.google_credential_json.client_id` | body | string | no | Example: `123456789`. |
| `google.google_credential_json.token_uri` | body | string | no | Example: `https://oauth2.googleapis.com/token`. |
| `google.google_credential_json.project_id` | body | string | no | Example: `my-gcp-project`. |
| `google.google_credential_json.private_key` | body | string | no | Example: `-----BEGIN PRIVATE KEY-----\n...\n-----END PRIVATE KEY-----\n`. |
| `google.google_credential_json.client_email` | body | string | no | Example: `svc@my-gcp-project.iam.gserviceaccount.com`. |
| `google.google_credential_json.private_key_id` | body | string | no | Example: `abc123`. |
| `google.google_credential_json.universe_domain` | body | string | no | Example: `googleapis.com`. |
| `google.google_credential_json.client_x509_cert_url` | body | string | no | Example: `https://www.googleapis.com/robot/v1/metadata/x509/svc%40project.iam.gserviceacc…`. |
| `google.google_credential_json.auth_provider_x509_cert_url` | body | string | no | Example: `https://www.googleapis.com/oauth2/v1/certs`. |
| `requested_service` | body | string | yes | One of: azure, google. Example: `azure`. |

#### Quickstart

Detect faces in an image or video URL with the Azure face-detection service.

```bash
curl -X POST "https://api.eu.apyhub.com/apyhub/face-detection/url" \
  -H "apy-token: $APY_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "url": "https://assets.apyhub.com/samples/sample.mp4",
    "requested_service": "azure",
    "azure": {
        "access_token": "your-access_token",
        "account_id": "your-account_id",
        "region": "your-region"
    }
  }'
```

#### What you'll get back

Returns a JSON object with a `data` object. When `requested_service` is `azure`, `data.azure` is present; when `requested_service` is `google`, `data.google` is present.

```json
{
  "data": {
    "azure": {}
  }
}
```

## About

## What it does
Face Detection lets you send an image or video URL and get face-detection results back from either Azure or Google, depending on the provider you select.

Use the `/file` endpoint to upload a file, or the `/url` endpoint to point the service at a remote asset. In both cases, the request requires `requested_service`, which must be `azure` or `google`. The file-based route also accepts `azure_region`, `azure_account_id`, `azure_access_token`, and `google_credential_file` where relevant. The URL route accepts a `url`, plus provider-specific fields under `azure` or `google`, including Google credential JSON when you are using the Google route.

The response wraps results under `data`, with either an `azure` object or a `google` object present depending on the selected service. That makes it straightforward to plug Face Detection into moderation flows, media indexing, or any workflow that needs to detect faces before you store, route, or analyse visual content.

If you are building an app that handles user uploads or remote media links, Face Detection gives you a simple way to separate the transport layer from the detection provider while keeping the contract clear on both sides.

| Provider (requested_service) | Atoms |
|------------------------------|------:|
| Azure                        |   500 |
| Google                       |  500 |

## 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/apyhub/service/face-detection
