API Reference
Complete API documentation for Robotoff - the AI-powered product data extraction service for Open Food Facts
The Robotoff API provides programmatic access to Open Food Facts' AI-powered product data extraction and processing capabilities. This comprehensive API enables developers to integrate advanced computer vision, machine learning, and data processing features into their applications.
The Robotoff API is a RESTful service that processes product images, extracts structured data, and provides intelligent predictions to enhance product information quality.
Authentication
Most endpoints are publicly accessible. For operations that require authentication, you'll need to provide appropriate credentials through the Open Food Facts authentication system.
API Categories
The Robotoff API is organized into several functional categories:
Core Prediction Services
- Prediction Management: Manage AI predictions, retrieve prediction results, and handle prediction workflows
- Image Predictions: Process product images and extract structured data using computer vision
- Predict Services: Direct prediction endpoints for text analysis, language detection, and category prediction
Content Management
- Logo Management: Detect, annotate, and manage product logos and brand marks
- Annotation Management: Handle human annotations and crowdsourced data validation
- Question Management: Manage validation questions and community feedback workflows
Image Processing
- Image Management: Upload, process, and manage product images for analysis
- Image Processing: Advanced image processing operations and OCR capabilities
Data & Insights
- Insight Management: Manage AI-generated insights and data extraction results
- Dataset Management: Manage training datasets and model data
Operations & Monitoring
- Batch Processing: Execute and monitor large-scale batch processing operations
- User Management: User statistics and contribution tracking
- ANN Search: Approximate nearest neighbor search for similar products
- System Status: Health checks, API status, and system monitoring
Getting Started
Start by checking the API status to ensure the service is running
Try simple predictions like language detection to understand the API structure
Use image prediction endpoints to extract data from product images
Explore specialized endpoints for logo detection, batch processing, and insight management
Common Use Cases
Product Data Extraction
- Extract ingredient lists from product packaging
- Identify nutritional information tables
- Detect product categories and classifications
- Extract brand information and logos
Quality Assurance
- Validate existing product data
- Generate improvement suggestions
- Crowdsource data validation through questions
- Track annotation quality and user contributions
Batch Processing
- Process large volumes of product images
- Update existing product information
- Generate insights for data analysis
- Export processed data for further analysis
Research and Development
- Access training datasets
- Experiment with different prediction models
- Analyze prediction accuracy and performance
- Contribute to model improvements
Response Format
All API responses follow a consistent JSON structure:
{
"status": "success",
"data": {
// Response data
},
"meta": {
"count": 100,
"page": 1,
"pages": 10
}
}
Error Handling
The API uses standard HTTP status codes and provides detailed error messages:
200
- Success400
- Bad Request (invalid parameters)401
- Unauthorized (authentication required)404
- Not Found (endpoint or resource not found)429
- Rate Limited (too many requests)500
- Internal Server Error
Rate Limits
API requests are subject to rate limiting to ensure fair usage:
- General endpoints: 100 requests per minute
- Image processing: 20 requests per minute
- Batch operations: 5 requests per minute
Rate limits may vary based on endpoint complexity and system load. Always implement proper error handling and retry logic in your applications.
SDKs and Libraries
While there are no official SDKs, the API follows REST conventions and can be easily integrated using standard HTTP libraries in any programming language:
- Python:
requests
,httpx
- JavaScript:
fetch
,axios
- Java:
OkHttp
,HttpClient
- PHP:
Guzzle
,cURL
Support and Community
- GitHub Issues: Report bugs and request features
- Slack Community: Join the Open Food Facts Slack workspace
- API Updates: Follow the changelog for API changes
The Robotoff API is actively developed and improved based on community feedback. Contributions and suggestions are welcome!