apyhub
Back
ARTIFICIAL INTELLIGENCE · IMAGE PROCESSING

AI Video Person Detection API

Hosted on ApyHub

What it does

The Person Detection API finds the people in a video. Upload a video or send its URL, choose whether to analyze it with Azure or Google video AI, and get back the detection results as JSON, including where people appear in the video.

Use it to find the scenes that contain people in large video libraries, flag content for review in moderation workflows, or tag footage so it's searchable by who appears in it.

Results come back in the format of the provider you choose, so if your team already works with Azure or Google video AI, you can use them without changing your code. For faces specifically, use the Video Face Detection API, and for other things in a video, the Video Object Detection API.

You can start on ApyHub's free tier with no card required.

To use it, you need an Azure Video Indexer account or a Google Cloud service account. Pass your credentials with each request, and ApyHub handles the upload, processing, and response.

Provider (requested_service)Atoms
Azure500
Google500
▣ ENDPOINT 01 / 02
POST
Person Detection via URL
https://api.eu.apyhub.com/apyhub/detect-persons/url

QUICKSTART

GUIDE

Quickstart

Send the video URL and choose the detection service to get a person-detection result.

curl -X POST "https://api.eu.apyhub.com/apyhub/detect-persons/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 field. The data object may include an azure object when requested_service is azure, or a google object when requested_service is google.

{
  "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 persons in a media file provided by URL and returns a JSON object with a data object containing either an azure or google result, depending on the requested service.

Request Body

ParameterTypeMandatoryDescription
urlStringYesMedia URL to analyze. Must be a URI.
azureObjectNoAzure-specific configuration object. Include the fields below when using Azure.
azure.regionStringNoAzure region.
azure.account_idStringNoAzure account ID.
azure.access_tokenStringNoAzure access token.
googleObjectNoGoogle-specific configuration object. Include the fields below when using Google.
google.google_languageStringNoGoogle language code.
google.google_credential_jsonObjectNoGoogle Cloud service account JSON. The schema defines nested credential fields, but only one level is documented here; 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 include an azure object when requested_service is azure, or a google object when requested_service is google.

ParameterTypeMandatoryDescription
dataObjectYesWrapper object for the detection result.
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
▣ ENDPOINT 02 / 02
POST
Person Detection via file upload
https://api.eu.apyhub.com/apyhub/detect-persons/file

QUICKSTART

GUIDE

Quickstart

Upload an image and choose the backend service to detect persons.

curl -X POST "https://api.eu.apyhub.com/apyhub/detect-persons/file" \
  -H "apy-token: $APY_TOKEN" \
  -F "file=@/path/to/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. The data object can include an azure object when requested_service is azure, or a google object when requested_service is google.

{
  "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*

About this endpoint

What it does

Uploads a file to run person detection using either the Azure or Google route, based on requested_service. The response is a JSON object containing a data object with a service-specific result object for the selected provider.

Request Body

ParameterTypeMandatoryDescription
fileStringYesFile to analyze, sent as binary (format: binary).
azure_regionStringNoAzure region. Example: trial.
azure_account_idStringNoAzure account identifier.
requested_serviceENUMYesService route to use. Allowed values: azure, google. Example: azure.
azure_access_tokenStringNoAzure access token.
google_credential_fileStringNoGoogle service account JSON, sent as binary (format: binary).

Response

Returns a JSON object with a required data object field. Inside data, the schema may include an azure object when requested_service is azure, or a google object when requested_service is google.

ParameterTypeMandatoryDescription
dataObjectYesResponse wrapper object. May contain provider-specific result data.
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.

▣ 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.