DashboardAI Meal AnalyzerMeal DiaryFood DatabaseDiet PlansAndroid API DocsSettings
Expo Android App Integration

REST API & Android Companion Specs

Complete REST API documentation and cURL test examples for connecting your Expo React Native / Android mobile client to the diet-tracker-web LLM Meal Analysis service.

POST/api/analyze-plate
Multimodal Vision LLM Engine

Accepts a base64 meal image string or multipart image file upload. Invokes Google Gemini Vision model to detect food items, calculate portion weights, total macros, health score, and clinical advice.

Request JSON Payload:
{
  "image": "data:image/jpeg;base64,/9j/4AAQSkZJRg...",
  "apiKey": "AIzaSy..." // Optional override
}
Response JSON (200 OK):
{
  "mealName": "South Indian Lunch Thali",
  "healthScore": 8.8,
  "totalCalories": 620,
  "totalProteinG": 22.5,
  "totalCarbsG": 88.0,
  "totalFatG": 18.0,
  "totalFiberG": 12.0,
  "detectedItems": [
    {
      "name": "Brown Rice",
      "estimatedWeightG": 160,
      "calories": 178,
      "proteinG": 4.2,
      "carbsG": 36.8,
      "fatG": 1.4,
      "fiberG": 2.8,
      "confidence": 0.96,
      "category": "Grains"
    }
  ],
  "glycemicLoad": "Medium",
  "dietaryTags": ["High Fiber", "Vegetarian"],
  "insights": "Good balance of complex carbs...",
  "recommendations": ["Add 50g paneer for extra protein"]
}
GET/api/foods?q=rice
Food Database Search

Search food items and retrieve calorie/macro densities per 100g.

GET/api/health
System Health & LLM Status

Returns server readiness and status of the Google Gemini LLM Vision connection.