Filter Urban

Metered / request
POST/v1/filter-urban

Quickly separate empty urban or human-modified images from images with an animal, human, or vehicle. Returns bounding boxes and coarse labels only.

Processing images regularly or at large scale?

Use this Instant detection endpoint for first tests, debugging, and small workflows. For steady pipelines, larger files, or bursty camera-fleet uploads, approved customers can use Detection jobs.

Open Detection jobs
Try in playground

Parameters

Required

file | base64 string

Image data. Upload request body limit is 20 MB; raw image budget is 10 MB.

Optional

string

Optional geofencing hint (CCA2/CCA3/full country name).

number

Confidence threshold between 0.01 and 0.99. Default: 0.2.

boolean

Set to true to include available image metadata in the response.

Request notes

Send multipart/form-data for files or JSON with a base64 image. Limits: 20 MB request body and 10 MB raw image.

Response fields

uuid

Required. Request id. Also sent as the X-Request-Id header; use it with GET /detect/{id} and when writing to support.

ISO 8601 timestamp

Required. When GET /detect/{id} stops returning this result.

array

Required. One entry per detected object. Empty when nothing scored above threshold.

integer

Required. Position of the detection in this response, starting at 0.

[number, number, number, number]

Required. Bounding box as [x, y, width, height], normalised to the image size (0 to 1), origin at the top-left corner. Multiply by the pixel width and height to draw it.

number (0 to 1)

Required. Confidence of the detection.

string

Required. Same value as category.

animal | human | vehicle

Required. Coarse class of the detected object.

object

Optional. Image metadata found in the file (image_width, image_height, file_size, EXIF fields when present). Only with metadata=true.

object

Required. processing_time_ms, model_id, model_version, threshold_applied, and country_processed when a country was recognised.

string

Optional. Present when the country value was not recognised and the request ran without geofencing.

Status codes

200Filtering completed.
400Validation error (bad payload, threshold, or image).
401Invalid, missing, or revoked API key.
402Free monthly quota used up and no active API billing, or API keys paused.
413Payload too large for the Instant detection upload limit.
429Rate limit exceeded.
503AI processing service temporarily unavailable.

Notes

  • POST requests must send a User-Agent header that names your application; without one the API answers 400 USER_AGENT_REQUIRED.
  • Best for: urban, indoor, roadside, zoo, farm, and other human-modified empty-vs-object screening.
  • metadata=true includes metadata only for fields found in the source image.
  • Returns only coarse categories: animal, human, vehicle.

Examples

cURL
curl -X POST "https://api.animaldetect.com/v1/filter-urban"   -H "Authorization: Bearer $ANIMAL_DETECT_API_KEY"   -H "User-Agent: MyApp/1.0 (ops@example.com)"   -F "image=@/path/to/camera-trap.jpg"   -F "threshold=0.2"   -F "metadata=true"
Python
import os
import requests

with open("/path/to/camera-trap.jpg", "rb") as image:
    response = requests.post(
        "https://api.animaldetect.com/v1/filter-urban",
        headers={
            "Authorization": "Bearer " + os.environ["ANIMAL_DETECT_API_KEY"],
            "User-Agent": "MyApp/1.0 (ops@example.com)",
        },
        files={"image": image},
        data={
        "threshold": "0.2",
        "metadata": "true"
        },
    )

response.raise_for_status()
data = response.json()
Node.js / Express
const form = new FormData()
form.append('image', imageFile)
form.append('threshold', '0.2')
form.append('metadata', 'true')

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

const data = await response.json()
Example response
{
  "id": "753c34fb-9202-4da2-b1d5-3f0c020db674",
  "expires_at": "2026-03-12T09:44:20.954Z",
  "detections": [
    {
      "id": 0,
      "bbox": [0.22, 0.18, 0.41, 0.53],
      "score": 0.96,
      "label": "human",
      "category": "human"
    }
  ],
  "metadata": {
    "image_width": 4000,
    "image_height": 3000,
    "file_size": 2456789
  },
  "info": {
    "processing_time_ms": 388,
    "model_version": "mdv5",
    "model_id": "mdv5",
    "threshold_applied": 0.2
  }
}