OCR No Label (To get informations on food that doesn’t have packaging or nutrition labels)
POST <https://main-be-933012768577.asia-southeast2.run.app/api/image/prepared-food>
Request Body:
{
"composition": "<http://localhost:3000/uploads/composition/composition-h9q8rswhn4.JPG>",
"nutrition_info": "<http://localhost:3000/uploads/nutrition_info/nutrition_info-zz9uk4bsk0l.png>",
"sessionid": "SDADSADASDERASDA"
}
Response:
{
"status": "success",
}
OCR Label (for foods with nutrition and ingredient list)
POST <https://main-be-933012768577.asia-southeast2.run.app/api/image/packaged-food>
Request Body:
{
"foods": "<http://localhost:3000/uploads/foods/foods-nvk6c6mj5c.JPG>",
"sessionid": "sdasdasda"
}
Response:
{
"status": "success",
}
Get Data ( Pararel 2 data buat ambil OCR Label dan Non Label )
POST <https://main-be-933012768577.asia-southeast2.run.app/api/data-information>
Request Body:
{
"session_id": "sdasdasda"
}
Response:
{
"status": "success",
"data": [
{
"sessionid": "sdasdasda",
"status": "success",
"ingredients": [
{
"name": "Mandarin Orange Juice from Mandarin Orange Juice Concentrate",
"status": "neutral",
"detail": "While providing Vitamin C and some nutrients, concentrated juice may contain higher levels of sugar and may undergo processing that reduces some of the beneficial compounds found in fresh juice. The overall impact depends on the specific concentration process and added ingredients."
},
{
"name": "No Preservatives",
"status": "good",
"detail": "The absence of preservatives is generally considered positive as it reduces exposure to potentially harmful chemicals. However, it may also shorten the shelf life of the product."
},
{
"name": "No Artificial Color",
"status": "good",
"detail": "The absence of artificial colors is generally considered positive as it avoids potential allergic reactions or sensitivities in some individuals. Artificial colors offer no nutritional value."
}
],
"nutrition_info": [
{
"nama": "Total Fat",
"type": "gram",
"nilai": 0,
"status": "neutral"
},
{
"nama": "Saturated Fat",
"type": "gram",
"nilai": 0,
"status": "good"
},
{
"nama": "Protein",
"type": "gram",
"nilai": 0,
"status": "neutral"
},
{
"nama": "Total Carbohydrate",
"type": "gram",
"nilai": 24,
"status": "neutral"
},
{
"nama": "Dietary Fiber",
"type": "gram",
"nilai": 0,
"status": "neutral"
},
{
"nama": "Sugar",
"type": "gram",
"nilai": 24,
"status": "bad"
},
{
"nama": "Sodium",
"type": "milligram",
"nilai": 0,
"status": "good"
},
{
"nama": "Vitamin C",
"type": "percent",
"nilai": 40,
"status": "good"
},
{
"nama": "Calcium",
"type": "percent",
"nilai": 8,
"status": "neutral"
}
]
}
]
}
Summary Food
POST <https://main-be-933012768577.asia-southeast2.run.app/api/generate_summary>
Request Body:
{
"ingredients": [
{
"name": "Mandarin Orange Juice from Mandarin Orange Juice Concentrate",
"status": "neutral",
"detail": "Concentrated juice may contain higher levels of natural sugars and acids, potentially affecting dental health and blood sugar levels if consumed excessively. While providing vitamins and minerals, the concentration process can reduce some nutrients and increase sugar content."
}
],
"nutrition_info": [
{
"nama": "Total Fat",
"type": "gram",
"nilai": 0,
"status": "neutral"
},
{
"nama": "Saturated Fat",
"type": "gram",
"nilai": 0,
"status": "neutral"
},
{
"nama": "Protein",
"type": "gram",
"nilai": 0,
"status": "neutral"
},
{
"nama": "Total Carbohydrate",
"type": "gram",
"nilai": 24,
"status": "neutral"
},
{
"nama": "Dietary Fiber",
"type": "gram",
"nilai": 0,
"status": "neutral"
},
{
"nama": "Sugar",
"type": "gram",
"nilai": 24,
"status": "bad"
},
{
"nama": "Sodium",
"type": "milligram",
"nilai": 0,
"status": "good"
},
{
"nama": "Vitamin C",
"type": "percent",
"nilai": 40,
"status": "good"
},
{
"nama": "Calcium",
"type": "percent",
"nilai": 8,
"status": "neutral"
}
]
}
Response:
{
"status": "success",
"data": {
"summary": [
{
"Overall": {
"status": "Bad",
"description": "The overall rating is 'Bad' primarily due to the high sugar content (24g per serving). While it contains Vitamin C, the excessive sugar outweighs the benefits, posing risks to dental health and blood sugar control."
},
"Sugar Level": {
"status": "High Sugar",
"description": "The 'High Sugar' status is assigned because the product contains 24 grams of sugar per serving. This high sugar content significantly increases the risk of weight gain, type 2 diabetes, and dental problems."
},
"Sodium Level": {
"status": "Normal Sodium",
"description": "The 'Normal Sodium' status reflects the absence of sodium (0mg) in the product, indicating it's a low-sodium option and poses no sodium-related health risks."
},
"Rich in Vitamins": {
"status": "No",
"description": "The 'No' status is given because although the product contains Vitamin C (40% DV), it is not considered 'rich' in vitamins overall, lacking other significant vitamin contributions."
},
"Dairy-Based Product": {
"status": "No",
"description": "The 'No' status indicates the absence of any dairy ingredients in the product, relevant for those with lactose intolerance or following specific diets."
},
"Allergen-Free": {
"status": "Yes",
"description": "The 'Yes' status suggests the product's ingredients do not include common allergens, making it suitable for individuals with allergies (provided accurate ingredient labeling). Further information on potential allergens beyond the provided ingredient list is needed for confirmation."
},
"Preservatives": {
"status": "No",
"description": "The 'No' status signifies the absence of added preservatives in the product, which is generally considered beneficial for health as it reduces the intake of artificial chemicals."
}
}
],
"preservatives_detected": [],
"nutrition_info": [
{
"nama": "Total Fat",
"nilai": "0",
"type": "gram",
"status": "neutral"
},
{
"nama": "Saturated Fat",
"nilai": "0",
"type": "gram",
"status": "neutral"
},
{
"nama": "Protein",
"nilai": "0",
"type": "gram",
"status": "neutral"
},
{
"nama": "Total Carbohydrate",
"nilai": "24",
"type": "gram",
"status": "neutral"
},
{
"nama": "Dietary Fiber",
"nilai": "0",
"type": "gram",
"status": "neutral"
},
{
"nama": "Sugar",
"nilai": "24",
"type": "gram",
"status": "bad"
},
{
"nama": "Sodium",
"nilai": "0",
"type": "milligram",
"status": "good"
},
{
"nama": "Vitamin C",
"nilai": "40",
"type": "percent",
"status": "good"
},
{
"nama": "Calcium",
"nilai": "8",
"type": "percent",
"status": "neutral"
}
],
"ingredients": [
{
"name": "Mandarin Orange Juice from Mandarin Orange Juice Concentrate",
"status": "neutral",
"detail": "Concentrated juice may contain higher levels of natural sugars and acids, potentially affecting dental health and blood sugar levels if consumed excessively. While providing vitamins and minerals, the concentration process can reduce some nutrients and increase sugar content."
}
]
}
}