Create a Custom Dish from Scratch with a Manual Intake
What You’ll Build
You’ll implement an ingredient-to-intake flow where your app retrieves ingredients from the LogMeal dataset, lets the user select ingredients and quantities, and creates a manual intake without providing a dish id.
This pattern is useful when the meal does not match an existing LogMeal dish, when the user wants to describe a personal recipe, or when a professional needs to record a custom meal precisely from its ingredients.
This workflow creates a one-off food item inside the intake. It does not create a reusable Custom Recipe with its own catalog dish ID, although users can choose to create a Favorite intake for personal future reuse.
Prerequisites
- Plan: Monitor and above (see more info about LogMeal Plans)
- User type: 🔴 APIUser or 🔵 APIUserManager (see more info about User Types)
- A valid target
userId - Valid
ingredientIdvalues retrieved from the LogMeal ingredient dataset - Client library for HTTP (e.g., Python
requests, Nodeaxios, JavaOkHttp)
How Ingredient-Only Manual Intakes Work
Each item in the dishes array references an existing LogMeal dish through its id.
When you wish to submit an ingredient-only manual intake, you may instead:
- Omit the dish
id. - Provide a non-empty
ingredientslist. - Identify each ingredient using a valid
ingredientId. - Optionally provide
ingredientAmount,measureSystem, andmeasureId. - Optionally provide the total item
quantityso ingredient weights are scaled proportionally. - Optionally provide a root-level
intake_namefor the complete intake.
The ingredient recipe is used to calculate:
- the total serving size;
- ingredient-derived food groups;
- nutritional information for the intake and each food item;
- image-level and per-item Nutri-Score;
- metric and preferred measures.
Dish-specific fields remain null because no catalog dish was selected.
Sequence Diagram
Main Flow (Ingredients Selection + Manual Intake Creation)
sequenceDiagram
participant User
participant App
participant LogMeal API
App->>LogMeal API: GET /v2/dataset/ingredients
LogMeal API-->>App: 200 OK (ingredient IDs, names, measures)
App-->>User: Show ingredient search and quantity controls
User->>App: Select ingredients and quantities
App->>LogMeal API: POST /v2/intake/manualInput/{userId} <br> (dishes without id)
LogMeal API-->>App: 201 Created (new intake)
App->>LogMeal API: GET /v2/intake/{imageId}
LogMeal API-->>App: 200 OK (recipe, serving size, food groups, nutrition, Nutri-Score)
App-->>User: Custom intake saved ✅
Optional Nutrition Preview
sequenceDiagram participant User participant App participant LogMeal API User->>App: Edit ingredients or quantities App->>LogMeal API: POST /v2/nutrition/recipe/compute_nutrients LogMeal API-->>App: 200 OK (calculated nutritional information) App-->>User: Refresh nutrition preview
Implementation Guide
1. Retrieve Available Ingredients
Call GET /dataset/ingredients and let the user search or select ingredients from the returned dataset.
Use the returned ingredient IDs in the ingredientId fields of the manual-intake request.
2. Build the Manual-Intake Request
Do not include an id for an ingredient-only item. Instead, provide its ingredients array:
{
"intake_name": "Cod with orange",
"dishes": [
{
"ingredients": [
{
"ingredientId": 388,
"ingredientAmount": 100
},
{
"ingredientId": 539,
"ingredientAmount": 240
}
],
"quantity": 340
}
],
"timestamp": "2026/06/18, 07:55:00"
}Call:
POST /v2/intake/manualInput/{userId}The intake_name parameter belongs at the root of the request. Do not place it inside an individual object in dishes.
3. Retrieve the Complete Intake
Use the returned intake identifier to call GET /intake/{imageId}.
For the ingredient-only item, expect dish-specific fields to remain null:
{
"foodName": [null],
"ids": [null],
"foodGroup": [
"fruit",
"fish"
],
"hasNutritionalInfo": true,
"image_nutri_score": {
"nutri_score_category": "A",
"nutri_score_standardized": 81
},
"recipe_per_item": [
{
"dish_id": null,
"name": null,
"serving_size": 340,
"foodGroups": [
{
"id": 6,
"name": "fruit"
},
{
"id": 9,
"name": "fish"
}
]
}
],
"nutritional_info_per_item": [
{
"id": null,
"hasNutritionalInfo": true,
"hasNutriScore": true,
"nutri_score": {
"nutri_score_category": "A",
"nutri_score_standardized": 81
},
"serving_size": 340
}
]
}User Interaction Recommendations
- Let users search ingredients by name and store their selected
ingredientIdvalues. - Submit ingredient amounts in grams, even if another preferred display measure is selected.
- Show the running total weight and optionally preview nutritional information before submission.
- Use
intake_nameto display a meaningful label because the item has no catalog dish name. - Clearly distinguish one-off ingredient-based items from reusable Custom Recipes.
- Allow users to edit the intake name later through the modify-name endpoint.
Related Endpoints
- GET /dataset/ingredients
- POST /nutrition/recipe/compute_nutrients
- POST /intake/manualInput/{userId}
- GET /intake/{imageId}
- POST /intake/{imageId}/modify_name
- GET /intake/getIntakesList
Remember to check applicable request limitations inside each endpoint.
Common Pitfalls & Tips
- Missing recipe: when
idis omitted, provide a non-emptyingredientslist. - Invalid ingredients: use valid
ingredientIdvalues returned by the LogMeal ingredient dataset. - Ingredient amounts:
ingredientAmountis expressed in grams. - Intake name placement: provide
intake_nameat the root of the request, not insidedishes. - Null dish fields:
ids,dish_id,foodName, and the per-item dishnamearenullby design. - One-off item: this flow does not create a reusable catalog dish or Custom Recipe. Although the user might choose to save it as a Favorite intake to reuse later.
Optional Enhancements
- Preview nutrition before submission while the user edits ingredient quantities.
- Create a reusable personal Favorite intake item to simplify repeated entries.
- Create a reusable company-level Custom Recipe when the same custom dish will be used repeatedly.
- Add a custom intake name and allow it to be renamed later.
- Retrieve the saved intake from history and display ingredient-derived food groups, nutrition, and Nutri-Score.
Next Steps
Pick your path based on what you want to build next:
Review all supported manual-intake options, including existing dishes, custom ingredients, quantities, levels, and bulk assignment.
Retrieve standardized recipe ingredients and quantities for a food intake.
Retrieve per-item and total macro and micronutrient information.
Create reusable organization-managed recipes when a one-off manual item is not enough.
