Nutrition AI API

getting started 1\ obtain an api key from the spike team 2\ make http requests to the api endpoint, including the necessary parameters 3\ parse the json responses to extract and utilize the nutritional data within your application postman collection example json file provides an example to help you get started quickly you can test it easily by importing it into postman and running it with the sample image already set up https //archbee doc uploads s3 amazonaws com/eg9qgfxk5u6t6blas69cg wbgsmd6zqmbg v1w wvt3 20241028 105202 json usage guidelines for end user for 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 errors "error" { "name" "error", "status" 500, "faults" \[ "image is too small" ] } no food detected computer vision has not detected any food or drink in the provided image errors "error" { "name" "error", "status" 400, "faults" \[ "no food detected" ] } 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 errors "error" { "name" "badrequestexception", "status" 400, "faults" \[ "useruuid useruuid must be a string" ] } invalid api key no or wrong api key provided errors "error" { "name" "unauthorizedexception", "status" 401, "faults" \[ "invalid api key" ] } request is too large the request entity size can be up to a maximum of 10mb when using an image in base64 format errors "error" { "name" "badrequestexception", "status" 413, "faults" \[ "requestentitytoolarge" ] } missing or incorrect image url the imagelink must be an absolute url that includes the full protocol (e g , https //) errors "error" { "name" "typeerror", "status" 500, "faults" \[ "only absolute urls are supported" ] } measurement units "servingsize" g, "calories" kcal, "macronutrients" { "carbohydrates" g, "proteins" g, "fats" g "micronutrients" { "saturatedfat" g, "polyunsaturatedfat" g, "monounsaturatedfat" g, "transfat" g, "fibre" g, "sugar" g, "cholesterol" mg, "sodium" mg, "potassium" mg, "vitamina" mcg, "vitaminc" mg, "calcium" mg, "iron" mg 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