apyhub
ARTIFICIAL INTELLIGENCE · IMAGE PROCESSING

AI Video Face Detection API

Hosted on ApyHub

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
Azure500
Google500
▣ ENDPOINT 01 / 02
POST
Face Detection via file upload
http://localhost:8080/apyhub/face-detection/file
QUICKSTARTGUIDE

Quickstart

Upload a face image and request the Azure service.

curl -X POST "http://localhost:8080/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.

{
  "data": {
    "azure": {}
  }
}
TRY ITLIVE · 500 ATOMS
Loading your default key…
The full key is used to call the gateway and stays in this tab — never sent to orbit or saved.
Max 100MB total per request (all files combined). Larger? Use this API's URL-based endpoint instead, if it has one.
body*
Service account JSON (Google routes).

About this endpoint

What it does

Detects faces from an uploaded file and routes the request to either Azure or Google based on requested_service. The response returns a JSON object with a data object containing provider-specific results.

Request Body

ParameterTypeMandatoryDescription
fileStringYesUploaded file to analyze. Binary format.
azure_regionStringNoAzure region.
azure_account_idStringNoAzure account ID.
requested_serviceENUMYesRoute to use for detection. Allowed values: azure, google.
azure_access_tokenStringNoAzure access token.
google_credential_fileStringNoGoogle service account JSON file. Binary format.

Response

Returns a JSON object with a required data object field. Inside data, the schema defines optional azure and google object fields; the relevant one is present depending on the selected requested_service.

ParameterTypeMandatoryDescription
dataObjectYesResponse wrapper object. Contains provider-specific result fields.
data.azureObjectNoPresent when requested_service is azure. Additional properties are allowed.
data.googleObjectNoPresent when requested_service is google. Additional properties are allowed.

Body

Name
Type
Description
bodyREQUIRED
object

Max 100MB total per request (all files combined). Larger? Use this API's URL-based endpoint instead, if it has one.

▣ ENDPOINT 02 / 02
POST
Face Detection via URL
http://localhost:8080/apyhub/face-detection/url
QUICKSTARTGUIDE

Quickstart

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

curl -X POST "http://localhost:8080/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.

{
  "data": {
    "azure": {}
  }
}
TRY ITLIVE · 500 ATOMS
Loading your default key…
The full key is used to call the gateway and stays in this tab — never sent to orbit or saved.
body*
azure
google
google_credential_json
Google Cloud service account JSON (required for Google video routes).

About this endpoint

What it does

Detects faces in a media file fetched from a URL. You send the media URL and choose which service to use with requested_service; the response returns a JSON object with a data object containing the service-specific result.

Request Body

ParameterTypeMandatoryDescription
urlStringYesURL of the media to analyze. Must be a URI.
azureObjectNoAzure-specific configuration object. Includes region, account_id, and access_token if you are using the Azure service.
azure.regionStringNoAzure region.
azure.account_idStringNoAzure account ID.
azure.access_tokenStringNoAzure access token.
googleObjectNoGoogle-specific configuration object. Includes google_language and google_credential_json if you are using the Google service.
google.google_languageStringNoGoogle language code.
google.google_credential_jsonObjectNoGoogle Cloud service account JSON. Required for Google video routes. See schema for nested fields.
requested_serviceENUMYesService to use. Allowed values: azure, google.

Response

Returns a JSON object with a required data object field. The data object may contain an azure object when requested_service is azure, or a google object when requested_service is google.

ParameterTypeMandatoryDescription
dataObjectYesResponse wrapper. May include azure and/or google result objects depending on the requested service.

Notes

The response schema only guarantees that data.azure is present when requested_service is azure, and data.google is present when requested_service is google; both service result objects are free-form (additionalProperties: true), so their exact fields are not defined here.

Body

Name
Type
Description
bodyREQUIRED
object
▣ COMMON ERRORS

Errors any endpoint can return

400bad_request

Required parameter missing or malformed body.

401unauthorized

API key missing, revoked, or not authorized for this service.

429rate_limited

Your plan's per-second rate exceeded. Retry with exponential backoff.

503upstream_busy

Backend temporarily unavailable. Try again in a few seconds.