NewConnect Claude, Gemini, ChatGPT, and other AI agents to API Ninjas via our MCP server →

Object Detection API

The Object Detection API provides fast and accurate image object recognition using advanced neural networks developed by machine learning experts.

Online
(4.4)

From 4,110 users

2,700+

Applications using this API

API Status

Online - All Systems Operational

API Response Times

Average
P50
P75
P90
P95
436ms461ms504ms710ms1381ms

Didn't find what you were looking for? Suggest an improvement

https://api.api-ninjas.com/v1/objectdetection

Given an input image, return a list of detected objects labels, confidence percentages and bounding boxes. Objects with confidence less than 0.3 (30%) are filtered out.

Parameters

  • image  required

    Image file. Must be either JPEG or PNG format and smaller than 2000 by 2000.

Headers

  • X-Api-Key  required

    API Key associated with your account.

Response

The /v1/objectdetection endpoint returns a JSON array of objects, each representing a detected object with its label, confidence score, and bounding box coordinates, or an error if the request is unsuccessful.

Live Demo

Live demo · no API key required
Form data
image

Get a free API key to get started — no credit card required.

Headers
X-Api-KeyLog in or sign up to get your API key
POST
https://api.api-ninjas.com/v1/objectdetection
Sample response
[
{
"label": "dog",
"confidence": "0.994",
"bounding_box": {
"x1": "111",
"y1": "72",
"x2": "434",
"y2": "612"
}
},
{
"label": "bicycle",
"confidence": "0.876",
"bounding_box": {
"x1": "56",
"y1": "215",
"x2": "590",
"y2": "540"
}
}
]

Code Examples

curl -X POST "https://api.api-ninjas.com/v1/objectdetection" \ -H "X-Api-Key: YOUR_API_KEY" \ -F "image=@YOUR_IMAGE.jpeg"

If your programming language is not listed in the Code Example above, you can still make API calls by using a HTTP request library written in your programming language and following the above documentation.

Frequently Asked Questions

  • Yes, but you must have a premium subscription. Commercial use of the Object Detection API is not permitted on the free tier. See our pricing page to choose a plan that fits your needs.
  • Sign up for a free account to instantly get your API key, then pass it in the X-Api-Key header on every request. The documentation above includes ready-to-run examples in cURL, Python, JavaScript, Node.js, and more.
  • Your API requests will simply be denied once you hit your monthly quota — you will never be charged more than the plan you signed up for. To increase your quota, you can upgrade your plan any time on our pricing page.
  • The API responds with a standard HTTP status code and a JSON error message describing the problem. See our error codes reference for the full list of codes and how to resolve each one, or contact support if you need help.
  • You send your image as the image file in a multipart POST request to /v1/objectdetection, and it must be either JPEG or PNG format and smaller than 2000 by 2000 pixels. See the full list of error codes if your upload is rejected.
  • The response is a JSON array where each entry represents a detected object with its label, confidence score, and bounding box coordinates, and objects with confidence below 0.3 (30%) are automatically filtered out. To extract readable text or recognize faces from the same image instead, see the Image to Text API and the Face Detect API.
  • It is useful for content moderation, automatic image tagging, inventory and retail shelf analysis, and any application that needs to identify what objects appear in a photo using the latest machine learning algorithms. You can pair it with related API Ninjas computer vision tools like Face Detect for richer image understanding.
  • Each detected object is returned with a confidence percentage from advanced neural networks, and any object scoring below 0.3 (30%) is excluded from the results. For higher volume detection across many images, review the request limits on our pricing page.