# Detect objects

POST `/detect-objects`

This is an optional step when doing image search. This endpoint helps you detect and extract specific objects in an image to give users a more precise image search experience. We use computer vision technology to automatically detect and extract the specific objects, providing you with a confidence score. Once you get the response with the cropped images, you can send pass the selected image through the [Image Search](/search/image-search.md) flow.&#x20;

**Headers**

| Header          | Type   | Description   |
| --------------- | ------ | ------------- |
| `Authorization` | string | Bearer token. |

**Request body**

```json
{
    "base64Image": "string"
}
```

**Response**

{% tabs %}
{% tab title="200" %}

```json
{
  "status": "success",
  "detectedObjects": [
        {
            "objectName": "Pants",
            "confidence": 0.8482445478439331,
            "croppedImage":"data:image/jpeg;base64,/9j/4AAQSkZJRgABAQAAAQABAAD",
            "dimensions": {
                "width": 276,
                "height": 407,
                "x": 253,
                "y": 968
                          }
         }
     ]
}
```

{% endtab %}

{% tab title="400" %}

```json
{
 "status": "Server Error",
}
```

{% endtab %}
{% endtabs %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.searchagora.com/search/detect-objects.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
