---
title: "AI food logging from photo"
method: POST
path: "/foods/log/photo"
tags: ["Nutrition"]
---

# AI food logging from photo

`POST /foods/log/photo`

## Request

- Base URL: `https://exercise-api.ymove.app/api/v2`
- URL: `https://exercise-api.ymove.app/api/v2/foods/log/photo`
- Auth: one of:
  - API key in header `X-API-Key`
  - API key in query parameter `api_key`

Send a base64-encoded photo of a meal and get back identified foods with full nutrition data. Pro plan and above. Uses your nutrition analysis quota.

## Request body

- object
  - `image` string, required: Base64-encoded image of a meal (JPEG/PNG)
  - `media_type` 'image/jpeg' | 'image/png' | 'image/webp' | 'image/gif'

## Response `200`

Identified foods with nutrition data

- FoodAnalysisResult
  - `data` object
    - `items` object[]
      - `name` string: AI-identified food name
      - `estimatedGrams` number: Estimated portion in grams
      - `confidence` 'high' | 'medium' | 'low': AI confidence level
      - `matchedFood` object, nullable: Matched food from the database (null if no match)
        - `id` string
        - `name` string
        - `servingSizeG` number
      - `nutrition` object, nullable: Calculated nutrition based on matched food and estimated portion (null if no match)
        - `calories` number
        - `protein` number
        - `fat` number
        - `carbs` number
    - `totals` object
      - `calories` number
      - `protein` number
      - `fat` number
      - `carbs` number
  - `usage` object
    - `analyses_used` integer
    - `analyses_included` integer
    - `is_overage` boolean
    - `overage_charge` number

## Other responses

- `403`: Requires Pro plan or higher

---

[API](https://skmtc.dev/ymove/apis/ymove-fitness-api.md) · [All operations](https://skmtc.dev/ymove/apis/ymove-fitness-api/llms.txt) · [OpenAPI document](https://skmtc.dev/ymove/apis/ymove-fitness-api/revisions/6636f2b4a343?raw)
