---
title: "POST /detect"
method: POST
path: "/detect"
---

# POST /detect

`POST /detect`

Performs object detection on the specified image.
Two input methods are supported -- (1) Uploading an image or (2) specifying an image URL.
A successful response will be returned in JSON. If the request failed, the response will contain an error code and a message to help understand what went wrong.

## Request body

- ImageUrl
  - `url` string, required — Publicly reachable URL of an image.

## Response `200`

The response include the detected objects in JSON format.

- DetectResult, nullable — Result of a DetectImage call.
  - `metadata` ImageMetadata, nullable — Image metadata.
    - `format` string, nullable — Image format.
    - `height` integer — Image height, in pixels.
    - `width` integer — Image width, in pixels.
  - `objects` DetectedObject[], nullable — An array of detected objects.
    - `confidence` number, double — Confidence score of having observed the object in the image, as a value ranging from 0 to 1.
    - `object` string, nullable — Label for the object.
    - `parent` ObjectHierarchy, nullable — An object detected inside an image.
      - `confidence` number, double — Confidence score of having observed the object in the image, as a value ranging from 0 to 1.
      - `object` string, nullable — Label for the object.
      - `parent` ObjectHierarchy — recursive
    - `rectangle` BoundingRect — A bounding box for an area inside an image.
      - `h` integer — Height measured from the top-left point of the area, in pixels.
      - `w` integer — Width measured from the top-left point of the area, in pixels.
      - `x` integer — X-coordinate of the top left point of the area, in pixels.
      - `y` integer — Y-coordinate of the top left point of the area, in pixels.
  - `requestId` string, nullable — Id of the REST API request.

## Other responses

- `default` — Error response.

---

[API](https://skmtc.net/azure/apis/cognitiveservices-computervision.md) · [All operations](https://skmtc.net/azure/apis/cognitiveservices-computervision/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/azure/cognitiveservices-computervision/versions/c35eebd9bcbe/schema)
