Object Detection API
The Object Detection API provides fast and accurate image object recognition using advanced neural networks developed by machine learning experts.
From 4,110 users
Applications using this API
API Status
API Response Times
Average | P50 | P75 | P90 | P95 |
|---|---|---|---|---|
| 436ms | 461ms | 504ms | 710ms | 1381ms |
Similar APIs
Didn't find what you were looking for? Suggest an improvement
/v1/objectdetection POST
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.
Files
imagerequiredImage file. Must be either JPEG or PNG format and smaller than 2000 by 2000.
Headers
X-Api-KeyrequiredAPI Key associated with your account.
Response
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.
Sample Request Live Demo!
Try our APIs in the API playground
Sign up for a free API key to get started — no credit card required.
https://api.api-ninjas.com/v1/objectdetectionHeaders
X-Api-KeyLog in or sign up to get your API KeySample Response
Code Examples
1
2
3
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
Can I use the Object Detection API for commercial purposes?
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.How do I get an API key and start using the Object Detection API?
Sign up for a free account to instantly get your API key, then pass it in theX-Api-Keyheader on every request. The documentation above includes ready-to-run examples in cURL, Python, JavaScript, Node.js, and more.What happens if I exceed my quota for the month?
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.What happens if a request to the Object Detection API fails?
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.What format and size must my image be for the Object Detection API?
You send your image as theimagefile 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.What does the Object Detection API response include?
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.What are some use cases for the Object Detection 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.How accurate are the detections and how is confidence reported?
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.