Overview
Nutrition AI API
Getting Started
- Obtain an API key from the Spike Team.
- Make HTTP requests to the API endpoint, including the necessary parameters.
- Parse the JSON responses to extract and utilize the nutritional data within your application.
Usage
Guidelines for End User to get optimal results
- Capture a photo of the food you plan to eat, centering on the contents of your plate.
- Ensure the meal occupies the majority of the image for better recognition.
- Take off any packaging or utensils before snapping the photo.
- Keep the background clutter-free; include only your plate or glass without additional items.
- Use natural or bright lighting to clearly capture details of the food.
- Adjust the angle to minimize items obscuring each other and at a slight angle for the best perspective.
- Avoid using filters or enhancements that might alter the food’s appearance.
Requirements & Errors
Image Size
Minimum image size required: 512x512 pixel.
No Food Detected
Computer vision has not detected any food or drink in the provided image.
User ID not found
Bad Request, userUuid must be provided in String format. It is a unique identifier for your end-user that you use internally within your application.
Invalid API Key
No or wrong API key provided.
Request is too large
The request entity size can be up to a maximum of 10MB when using an image in Base64 format.
Missing or Incorrect Image URL
The imageLink must be an absolute URL that includes the full protocol (e.g., https://).
Measurement units
Response times
Response times can vary because the AI doesn’t always process images at the same speed. Even with the same photo, the system might take longer due to internal factors in how it analyzes the image and provides nutritional information. This means you might experience different wait times even when scanning the same meal.