# Object Detector API

> Object Detector finds the objects in an image, from people, cars and traffic lights to dogs, laptops and cups, and returns each one's label, a numeric confidence and its bounding box in pixels and as fractions of the image, plus a count per label. Filter by minimum confidence or by the labels you care about.

**Endpoint:** `POST https://api.apiverve.com/v1/objectdetector`  
**Category:** Images  
**Cost:** 10 credits per call  
**Canonical page:** https://apiverve.com/marketplace/objectdetector

## Overview

Detection runs DETR ResNet-50, an object detection model from Meta AI trained on the COCO dataset's 80 everyday object classes and released under the Apache 2.0 licence. APIVerve runs it on its own servers, so images are never sent to a third-party AI provider, and photos are turned upright from their EXIF orientation before detection so boxes match the image as it is displayed.

Each object has a confidence from 0 to 1, a pixel box (x, y, width, height from the top-left corner) and the same box as fractions of the image width and height, so you can draw it at any display size. counts gives the number of each label found, ready for inventory, traffic or occupancy counts.

## Authentication

Every call carries your key in an `x-api-key` header. The same key works across the whole
APIVerve catalog — there are no per-API subscriptions. Responses always use the same three
top-level keys: `status`, `error`, and `data`.

## Example request

```bash
curl -X POST "https://api.apiverve.com/v1/objectdetector" \
  -H "x-api-key: YOUR_API_KEY" \
  -F "image=@photo.jpg" \
  -F "minConfidence=0.5" \
  -F "labels=person,car"
```

## Parameters

| Parameter | Type | Required | Description |
| --- | --- | --- | --- |
| `image` | string | No | The image file to analyse (JPG, PNG, GIF or WebP, up to 10 MB), or a public image URL |
| `minConfidence` | number | No | Lowest confidence to return, from 0.05 to 1. default 0.5. range 0.05-1 |
| `labels` | string | No | Comma-separated object labels to keep, such as person,car,dog; all 80 labels when omitted. length 0-500. Premium field |

## Response fields

- `imageWidth` — number · Width of the upright image in pixels
- `imageHeight` — number · Height of the upright image in pixels
- `objectCount` — number · Number of objects returned
- `counts` — object · Number of objects per label, such as {"car": 3}
  - `counts.cat` — number
  - `counts.remote` — number
  - `counts.couch` — number
  - `objects.0.label` — string · Object class, one of the 80 COCO labels
  - `objects.0.confidence` — number · Model confidence from 0 to 1
  - `objects.0.box` — object · Bounding box in pixels: x, y (top-left), width, height
    - `objects.0.box.x` — number · Left edge in pixels
    - `objects.0.box.y` — number · Top edge in pixels
    - `objects.0.box.width` — number · Box width in pixels
    - `objects.0.box.height` — number · Box height in pixels
  - `objects.0.normalizedBox` — object · The same box as fractions (0-1) of image width and height
    - `objects.0.normalizedBox.x` — number · Left edge as a fraction of image width · (premium)
    - `objects.0.normalizedBox.y` — number · Top edge as a fraction of image height · (premium)
    - `objects.0.normalizedBox.width` — number · Box width as a fraction of image width · (premium)
    - `objects.0.normalizedBox.height` — number · Box height as a fraction of image height · (premium)
- `minConfidence` — number · Confidence threshold applied
- `labels` — object · Labels the results were filtered to, or null for all

## Sample response

```json
{
  "status": "ok",
  "error": null,
  "data": {
    "imageWidth": 640,
    "imageHeight": 480,
    "objectCount": 5,
    "counts": {
      "cat": 2,
      "remote": 2,
      "couch": 1
    },
    "objects": [
      {
        "label": "cat",
        "confidence": 0.999,
        "box": {
          "x": 4,
          "y": 51,
          "width": 320,
          "height": 417
        },
        "normalizedBox": {
          "x": 0.0063,
          "y": 0.1062,
          "width": 0.5,
          "height": 0.8688
        }
      },
      {
        "label": "cat",
        "confidence": 0.9987,
        "box": {
          "x": 331,
          "y": 20,
          "width": 309,
          "height": 350
        },
        "normalizedBox": {
          "x": 0.5172,
          "y": 0.0417,
          "width": 0.4828,
          "height": 0.7292
        }
      },
      {
        "label": "remote",
        "confidence": 0.9984,
        "box": {
          "x": 329,
          "y": 67,
          "width": 42,
          "height": 128
        },
        "normalizedBox": {
          "x": 0.5141,
          "y": 0.1396,
          "width": 0.0656,
          "height": 0.2667
        }
      },
      {
        "label": "remote",
        "confidence": 0.9975,
        "box": {
          "x": 29,
          "y": 68,
          "width": 160,
          "height": 50
        },
        "normalizedBox": {
          "x": 0.0453,
          "y": 0.1417,
          "width": 0.25,
          "height": 0.1042
        }
      },
      {
        "label": "couch",
        "confidence": 0.9961,
        "box": {
          "x": 0,
          "y": 0,
          "width": 636,
          "height": 472
        },
        "normalizedBox": {
          "x": 0,
          "y": 0,
          "width": 0.9938,
          "height": 0.9833
        }
      }
    ],
    "minConfidence": 0.5,
    "labels": null
  }
}
```

## Use cases

- **Counting and Occupancy** — Count people, cars or bicycles in camera snapshots to measure footfall, parking use or traffic.
- **Image Tagging** — Tag uploaded photos with the objects they contain so they can be searched and filtered in a media library.
- **Content Checks** — Confirm that listing photos actually show the item for sale, such as a car, bicycle or couch, before they are published.
- **Smart Cropping** — Crop images around the main subject using its bounding box instead of the centre of the frame.

## More

- Full reference: https://docs.apiverve.com/ref/objectdetector
- Get an API key: https://dashboard.apiverve.com
- Full catalog: https://apiverve.com/marketplace
