Loading...
Animal Detect logo

Batch Detect

1 credit / image
POST /api/v1/batch-detect

Best for classical wildlife camera traps. Use this endpoint to analyze up to 10 images in one request and receive per-image detection results in a single response.

Try in Playground

Required Parameters

  • images (file[] | base64[]) Array of 1-10 images. Practical combined raw limit is about 1.1MB because Vertex enforces a 1.5MB encoded request cap.

Optional Parameters

  • threshold (number) Confidence threshold between 0.01 and 0.99. Default: 0.2.
  • country (string) Optional shared geofencing hint (CCA2/CCA3/full country name) applied to every image in the batch.

Supports multipart/form-data (`images` repeated) and application/json with base64 string array. This Vertex-backed route enforces the upstream 1.5MB request cap, so keep combined raw image payloads around 1.1MB or less. Billing is 1 credit per image in the batch.

Status Codes

200Batch detection completed.
400Validation error (empty list, too many images, invalid threshold).
413Batch payload too large for the Vertex-backed request limit.
401Invalid, missing, or revoked API key.
402Credit limit exceeded.
429Rate limit exceeded.
500Unexpected internal server error.
503Upstream Vertex service error.
  • Best for: classical wildlife camera-trap image batches.
  • Batch items are sent to Vertex together in one request instead of being looped sequentially through the legacy proxy.
  • Optional `country` applies one shared geofencing hint to the full batch.
  • Use `/batch-detect-urban` when your batch is urban, indoor, roadside, zoo, farm, or other human-modified settings.
Node.js / Express
const form = new FormData()
form.append('images', firstFile)
form.append('images', secondFile)
form.append('country', 'USA')
form.append('threshold', '0.2')

const response = await fetch('https://www.animaldetect.com/api/v1/batch-detect', {
  method: 'POST',
  headers: {
    Authorization: 'Bearer ' + process.env.ANIMAL_DETECT_API_KEY,
  },
  body: form,
})

const data = await response.json()

Example Response

JSON
{
  "id": "aa367f74-fd47-4ce3-97d6-12f48f3e6d03",
  "expires_at": "2026-03-12T09:44:20.954Z",
  "results": [
    {
      "index": 0,
      "filename": "cam-1.jpg",
      "annotations": [],
      "info": {
        "processing_time_ms": 643,
        "model_version": "mdv1000-speciesnet",
        "model_id": "mdv1000-speciesnet",
        "threshold_applied": 0.2
      }
    }
  ],
  "info": {
    "total_processed": 1,
    "total_time_ms": 643,
    "model_version": "mdv1000-speciesnet",
    "model_id": "mdv1000-speciesnet",
    "country_processed": "USA",
    "threshold_applied": 0.2
  }
}