Docs/APIs/Object Detector

Object Detector

Find and locate objects in images

OperationalCredits 10 per callp50 2200msImagesStar

Overview

Detection uses DETR (DEtection TRansformer) with a ResNet-50 backbone, trained by Meta AI on COCO 2017 and released under Apache 2.0, run as an 8-bit quantized ONNX model on APIVerve's servers. The image is decoded, turned upright from its EXIF orientation and, if larger, scaled so its longer side is at most 1,333 pixels, which is the most the model reads. DETR predicts 100 candidate objects per image directly, with no anchor boxes or non-maximum suppression; candidates below `minConfidence` are dropped and the rest are mapped back to the original image size.

`confidence` is the model's class probability, 0 to 1, rounded to 4 places. `box` is in pixels of the upright image: `x` and `y` are the top-left corner, measured from the top-left of the image. `normalizedBox` divides those by `imageWidth` and `imageHeight`. Objects are sorted by confidence, and `counts` tallies the returned objects by label, after the `labels` filter.

`labels` accepts the 80 COCO class names (`traffic light`, `cell phone`, `dining table` and so on), case-insensitive, with underscores or hyphens for spaces, simple plurals and common synonyms (sofa, television, phone, bike, motorbike, fridge). An unknown label returns 400 naming it. URLs are downloaded by APIVerve from public hosts only, with a 10 MB limit; the image service never fetches caller URLs itself.

Live Test Object Detector API →

Endpoint

One host, one path per API. The block below shows this call in four languages; every one of them is the same HTTP request. Making requests covers the timeouts, retries and parameter rules that apply to all of them. The SDKs wrap the same call in a typed client.

POSThttps://api.apiverve.com/v1/objectdetector
curl -X POST https://api.apiverve.com/v1/objectdetector \
  -H "x-api-key: your_api_key_here" \
  -H "Content-Type: application/json" \
  -d '{
  "image": "http://images.cocodataset.org/val2017/000000039769.jpg",
  "minConfidence": 0.5
}'

Replace your_api_key_here with the key from your dashboard. When the inputs arrive as a list rather than one at a time, batch requests run up to 200 of them through this same API in a single call.

Authentication

Send your key in the x-api-key header. That is the only auth step — there is no token exchange and no per-endpoint scope to configure. Authentication covers creating, rotating and revoking keys.

401 is the only auth verdict

A 401 means the key is missing, invalid or expired. A 403 means the key is valid but not permitted here — blocked by a key restriction or an IP allow-list. Running out of credits is a 429.

Parameters

Sent as JSON in the request body. Premium parameters are accepted on every plan but only take effect on plans that include them.

ParameterTypeDescription
imageOptionalstringThe image file to analyse (JPG, PNG, GIF or WebP, up to 10 MB), or a public image URL
minConfidenceOptionalnumberLowest confidence to return, from 0.05 to 1
default 0.5 · range 0.05–1
labelsOptionalPremiumstringComma-separated object labels to keep, such as person,car,dog; all 80 labels when omitted
length 0–500

Response

Every API returns the same three top-level keys, so one response handler covers your whole integration: status, error and data. Only data changes shape. Response format covers the envelope, the other output formats and how premium fields are withheld.

Sample response
{
  "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
  }
}

Response fields

Paths are relative to data. Premium fields are absent rather than zeroed on plans that do not include them, so check for presence instead of comparing to 0.

FieldTypeExampleDescription
imageWidthnumber640Width of the upright image in pixels
imageHeightnumber480Height of the upright image in pixels
objectCountnumber5Number of objects returned
countsobject{...}Number of objects per label, such as {"car": 3}
catnumber2
remotenumber2
couchnumber1
objectsarray[5]Detected objects, highest confidence first
labelstring"cat"Object class, one of the 80 COCO labels
confidencenumber0.999Model confidence from 0 to 1
boxobject{...}Bounding box in pixels: x, y (top-left), width, height
xnumber4Left edge in pixels
ynumber51Top edge in pixels
widthnumber320Box width in pixels
heightnumber417Box height in pixels
normalizedBoxobject{...}The same box as fractions (0-1) of image width and height
xPremiumnumber0.0063Left edge as a fraction of image width
yPremiumnumber0.1062Top edge as a fraction of image height
widthPremiumnumber0.5Box width as a fraction of image width
heightPremiumnumber0.8688Box height as a fraction of image height
minConfidencenumber0.5Confidence threshold applied
labelsobjectnullLabels the results were filtered to, or null for all

Errors

Read the HTTP status first, then error for the specific reason. The body names the parameter that has to change. Error handling covers the full status list and which of them are worth retrying.

StatusMeaningWhat to do
400Input was rejectedRead error; it names the parameter.
401Key missing or invalidCheck the header name and the key value.
403Key valid, but not permittedA key restriction or IP allow-list; see key scoping.
429Rate limited, or out of creditsRead error to tell them apart; see rate limits.

Object Labels

The 80 COCO object classes the labels parameter accepts

Value
person
bicycle
car
motorcycle
airplane
bus
train
truck
boat
traffic light
fire hydrant
stop sign

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.

Other ways to use Object Detector

Set up Object Detector on APIVerve, or reach the same source a different way. Your APIVerve account and credits work on all of them — one key, one balance.

Give it to an AI agentConnect over MCP and your agent calls it as a native tool — Claude, Cursor, ChatGPT.VerveKit →Reference →

More in Images:

Was this page helpful?