# LogMeal API Documentation
## Guides
- [Best Practices & Toubleshooting](https://docs.logmeal.com/docs/guides-best-practices-toubleshooting.md)
- [Image Pre-processing](https://docs.logmeal.com/docs/guides-essential-concepts-image-pre-processing.md)
- [Ways to Submit New Intakes](https://docs.logmeal.com/docs/guides-essential-concepts-intakes-submit-methods.md)
- [Plans & Limits](https://docs.logmeal.com/docs/guides-essential-concepts-plans-limits.md)
- [Food Recognition Capabilities](https://docs.logmeal.com/docs/guides-essential-concepts-recognition-capabilities.md)
- [User Types & Access Tokens](https://docs.logmeal.com/docs/guides-essential-concepts-users-and-access-tokens.md)
- [App White Label](https://docs.logmeal.com/docs/guides-features-app-white-label.md)
- [Barcode Scanner](https://docs.logmeal.com/docs/guides-features-barcode-scanner.md)
- [Body Measurements](https://docs.logmeal.com/docs/guides-features-body-measurements.md)
- [Custom Nutritional Indicators](https://docs.logmeal.com/docs/guides-features-custom-nutritional-indicators.md)
- [Custom Occasions](https://docs.logmeal.com/docs/guides-features-custom-occasions.md)
- [Custom Recipes](https://docs.logmeal.com/docs/guides-features-custom-recipes.md)
- [Daily Nutritional Goals](https://docs.logmeal.com/docs/guides-features-daily-nutritional-goals.md)
- [Easy Ingredients Modulation](https://docs.logmeal.com/docs/guides-features-easy-ingredients-modulation.md)
- [External Management](https://docs.logmeal.com/docs/guides-features-external-management.md)
- [Favorite Meals](https://docs.logmeal.com/docs/guides-features-favorite-meals.md)
- [Food Groups Detection](https://docs.logmeal.com/docs/guides-features-food-groups-detection.md)
- [Food Restrictions & Diet Labels](https://docs.logmeal.com/docs/guides-features-food-restrictions.md)
- [Food Type Detection](https://docs.logmeal.com/docs/guides-features-food-type.md)
- [Food Waste Detection](https://docs.logmeal.com/docs/guides-features-food-waste-estimation.md)
- [Intakes' Ingredients Edition](https://docs.logmeal.com/docs/guides-features-ingredients-edition.md)
- [Ingredients Information](https://docs.logmeal.com/docs/guides-features-ingredients-information.md)
- [Intakes History](https://docs.logmeal.com/docs/guides-features-intakes-history.md)
- [LogMeal Kiosk Integration](https://docs.logmeal.com/docs/guides-features-logmeal-kiosk-integration.md)
- [LogMeal Platform Service](https://docs.logmeal.com/docs/guides-features-logmeal-platform-service.md)
- [Manual or Assigned Intakes](https://docs.logmeal.com/docs/guides-features-manual-intakes.md)
- [Multi-language Responses & Localized Food Names](https://docs.logmeal.com/docs/guides-features-multi-language-support.md)
- [Nutritional Scoring](https://docs.logmeal.com/docs/guides-features-nutri-scores.md)
- [Nutritional Information](https://docs.logmeal.com/docs/guides-features-nutritional-information.md)
- [Nutritional Plans](https://docs.logmeal.com/docs/guides-features-nutritional-plans.md)
- [Nutritional Reports & Summaries](https://docs.logmeal.com/docs/guides-features-nutritional-reports-summaries.md)
- [Occasion Detection](https://docs.logmeal.com/docs/guides-features-occasion-detection.md)
- [Features Overview](https://docs.logmeal.com/docs/guides-features-overview.md)
- [Food Quantity Detection](https://docs.logmeal.com/docs/guides-features-quantity-estimation.md)
- [Recipe and Dish Recommendation](https://docs.logmeal.com/docs/guides-features-recipe-and-dish-recommendation.md)
- [Recommended Daily Intake](https://docs.logmeal.com/docs/guides-features-recommended-daily-intake.md)
- [Remaining Daily Intake](https://docs.logmeal.com/docs/guides-features-remaining-daily-intake.md)
- [Several Dishes Recognition](https://docs.logmeal.com/docs/guides-features-several-dishes-recognition.md)
- [Units of Measurement](https://docs.logmeal.com/docs/guides-features-units-of-measurement.md)
- [User Feedback (Dysphagia)](https://docs.logmeal.com/docs/guides-features-user-feedback-dysphagia.md)
- [Variety Score](https://docs.logmeal.com/docs/guides-features-variety-score.md)
- [Quickstart](https://docs.logmeal.com/docs/guides-getting-started-quickstart.md): Get your first successful call to LogMeal in minutes. Subscribe, create a π΄ **APIUser** token, run image recognition, confirm dishes, and fetch nutritional information.
- [Ready-to-Use Code in 35+ Languages](https://docs.logmeal.com/docs/guides-getting-started-ready-to-use-code.md): Obtain code samples in 35+ programming languages to start your LogMeal API integration right-away.
- [Welcome to LogMeal API](https://docs.logmeal.com/docs/guides-getting-started-welcome-logmeal-api.md): The LogMeal API is a RESTful service that recognizes foods from images, returns ingredients and nutrition, and lets your app log intakes, track goals, and power personalized recommendations.
- [Food Quantity Confirmation](https://docs.logmeal.com/docs/guides-use-cases-food-quantity-confirmation.md)
- [Food Quantity Detection](https://docs.logmeal.com/docs/guides-use-cases-food-quantity-detection.md)
- [Image Recognition with Confirmation](https://docs.logmeal.com/docs/guides-use-cases-food-recognition-confirmation.md)
- [Ingredients List Retrieval](https://docs.logmeal.com/docs/guides-use-cases-ingredients-list-retrieval.md)
- [Nutritional Information Retrieval](https://docs.logmeal.com/docs/guides-use-cases-nutritional-information-retrieval.md)
- [Units of Measurement & User Preferred Measurements](https://docs.logmeal.com/docs/guides-use-cases-units-and-preferred-measurements.md)
## API Reference
- [β«π΄ Retrieves the list of active API versions. β±](https://docs.logmeal.com/reference/get_v2-version-activeapis.md): (S) Limited amount of calls per second. This endpoint returns a list containing the API versions that are currently active. Changing the version of an endpoint could change its inputs/outputs. Using the most recent API version is always recommended, as the latest versions will provide more and better functionalities.
- [β«π΄ Retrieves the list of active Models/Algorithms versions. β±](https://docs.logmeal.com/reference/get_v2-version-activemodels.md): (S) Limited amount of calls per second. This endpoint returns a list containing the versions of the recognition models that are currently active. The versions provided are sorted, meaning that the first one is the most recent and the last one is the least recent. You can fix the version in our recognition endpoints in order to always receive the same list of classes, although WE RECOMMEND NOT FIXING THE VERSION in order to obtain the best results possible as we update our models.
- [β«π΄ Retrieves all available models grouped by version. β±](https://docs.logmeal.com/reference/get_v2-version-allmodels.md): (S) Limited amount of calls per second. This endpoint returns a list of the available models with their available versions.
- [π΄ Delete an existent favorite of a user.](https://docs.logmeal.com/reference/delete_v2-favorites.md): This endpoint deletes a previously created favorite instance for an APIUser.
- [π΄ Get all favorites of a user. β±](https://docs.logmeal.com/reference/get_v2-favorites.md): (S) Limited amount of calls per second. This endpoint returns all previously created favorites for a user.
- [π΄ Edits the name for an existent favorite of a user.](https://docs.logmeal.com/reference/patch_v2-favorites.md): This endpoint can be used to edit the name of a previously created favorite instance for an APIUser.
- [π΄ Assign a favorite instance to user intake. β±](https://docs.logmeal.com/reference/post_v2-favorites-intake.md): (S) Limited amount of calls per second. This endpoint assigns an existing favorite instance (favorite_id) to either a manual intake or the recognition results for an image uploaded by the user(imageId). This allows reusing all the information stored in the favorite instance without requiring a re-introduction by the user. For more information on manual input, see endpoint '/v2/intake/manualInput'.
- [π΄ Create a favorite instance for a user. β±](https://docs.logmeal.com/reference/post_v2-favorites.md): (S) Limited amount of calls per second. This endpoint creates a favorite instance for a user using an existent image id and all confirmed dishes in the image together with their quantities. This way users can store their more preferred dishes and meals as their favorites and use them to introduce food intakes in the future in an easier way. Furthermore, this information will be internally used to better customize the user experience.
- [β« Deletes an APIUser from your APICompany.](https://docs.logmeal.com/reference/delete_v2-users-deleteapiuser-userid.md): This endpoint deletes/disables a user from your APICompany. If the APIUser you want to delete has already used our API (has processed images through our endpoints), a soft delete will be applied (the user will be disabled but it's data will be kept for your future analysis through our intake history endpoints). If the APIUser has never used any of our image processing endpoints, the user will be completely removed from our system.
- [β« Returns the list of existing APIUsers for a given company](https://docs.logmeal.com/reference/get_v2-users-apiusers.md): This endpoint returns a list of the APIUsers that are associated to your APICompany, with some basic information about each APIUser.
- [β« Get a user's profile information.](https://docs.logmeal.com/reference/get_v2-users-getuserprofileinfo-userid.md): This endpoint returns the information from the specified APIUser owned by the APICompany. Read the specification of the response body to see the available fields with their descriptions. This endpoint is the same as '/v2/profile/getUserProfileInfo'.
- [β« Modify a user's profile information.](https://docs.logmeal.com/reference/post_v2-users-modifyuserprofileinfo-userid.md): This endpoint allows you to modify the profile and main attributes of an end-user (APIUser). This information associated to the user can be used for features like improving and customizing the output of the food recognition capabilities, personalizing the nutrition recommendations and nutrition plans, adapting to the user intake patterns, etc. Read the specification of the request body to see the available fields with their descriptions. This endpoint is the same as `/v2/profile/modifyUserProfileInfo` and `/v2/managers/modifyUserProfileInfo`. ### π Geographic and Language Personalization We highly recommend including the optional fields `country` and `language` in the request body: - **`country`** (ISO 3166β1 alphaβ2 code, e.g., `US`, `FR`, `JP`): Providing the country allows LogMeal to geographically refine its food recognition capabilities. This enables improved detection accuracy for region-specific dishes and eating patterns, leading to better personalization in nutrition analysis. - **`language`** (e.g., `en`, `es`, `fr`): Setting the preferred language ensures that the names of food items, ingredients, nutrients, and other elements are returned in the specified language, offering a better user experience tailored to each APIUser. Including these parameters increases the contextual accuracy and relevance of all subsequent API responses. ### π₯ Customizing Recommended Food Group Consumption You can also use this endpoint to **customize the recommended daily or weekly food group portions** for a user by passing the `min_max_food_groups` field. This allows setting personalized minimum and/or maximum portion limits per food group, which will be taken into account during dietary analysis and goal calculations. Important constraints: - If you want to indicate that a food group has **no minimum requirement**, use `null` as the `min` value. You must **not** use `0`, since `0` would imply the user is expected to consume exactly 0 portions, which is incorrect for `min`. - If you want to explicitly restrict a user from consuming a food group, set the `max` value to `0`. This means that any intake of that group will be considered a deviation from the goal.
- [β« Sign Up new APIUser](https://docs.logmeal.com/reference/post_v2-users-signup.md): Create a new APIUser which will have access to our API, an APIUser should only be assigned to a unique user. Each APIUser will have a token assigned to it which can be used in our endpoints, granting access to the services. Any call that is made by each of your APIUsers will be taken into consideration based on your current LogMeal Plan. Also, each APIUser counts towards the device limit so you won't be able to create one if your current LogMeal Plan's limit is reached. **IMPORTANT:** we recommend taking a look at the `modifyUserProfileInfo` endpoints, which allow customizing the user profile and thus, get personalization capabilities along any of the endpoints in the LogMeal API.
- [β« Toggles the 'enabled' attribute for an APIUser.](https://docs.logmeal.com/reference/post_v2-users-toggleenabled-userid.md): By changing the state of the 'enabled' attribute you can grant or prevent a user to gain access to the main intake endpoints. Furthermore, you can preventing them to consume monthly credits or account for the total Monthly Active Users (MAUs). Alternatively, you can change the 'enabled' attribute through the 'Users' page after logging in to your account at LogMeal's web page. If an APIUser is DISABLED and tries to make an API call to a privileged endpoint an HTTP error will be received with status code 403 and custom error code 116. You can check the status of the 'enable' attribute calling the endpoint GET '/v2/users/APIUsers'.
- [π΄ Get the user's profile information.](https://docs.logmeal.com/reference/get_v2-profile-getuserprofileinfo.md): This endpoint returns the information from the APIUser performing the request. Read the specification of the response body to see the available fields with their descriptions. This endpoint is the same as '/v2/users/getUserProfileInfo'.
- [π΄ Changes current user language](https://docs.logmeal.com/reference/post_v2-profile-changelanguage.md): **[NOTE] This endpoint is DEPRECATED. We recommend using the endpoint POST /modifyuserProfileInfo instead.** This endpoint allows an APIUser to modify their assigned language, which will modify the language of the responses generated by our endpoints.
- [π΄ Modify the profile information.](https://docs.logmeal.com/reference/post_v2-profile-modifyuserprofileinfo.md): This endpoint allows you to modify the profile and main attributes of an end-user (APIUser). This information associated to the user can be used for features like improving and customizing the output of the food recognition capabilities, personalizing the nutrition recommendations and nutrition plans, adapting to the user intake patterns, etc. Read the specification of the request body to see the available fields with their descriptions. This endpoint is the same as `/v2/managers/modifyUserProfileInfo` and `/v2/users/modifyUserProfileInfo`. ### π Geographic and Language Personalization We highly recommend including the optional fields `country` and `language` in the request body: - **`country`** (ISO 3166β1 alphaβ2 code, e.g., `US`, `FR`, `JP`): Providing the country allows LogMeal to geographically refine its food recognition capabilities. This enables improved detection accuracy for region-specific dishes and eating patterns, leading to better personalization in nutrition analysis. - **`language`** (e.g., `en`, `es`, `fr`): Setting the preferred language ensures that the names of food items, ingredients, nutrients, and other elements are returned in the specified language, offering a better user experience tailored to each APIUser. Including these parameters increases the contextual accuracy and relevance of all subsequent API responses. ### π₯ Customizing Recommended Food Group Consumption You can also use this endpoint to **customize the recommended daily or weekly food group portions** for a user by passing the `min_max_food_groups` field. This allows setting personalized minimum and/or maximum portion limits per food group, which will be taken into account during dietary analysis and goal calculations. Important constraints: - If you want to indicate that a food group has **no minimum requirement**, use `null` as the `min` value. You must **not** use `0`, since `0` would imply the user is expected to consume exactly 0 portions, which is incorrect for `min`. - If you want to explicitly restrict a user from consuming a food group, set the `max` value to `0`. This means that any intake of that group will be considered a deviation from the goal.
- [β«π΅ Delete an existent body measure.](https://docs.logmeal.com/reference/delete_v2-measure.md): Delete a previously created body measure. **NOTE**: If the deleted goal was associated with a nutrition plan, the plan will also be deleted. The company has a series of measures that are necessary for the correct functioning of the application. If you try to delete any of them, an error will be displayed to the user, preventing the loss of information. For example 'weight'.
- [π΄π΅ Delete an existent user body measure goal.](https://docs.logmeal.com/reference/delete_v2-user-measure-goal.md): Delete a previously created user body measure goal. If timestamp is not provided all the measure goals with the passed name will be deleted.
- [π΄π΅ Delete an existent user body measure.](https://docs.logmeal.com/reference/delete_v2-user-measure.md): Delete a previously created user body measure. If timestamp is not provided all the measures with the passed name will be deleted.
- [β«π΄π΅ Get all the existent body measures from a company.](https://docs.logmeal.com/reference/get_v2-measure.md): Retrieve the previously created body measures.
- [π΄π΅ Get user body measure goals values.](https://docs.logmeal.com/reference/get_v2-user-measure-goal.md): Retrieve the previously created user body measure goals.
- [π΄π΅ Get user body measures values.](https://docs.logmeal.com/reference/get_v2-user-measure.md): Retrieve the previously created user body measures.
- [β«π΅ Update a body measure for a company.](https://docs.logmeal.com/reference/patch_v2-measure.md): Create a body measure for a company. Provide at least one of the two values to update. The company has a series of measures that are necessary for the correct functioning of the application. If an attempt is made to modify any of them with values that are not allowed, an error will be displayed to the user informing them of the fields allowed in this modification. For example 'weight' has two possible units 'kg' or 'lb'.
- [β«π΅ Create a body measure for a company.](https://docs.logmeal.com/reference/post_v2-measure.md): Create a body measure for a company. A body measure consists of a name and its unit. The company has a series of measures that are necessary for the correct functioning of the application. If you try to create any of them with the reserved name, an error will be shown to the user along with a list of the reserved measures.
- [π΄π΅ Insert a value for a user measurement goal.](https://docs.logmeal.com/reference/post_v2-user-measure-goal.md): Insert a body measure for a user. A user body measure goal consists of a name for the measure, a value and a date.
- [π΄π΅ Insert a value for a user measurement.](https://docs.logmeal.com/reference/post_v2-user-measure.md): Insert a body measure for a user. A user body measure consists of a name for the measure, a value and a date (optional). If the date is not provided the actual date will be used.
- [β«π΅ Delete an existent custom nutritional indicator translation.](https://docs.logmeal.com/reference/delete_v2-custom-nutritional-indicator-translation.md): Delete a previously created custom nutritional indicator translation.
- [β«π΅ Delete an existent custom nutritional indicator.](https://docs.logmeal.com/reference/delete_v2-custom-nutritional-indicator.md): Delete a previously created custom nutritional indicator. If there is any nutritional goal defined for that custom indicator it will be deleted
- [β«π΅ Get all the existent custom nutritional indicators.](https://docs.logmeal.com/reference/get_v2-custom-nutritional-indicator.md): Retrieve the previously created custom nutritional indicators. Get all of them or just the one passed as a parameter.
- [β«π΅ Patch an existent custom nutritional indicator translation.](https://docs.logmeal.com/reference/patch_v2-custom-nutritional-indicator-translation.md): Patch a previously created custom nutritional indicator translation.
- [β«π΅ Patch an existent custom nutritional indicator.](https://docs.logmeal.com/reference/patch_v2-custom-nutritional-indicator.md): Patch a previously created custom nutritional indicator.
- [β«π΅ Create a custom nutritional indicator translation.](https://docs.logmeal.com/reference/post_v2-custom-nutritional-indicator-translation.md): Create a translation for an specific custom nutritional indicator. All the available indicators with their respective units can be found by using the endpoint '/v2/info/nutrients'. The defined translations can be retrieved by using the endpoint 'GET /v2/info/custom_nutritional_indicator'.
- [β«π΅ Create a custom nutritional indicator.](https://docs.logmeal.com/reference/post_v2-custom-nutritional-indicator.md): Create a custom nutritional indicator. They will be added to the available indicators and can be used, for example, to set goals or to be present in a custom recipe's nutritional information. The available indicators with their respective units can be found by using the endpoint '/v2/info/nutrients'.
- [β«π΅π΄ Get existing occasion groups](https://docs.logmeal.com/reference/get_v2-intake-getoccasiongroups.md): Get all the occasion groups for the company in the request. It will return the active and inactive occasion groups and the system's default occasions, containing information about each occasion group and each occasion. A time range can be specified as query parameters (init_time and end_time), and it will only return the occasion groups that fall within the specified time range. This applies only to the inactive occasions. Active occasions will always be included in the response. If no time range is specified, all occasion groups will be returned. If no occasion groups have been defined, it will only return the system's default occasions.
- [β«π΅ Create a new occasion group](https://docs.logmeal.com/reference/post_v2-intake-createoccasiongroup.md): Create an occasion group. Update the company occasions by blocks of occasions (occasion group). Assign a custom name and time range to each of the new occasions. In every block, there must be one default occasion with no time range defined. maps_to_occasion will contain a direct mapping between the default system occasions and the one that is being created. It is necessary in order to give recommendations using the company occasions. Everytime this endpoint is called with a valid occasion group, it gets set as the active group and if there already was an active one it gets set to inactive.
- [β«π΅ Create a new occasion translation](https://docs.logmeal.com/reference/post_v2-intake-createoccasiontranslation.md): Create an occasion translation for a defined occasion in a given language. Translations will belong to a occasion. If a new occasion group is created the translations will be stored but not active anymore.
- [π΅β« Deactivate an existing custom recipe.](https://docs.logmeal.com/reference/delete_v2-custom-recipe-custom-recipe-id.md): This endpoint is used to deactivate an existing custom recipe created by APICompany and APIUserManager. This means that all the food intakes attached to this custom recipe will remain untouched but the recipe will not be available anymore for future intake assignments.
- [π΅β«π΄ Get the complete information for a specific custom recipe.](https://docs.logmeal.com/reference/get_v2-custom-recipe-custom-recipe-id.md): This endpoint is used to get a single custom recipe referred by the provided 'custom_recipe_id' parameter. It returns all the information associated to that specific recipe (dish name, image url, ingredients list, nutritional indicators, etc.).
- [π΅β«π΄ Get some basic information about all the active custom recipes.](https://docs.logmeal.com/reference/get_v2-custom-recipe.md): This endpoint is used to get all active custom recipes.
- [π΅β« Edit an existing custom recipe.](https://docs.logmeal.com/reference/patch_v2-custom-recipe-custom-recipe-id.md): This endpoint is used when the user wants to update the details of a custom recipe referred by the provided 'custom_recipe_id' parameter. The parameters that can be edited are image, dish_name, translations, ingredient_list and nutritional_indicators. If any of the parameters are provided in the request body then it will update the respective recipe with the new values. If a list of ingredients ids provided but not a list of nutrients, the nutritional information will be automatically calculated based on the list of ingredients stored in the system. It's important to note that only ingredients with a valid, existing and associated ID will be considered. For the 'translations' parameter, each language code maps to the translated dish name. You can pass a string value to update or add a translation. If a language's value is set to null, the stored translation for that language will be deleted. Refer to POST '/v2/custom_recipe' in order to understand the required format for each of the optional parameters. This endpoint has an 'image' parameter in the request body which is in the 'multipart/form-data', and other parameters are in 'application/json'. You can check it from the dropdown from the right corner.
- [π΅β« Create a custom recipe.](https://docs.logmeal.com/reference/post_v2-custom-recipe.md): Allows creating a custom recipe that will only be visible by your company. You can create recipes that will be consumed exclusively by your users. You can provide a default dish name, ingredient_list and nutritional_indicators for each custom recipe. Note that all ingredients and nutrients quantities must be introduced for the standard serving size of the recipe. Furthermore, you can optionally provide a set of translations for your dish to all the available languages (see endpoint /v2/info/languages to know which is the set of valid languages). The users will visualize the translation corresponding to his/her language. If a language's value is set to null, the stored translation for that language will be deleted. **IMPORTANT: note that at least the language 'eng' MUST be provided if you want the recognition algorithms to automatically detect the custom recipes.** To identify an ingredient it can be done in two different ways. Either passing an 'ingredientId' (it must be a valid ingredient id from the LogMeal system) or an 'ingredientName'. When passing a Name, the ingredient, will be present in the recipe and will be usable but it will not have some functionalities since it is not in the system and there is no data associated to it. It could be anything. Refer to GET '/v2/info/nutrients' to see a list of valid nutrient codes. Where you can find the 'indicatorCode' and unit for the 'indicatorAmount' for all the available nutrients. Refer to GET '/v2/dataset/ingredients', it will return all the valid ingredients names and their ids. All values for 'ingredientAmount' must be reported in grams and all values for 'indicatorAmount' must be reported in the indicator-specific unit reported in '/v2/info/nutrients'. If a list of ingredients is provided but not a list of nutrients, the nutritional information will be automatically calculated based on the list of ingredients stored in the system. It's important to note that only ingredients with a valid, existing and associated ID will be considered. Alternatively, it is also possible to provide only the nutritional indicators without specifying any ingredients. In this case, the system will use the provided nutritional data as-is, without performing any automatic calculation or ingredient validation. This option can be useful when the exact composition of the recipe is unknown or when you only need to register the nutritional profile directly. This endpoint has an 'image' parameter in the request body which is in the 'multipart/form-data', and other parameters are in 'application/json'. You can check it from the dropdown from the right corner.
- [β«π΄π΅ Delete an existent daily goal for a specific nutrient.](https://docs.logmeal.com/reference/delete_v2-daily-nutritional-goal.md): Delete a previously created intake goal, for a specific nutrient.
- [β«π΄π΅ Get all the existent daily goals from a user.](https://docs.logmeal.com/reference/get_v2-daily-nutritional-goal.md): Retrieve the previously created intake goals. If this endpoint is called by an APIUser it will return its current daily nutritional goals. If this endpoint is called by an APICompany/APIUserManager an extra parameter with the ID of the user to get the information from is required.
- [π΅β« Autocompute a daily goal for a specific list of nutrients.](https://docs.logmeal.com/reference/post_v2-daily-nutritional-goal-autocompute.md): Automatically computes and posts a daily intake goal given a list of nutrients and a user. There is an optional force parameter that will not take into consideration if the user had previous goals for the nutrients in the list and will recompute and update them. Otherwise the daily nutritional goals a user has will be taken into consideration and won't be updated. If force is not true only the nutrients in the nutrient list that don't have a goal defined for the user will be calculated. If the nutrient list is empty or it isn't passed all nutrient goals will be recalculated if force is true. Otherwise only the ones missing in the user's goals. If force is not passed it will be false by default. The user profile attributes used for macros calculations (Fat, Protein, Carbs, Energy) are sex, height, weight, birth, and lifestyle. Only sex and age are used for the other nutrients. If the user does not have enough information on its profile, global average values are used for each non-provided user profile attribute. The available indicators with their respective units can be found by using the endpoint '/v2/info/nutrients'. The following nutrients do not give an autocalculation. They will appear as null in the response (manual goal can still be set): F20D5, F22D6, FOLAC, FOLFD, CAFFN, ALC.
- [β«π΄π΅ Create a daily goal for a specific nutrient.](https://docs.logmeal.com/reference/post_v2-daily-nutritional-goal.md): Create a daily intake goal for an specific nutritional indicator. The daily nutritional goals a user has will be taken into consideration to generate the intake recommendation (/v2/nutrition/getRecommendedDailyIntake). If a goal for the given nutrient already exists, it will be updated. Note that creating a goal for the daily calorie intake ('ENERC_KCAL') will modify the amount of the recommended main nutrients the user should ingest, but the creation of goals for the main nutrients won't effect the total calories the user should ingest. Be careful when creating goals, make sure the goals match properly the relationship between all the nutritional indicators (e.g. An increment of calorie intake, implies an increment of carbohydrates, fats and protein). A nutritional goal consists on two values that determine the quantity range the users should ingest through their meals. The available indicators with their respective units can be found by using the endpoint '/v2/info/nutrients'. Any custom nutritional indicator defined can also be set as a goal.
- [β«π΄π΅ Retrieves all dishes or products detectable by the image recognition algorithms. β±](https://docs.logmeal.com/reference/get_v2-dataset-dishes-model-version.md): (S) Limited amount of calls per second. This endpoint returns the available list of dish names separated by types ('food', 'drinks', 'ingredients', 'sauces', 'combo' [i.e. combination dish] and 'custom recipes'). Each dish object contains an id, name, portion size, and optional cooking measures.
- [β«π΄π΅ Retrieves all dishes or products detectable by the image recognition algorithms. β±](https://docs.logmeal.com/reference/get_v2-dataset-dishes.md): (S) Limited amount of calls per second. This endpoint returns the available list of dish names separated by types ('food', 'drinks', 'ingredients', 'sauces', 'combo' [i.e. combination dish] and 'custom recipes'). Each dish object contains an id, name, portion size, and optional cooking measures.
- [β«π΄π΅ Retrieve the complete list of available food groups β±](https://docs.logmeal.com/reference/get_v2-dataset-foodgroups.md): (S) Limited amount of calls per second. This endpoint results a list of all the available food groups (also named food families). See /v2/image/recognition endpoints for more information.
- [β«π΄π΅ Retrieve the complete list of ingredients that could appear in the recipes. β±](https://docs.logmeal.com/reference/get_v2-dataset-ingredients.md): (S) Limited amount of calls per second. This endpoint returns a complete list of the ingredients that could appear in our recipes. Take into account that to obtain recipe information from image predictions, you must have access to the Nutritional Information.
- [β«π΄π΅ Get the list of food groups more commonly associated to a manually-specified dish id. β±](https://docs.logmeal.com/reference/post_v2-dataset-foodgroupsfromdish.md): (S) Limited amount of calls per second. Given a dish class_id, this endpoint returns the food groups associated to it. Deprecated name '/foodGroupFromDish'.
- [π΄ Get different Dysphagia measurement options.](https://docs.logmeal.com/reference/get_v2-dysphagia-options.md): This endpoint returns the information and explanation about the Dysphagia measurement options. The options are 'Adhesiveness' and 'Swallowing' followed by its numerical value (on a scale from 1 to 5) specifying the difficulty on the intake, where 1 would be the easiest level on the scale and 5 the hardest one.
- [π΄ Stores Dysphagia measurement values for the given imageId.](https://docs.logmeal.com/reference/post_v2-dysphagia-imageid.md): This endpoint stores information about Dysphagia measurement option values for the given imageId. The measurement types, 'adhesiveness' and 'swallowing', can be passed individually or together via the request's body, but at least one must be included. If the body is passed with an empty JSON, the previously stored measures will be deleted. A measure type can be provided empty or null to delete that specific type.
- [β« Delete an existent APIUserManager from your company.](https://docs.logmeal.com/reference/delete_v2-managers-manager-id.md): This endpoint is used to delete an existent APIUserManager. To delete an APIUserManager you must provide its user ID through the endpoint path. Make sure you obtain the APIUserManager ID properly by using the '/v2/managers' GET endpoint.
- [β« Delete an existent Access Entry from one of your APIUserManagers.](https://docs.logmeal.com/reference/delete_v2-managers-useraccess.md): This endpoint is used to delete an Access Entry from one of your APIUserManagers. An access entry consists in a relationship between an APIUserManager and an APIUser. Deleting the existent entry will revoke the APIUserManager access to the provided APIUser information, as well as the ability to modify some of the information/nutritional goals of the APIUser. To delete an access entry, both the user ID of the APIUserManager and the APIUser are required. Ensure that you are revoking access to the proper users.
- [β«π΅ Get a user's profile information.](https://docs.logmeal.com/reference/get_v2-managers-getuserprofileinfo-userid.md): This endpoint returns the information from the specified APIUser which is accessible by the APIUserManager/company. Read the specification of the response body to see the available fields with their descriptions. This endpoint is the same as '/v2/profile/getUserProfileInfo'.
- [β«π΅ Retrieve all the APIUsers an APIUserManager has access to.](https://docs.logmeal.com/reference/get_v2-managers-useraccess.md): This endpoint provides a list with all the IDs of the APIUsers an APIUserManager has access to.
- [β« Retrieve all the APIUserManager your company has.](https://docs.logmeal.com/reference/get_v2-managers.md): This endpoint provides information about the APIUserManagers your company has created. The response contains the IDs, email, username and token of each APIUserManager returned.
- [β«π΅ Update the profile information for an existent APIUserManager from your company.](https://docs.logmeal.com/reference/patch_v2-managers-manager-id.md): This endpoint is used to edit the profile information of an existent APIUserManager. You must provide its user ID through the endpoint path. Make sure you obtain the APIUserManager ID properly by using the '/v2/managers' GET endpoint.
- [β« Create a new APIUserManager for your company.](https://docs.logmeal.com/reference/post_v2-managers-createapiusermanager.md): DEPRECATED NAME. Use POST /v2/managers instead.
- [π΅ Login validation credentials for APIUserManagers.](https://docs.logmeal.com/reference/post_v2-managers-login.md): This endpoint is used to validate a pair of user and password values assigned to a user of type APIUserManager. After the pair validation is performed the token of the user is returned together with a set of useful profile information. Note that this endpoint does NOT require a token to be called.
- [β«π΅ Modify a user's profile information.](https://docs.logmeal.com/reference/post_v2-managers-modifyuserprofileinfo-userid.md): This endpoint allows you to modify the profile and main attributes of an end-user (APIUser). This information associated to the user can be used for features like improving and customizing the output of the food recognition capabilities, personalizing the nutrition recommendations and nutrition plans, adapting to the user intake patterns, etc. Read the specification of the request body to see the available fields with their descriptions. This endpoint is the same as `/v2/profile/modifyUserProfileInfo` and `/v2/users/modifyUserProfileInfo`. ### π Geographic and Language Personalization We highly recommend including the optional fields `country` and `language` in the request body: - **`country`** (ISO 3166β1 alphaβ2 code, e.g., `US`, `FR`, `JP`): Providing the country allows LogMeal to geographically refine its food recognition capabilities. This enables improved detection accuracy for region-specific dishes and eating patterns, leading to better personalization in nutrition analysis. - **`language`** (e.g., `en`, `es`, `fr`): Setting the preferred language ensures that the names of food items, ingredients, nutrients, and other elements are returned in the specified language, offering a better user experience tailored to each APIUser. Including these parameters increases the contextual accuracy and relevance of all subsequent API responses. ### π₯ Customizing Recommended Food Group Consumption You can also use this endpoint to **customize the recommended daily or weekly food group portions** for a user by passing the `min_max_food_groups` field. This allows setting personalized minimum and/or maximum portion limits per food group, which will be taken into account during dietary analysis and goal calculations. Important constraints: - If you want to indicate that a food group has **no minimum requirement**, use `null` as the `min` value. You must **not** use `0`, since `0` would imply the user is expected to consume exactly 0 portions, which is incorrect for `min`. - If you want to explicitly restrict a user from consuming a food group, set the `max` value to `0`. This means that any intake of that group will be considered a deviation from the goal.
- [β« Create a new Access Entry for one of your APIUserManagers.](https://docs.logmeal.com/reference/post_v2-managers-useraccess.md): This endpoint is used to create a new Access Entry for one of your APIUserManagers. An access entry consists in a relationship between an APIUserManager and an APIUser. Creating this entry will give the APIUserManager access to the provided APIUser information, with the ability to modify some of the information/nutritional goals of the APIUser. To create an access entry, both the user ID of the APIUserManager and the APIUser are required. Ensure that you are giving access to the proper users, as sensitive information of the APIUser might be shared with the APIUserManager.
- [β« Create a new APIUserManager for your company.](https://docs.logmeal.com/reference/post_v2-managers.md): This endpoint is used to create a new APIUserManager. To create a new APIUserManager a username, an email and a password must be provided. Ensure that the passwords you use are securely provided to the physical person that will use the account. Optionally, you may provide a `dni` value. This field is intended for external identity mapping purposes such as GICAR-based login. If provided, the DNI/NIE is normalized and stored pseudo-anonymized using HMAC-SHA256. The plain DNI is never stored nor returned by the API.
- [π΄ Multiple Food Dishes Segmentation β±β Detects every food item on the image, recognises it and then automatically detects the food quantity present in it.](https://docs.logmeal.com/reference/post_v2-image-segmentation-complete-quantity-depth-model-version.md): Β© Consumes your monthly credits. Limited amount of monthly calls, exceeding calls will be charged as extras. (D) Limited amount of daily calls per user. (S) Limited amount of calls per second. It applies the same food segmentation procedure as in /image/segmentation/complete and additionally it automatically calculates the food quantity for each of the detected regions. The only output difference in this endpoint is that an additional attribute named 'serving_size' is provided for each of the elements inside the 'segmentation_results' list. **Geographic Personalization**: we recommend setting the `country` parameter associated to the end-user (APIUser) before applying any food recognition/segmentation call. See any `/modifyUserProfileInfo` endpoint for additional details. Additionally, any endpoint and internal procedure that is based on food quantity uses by default the automatically estimated food quantity (e.g. ingredients definition or nutritional information estimation). Note that the segmentation_results might not be directly applicable to the uploaded image size. The segmentation pixel values are scaled depending on the 'processed_image_size' values provided for each of the images (the images might be sometimes resized depending on the needs of the food recognition algorithms used). In order to compute the food quantity a depth image has to be provided. The depth image must be extracted using the LogMeal Depth SDK, that you will have to integrate into your App accordingly. Two SDKs are available, the [iOS Depth SDK](https://gitlab.com/logmeal/logmeal-depth-sdk-ios) and the [Android Depth SDK](https://gitlab.com/logmeal/logmeal-depth-sdk-android). **IMPORTANT**: Note that this endpoint has two parameters in the request body ('image' and 'depth') which are in the 'multipart/form-data', and the remaining parameters are in 'application/json'. You can check it from the dropdown from the right corner.
- [π΄ Multiple Food Dishes Segmentation β±β Detects every food item on the image, recognises it and then automatically detects the food quantity present in it.](https://docs.logmeal.com/reference/post_v2-image-segmentation-complete-quantity-depth.md): Β© Consumes your monthly credits. Limited amount of monthly calls, exceeding calls will be charged as extras. (D) Limited amount of daily calls per user. (S) Limited amount of calls per second. It applies the same food segmentation procedure as in /image/segmentation/complete and additionally it automatically calculates the food quantity for each of the detected regions. The only output difference in this endpoint is that an additional attribute named 'serving_size' is provided for each of the elements inside the 'segmentation_results' list. **Geographic Personalization**: we recommend setting the `country` parameter associated to the end-user (APIUser) before applying any food recognition/segmentation call. See any `/modifyUserProfileInfo` endpoint for additional details. Additionally, any endpoint and internal procedure that is based on food quantity uses by default the automatically estimated food quantity (e.g. ingredients definition or nutritional information estimation). Note that the segmentation_results might not be directly applicable to the uploaded image size. The segmentation pixel values are scaled depending on the 'processed_image_size' values provided for each of the images (the images might be sometimes resized depending on the needs of the food recognition algorithms used). In order to compute the food quantity a depth image has to be provided. The depth image must be extracted using the LogMeal Depth SDK, that you will have to integrate into your App accordingly. Two SDKs are available, the [iOS Depth SDK](https://gitlab.com/logmeal/logmeal-depth-sdk-ios) and the [Android Depth SDK](https://gitlab.com/logmeal/logmeal-depth-sdk-android). **IMPORTANT**: Note that this endpoint has two parameters in the request body ('image' and 'depth') which are in the 'multipart/form-data', and the remaining parameters are in 'application/json'. You can check it from the dropdown from the right corner.
- [π΄ Multiple Food Dishes Segmentation β± Detects every food item on the image, recognises it and then automatically estimates the food quantity present in it.](https://docs.logmeal.com/reference/post_v2-image-segmentation-complete-quantity-model-version.md): Β© Consumes your monthly credits. Limited amount of monthly calls, exceeding calls will be charged as extras. (D) Limited amount of daily calls per user. (S) Limited amount of calls per second. It applies the same food segmentation procedure as in /image/segmentation/complete and additionally it automatically calculates the food quantity for each of the detected regions. **Geographic Personalization**: we recommend setting the `country` parameter associated to the end-user (APIUser) before applying any food recognition/segmentation call. See any `/modifyUserProfileInfo` endpoint for additional details. **IMPORTANT:** the food quantity procedure runs in background, this means that immediately after this food recognition request finishes, the food quantity will not be calculated yet. If you use any endpoint that retrieves ingredients, nutritional information or any other intake-related data, standard food quantities will be presented. After some seconds, immediately when the quantity estimation ends, all values for all endpoint calls will be automatically updated. You can get a status of the quantity estimation procedure by calling either GET /intake or GET /history/getIntakesList and checking the attribute 'quantity_prediction_status'. Additionally, any endpoint and internal procedure that is based on food quantity uses by default the automatically estimated food quantity (e.g. ingredients definition or nutritional information estimation). Note that the segmentation_results might not be directly applicable to the uploaded image size. The segmentation pixel values are scaled depending on the 'processed_image_size' values provided for each of the images (the images might be sometimes resized depending on the needs of the food recognition algorithms used). In order to compute the food quantity a video sequence has to be provided. The video must be extracted using the LogMeal SDK, that you will have to integrate into your App accordingly. Two SDKs are available, the [iOS SDK](https://gitlab.com/logmeal/logmeal-depth-sdk-ios) and the [Android SDK](https://gitlab.com/logmeal/logmeal-depth-sdk-android). **IMPORTANT**: Note that this endpoint has two parameters in the request body ('image' and 'sequence') which are in the 'multipart/form-data', and the remaining parameters are in 'application/json'. You can check it from the dropdown from the right corner.
- [π΄ Multiple Food Dishes Segmentation β± Detects every food item on the image, recognises it and then automatically estimates the food quantity present in it.](https://docs.logmeal.com/reference/post_v2-image-segmentation-complete-quantity.md): Β© Consumes your monthly credits. Limited amount of monthly calls, exceeding calls will be charged as extras. (D) Limited amount of daily calls per user. (S) Limited amount of calls per second. It applies the same food segmentation procedure as in /image/segmentation/complete and additionally it automatically calculates the food quantity for each of the detected regions. **Geographic Personalization**: we recommend setting the `country` parameter associated to the end-user (APIUser) before applying any food recognition/segmentation call. See any `/modifyUserProfileInfo` endpoint for additional details. **IMPORTANT:** the food quantity procedure runs in background, this means that immediately after this food recognition request finishes, the food quantity will not be calculated yet. If you use any endpoint that retrieves ingredients, nutritional information or any other intake-related data, standard food quantities will be presented. After some seconds, immediately when the quantity estimation ends, all values for all endpoint calls will be automatically updated. You can get a status of the quantity estimation procedure by calling either GET /intake or GET /history/getIntakesList and checking the attribute 'quantity_prediction_status'. Additionally, any endpoint and internal procedure that is based on food quantity uses by default the automatically estimated food quantity (e.g. ingredients definition or nutritional information estimation). Note that the segmentation_results might not be directly applicable to the uploaded image size. The segmentation pixel values are scaled depending on the 'processed_image_size' values provided for each of the images (the images might be sometimes resized depending on the needs of the food recognition algorithms used). In order to compute the food quantity a video sequence has to be provided. The video must be extracted using the LogMeal SDK, that you will have to integrate into your App accordingly. Two SDKs are available, the [iOS SDK](https://gitlab.com/logmeal/logmeal-depth-sdk-ios) and the [Android SDK](https://gitlab.com/logmeal/logmeal-depth-sdk-android). **IMPORTANT**: Note that this endpoint has two parameters in the request body ('image' and 'sequence') which are in the 'multipart/form-data', and the remaining parameters are in 'application/json'. You can check it from the dropdown from the right corner.
- [π΄ Confirm dishes and quantities after applying food waste intake detection.](https://docs.logmeal.com/reference/post_v2-waste-confirm-model-version.md): With this endpoint, the user has the option to confirm which of the recognized leftover dishes are correct and which are the quantities left. By default, the source must be set to 'logmeal' and an ID corresponding to an existent dish is expected. You also have to provide a food item identifier for each of the confirmed dishes. This implies adding the extra parameter 'food_item_position'. This parameter consists of a list of elements, one per each confirmed dish, and it must include an integer identifying the segmented region it corresponds to (see 'food_item_position' in returned json for /waste/detection endpoints).
- [π΄ Confirm dishes and quantities after applying food waste intake detection.](https://docs.logmeal.com/reference/post_v2-waste-confirm.md): With this endpoint, the user has the option to confirm which of the recognized leftover dishes are correct and which are the quantities left. By default, the source must be set to 'logmeal' and an ID corresponding to an existent dish is expected. You also have to provide a food item identifier for each of the confirmed dishes. This implies adding the extra parameter 'food_item_position'. This parameter consists of a list of elements, one per each confirmed dish, and it must include an integer identifying the segmented region it corresponds to (see 'food_item_position' in returned json for /waste/detection endpoints).
- [π΄ Food Waste Intake Detection β±β Detects the leftovers or remaining food on a dish/intake.](https://docs.logmeal.com/reference/post_v2-waste-detection-intake-depth-model-version.md): Β© Consumes your monthly credits. Limited amount of monthly calls, exceeding calls will be charged as extras. (D) Limited amount of daily calls per user. (S) Limited amount of calls per second. This endpoint must be called attached to an already existent food segmentation prediction (Pre-consumption image). It applies the same food segmentation procedure as in /image/segmentation/complete but on an image that contains leftovers. For all the waste food item positions that were estimated to be matched to an item in the preconsumption image, the parameter 'serving_size' will be returned with the estimated food quantity. Optionally, the endpoint allows providing a depth image in the same format as /image/segmentation/complete/quantity to increase the leftovers estimation precision. The depth image must be extracted using the LogMeal Depth SDK, that you will have to integrate into your App accordingly. Two SDKs are available, the [iOS Depth SDK](https://gitlab.com/logmeal/logmeal-depth-sdk-ios) and the [Android Depth SDK](https://gitlab.com/logmeal/logmeal-depth-sdk-android). If a depth image is provided an additional attribute named 'serving_size' is provided for each and every one of the elements inside the 'segmentation_results' list. Note that the segmentation_results might not be directly applicable to the uploaded image size. The segmentation pixel values are scaled depending on the 'processed_image_size' values provided for each of the images (the images might be sometimes resized depending on the needs of the food recognition algorithms used). **IMPORTANT**: Note that this endpoint has two parameters in the request body ('image' and 'depth') which are in the 'multipart/form-data', and the remaining parameters are in 'application/json'. You can check it from the dropdown from the right corner.
- [π΄ Food Waste Intake Detection β±β Detects the leftovers or remaining food on a dish/intake.](https://docs.logmeal.com/reference/post_v2-waste-detection-intake-depth.md): Β© Consumes your monthly credits. Limited amount of monthly calls, exceeding calls will be charged as extras. (D) Limited amount of daily calls per user. (S) Limited amount of calls per second. This endpoint must be called attached to an already existent food segmentation prediction (Pre-consumption image). It applies the same food segmentation procedure as in /image/segmentation/complete but on an image that contains leftovers. For all the waste food item positions that were estimated to be matched to an item in the preconsumption image, the parameter 'serving_size' will be returned with the estimated food quantity. Optionally, the endpoint allows providing a depth image in the same format as /image/segmentation/complete/quantity to increase the leftovers estimation precision. The depth image must be extracted using the LogMeal Depth SDK, that you will have to integrate into your App accordingly. Two SDKs are available, the [iOS Depth SDK](https://gitlab.com/logmeal/logmeal-depth-sdk-ios) and the [Android Depth SDK](https://gitlab.com/logmeal/logmeal-depth-sdk-android). If a depth image is provided an additional attribute named 'serving_size' is provided for each and every one of the elements inside the 'segmentation_results' list. Note that the segmentation_results might not be directly applicable to the uploaded image size. The segmentation pixel values are scaled depending on the 'processed_image_size' values provided for each of the images (the images might be sometimes resized depending on the needs of the food recognition algorithms used). **IMPORTANT**: Note that this endpoint has two parameters in the request body ('image' and 'depth') which are in the 'multipart/form-data', and the remaining parameters are in 'application/json'. You can check it from the dropdown from the right corner.
- [π΄ Food Waste Intake Detection β±β Detects the leftovers or remaining food on a dish/intake.](https://docs.logmeal.com/reference/post_v2-waste-detection-intake-model-version.md): Β© Consumes your monthly credits. Limited amount of monthly calls, exceeding calls will be charged as extras. (D) Limited amount of daily calls per user. (S) Limited amount of calls per second. This endpoint must be called attached to an already existent food segmentation prediction (Pre-consumption image). It applies the same food segmentation procedure as in /image/segmentation/complete but on an image that contains leftovers. Optionally, the endpoint allows providing a video sequence in the same format as /image/segmentation/complete/quantity to increase the leftovers estimation precision. The video sequence must be extracted using the LogMeal SDK, that you will have to integrate into your App accordingly. Two SDKs are available, the [iOS SDK](https://gitlab.com/logmeal/logmeal-depth-sdk-ios) and the [Android SDK](https://gitlab.com/logmeal/logmeal-depth-sdk-android). If a video sequence is provided an additional attribute named 'serving_size' is provided for each and every one of the elements inside the 'segmentation_results' list. Note that the segmentation_results might not be directly applicable to the uploaded image size. The segmentation pixel values are scaled depending on the 'processed_image_size' values provided for each of the images (the images might be sometimes resized depending on the needs of the food recognition algorithms used). **IMPORTANT:** the food quantity procedure runs in background, this means that immediately after this food recognition request finishes, the food quantity will not be calculated yet. If you use any endpoint that retrieves ingredients, nutritional information or any other intake-related data, standard food quantities will be presented. After some seconds, immediately when the quantity estimation ends, all values for all endpoint calls will be automatically updated. You can get a status of the quantity estimation procedure by calling either GET /intake or GET /history/getIntakesList and checking the attribute 'quantity_prediction_status'. **IMPORTANT**: Note that this endpoint has two parameters in the request body ('image' and 'sequence') which are in the 'multipart/form-data', and the remaining parameters are in 'application/json'. You can check it from the dropdown from the right corner.
- [π΄ Food Waste Intake Detection β±β Detects the leftovers or remaining food on a dish/intake.](https://docs.logmeal.com/reference/post_v2-waste-detection-intake.md): Β© Consumes your monthly credits. Limited amount of monthly calls, exceeding calls will be charged as extras. (D) Limited amount of daily calls per user. (S) Limited amount of calls per second. This endpoint must be called attached to an already existent food segmentation prediction (Pre-consumption image). It applies the same food segmentation procedure as in /image/segmentation/complete but on an image that contains leftovers. Optionally, the endpoint allows providing a video sequence in the same format as /image/segmentation/complete/quantity to increase the leftovers estimation precision. The video sequence must be extracted using the LogMeal SDK, that you will have to integrate into your App accordingly. Two SDKs are available, the [iOS SDK](https://gitlab.com/logmeal/logmeal-depth-sdk-ios) and the [Android SDK](https://gitlab.com/logmeal/logmeal-depth-sdk-android). If a video sequence is provided an additional attribute named 'serving_size' is provided for each and every one of the elements inside the 'segmentation_results' list. Note that the segmentation_results might not be directly applicable to the uploaded image size. The segmentation pixel values are scaled depending on the 'processed_image_size' values provided for each of the images (the images might be sometimes resized depending on the needs of the food recognition algorithms used). **IMPORTANT:** the food quantity procedure runs in background, this means that immediately after this food recognition request finishes, the food quantity will not be calculated yet. If you use any endpoint that retrieves ingredients, nutritional information or any other intake-related data, standard food quantities will be presented. After some seconds, immediately when the quantity estimation ends, all values for all endpoint calls will be automatically updated. You can get a status of the quantity estimation procedure by calling either GET /intake or GET /history/getIntakesList and checking the attribute 'quantity_prediction_status'. **IMPORTANT**: Note that this endpoint has two parameters in the request body ('image' and 'sequence') which are in the 'multipart/form-data', and the remaining parameters are in 'application/json'. You can check it from the dropdown from the right corner.
- [π΄ Confirm dish name after applying image recognition.](https://docs.logmeal.com/reference/post_v2-image-confirm-dish-model-version.md): When using our recognition endpoints the most probable classes are returned concerning dish, drinks, sauces or ingredients (depending on the type). With this endpoint, the user has the option to confirm which one of the returned food classes is the correct one. By default, the source is set to 'logmeal' and an ID corresponding to an existent dish is expected. The 'source' can also take the value 'other' for specifying a free-text feedback for any dish that is not included in LogMeal's API. Do note that if you confirm a dish with a free-text feedback (source 'other') it won't be taken into consideration when doing any calculation that is based on the dish (e.g. generating ingredients or nutritional information). If a food segmentation endpoint has been used then you have to provide a food item identifier for each of the confirmed dishes. This implies adding the extra parameter 'food_item_position'. This parameter consists of a list of elements, one per each confirmed dish, and it must include an integer identifying the segmented region it corresponds to (see 'food_item_position' in returned json for /segmentation endpoints). If you desire to confirm a dish that does not belong to any of the detected regions then a string has to be provided that will act as an unique identifier for that extra confirmed dish. **Important notes about dish IDs:** - If the image is a **default API intake**, the dish IDs you can confirm must belong to LogMealβs global dataset. You can check the full list of available dishes in the endpoint `/dataset/dishes`. - If the image is a **kiosk/tray intake**, then the dish IDs must match the dishes actually offered that day and shift in the restaurant. These valid dish IDs can be retrieved from the endpoint `/kiosk/external/dishes`. To know if an image is of type *kiosk*, you can check the endpoints `[GET] /intake` or `/getIntakesList`. If the field `is_kiosk_image` is `true`, then you must use the kiosk dish IDs instead of the global dataset. **Example payload** Suppose an image has already detected dishes with IDs `2284`, `2270`, and `2290`. If you want to confirm those three and also add a new dish with ID `2267`, you need to send *all* the confirmed IDs and their positions, plus the new one: ```json { "imageId": 1982196, "confirmedClass": [ 2284, 2270, 2299, 2267 ], "source": [ "logmeal", "logmeal", "logmeal", "logmeal" ], "food_item_position": [ 1, 2, 3, 4 ] } ``` Each list must include both the existing confirmed dishes and any new ones you are adding.
- [π΄ Confirm dish name after applying image recognition.](https://docs.logmeal.com/reference/post_v2-image-confirm-dish.md): When using our recognition endpoints the most probable classes are returned concerning dish, drinks, sauces or ingredients (depending on the type). With this endpoint, the user has the option to confirm which one of the returned food classes is the correct one. By default, the source is set to 'logmeal' and an ID corresponding to an existent dish is expected. The 'source' can also take the value 'other' for specifying a free-text feedback for any dish that is not included in LogMeal's API. Do note that if you confirm a dish with a free-text feedback (source 'other') it won't be taken into consideration when doing any calculation that is based on the dish (e.g. generating ingredients or nutritional information). If a food segmentation endpoint has been used then you have to provide a food item identifier for each of the confirmed dishes. This implies adding the extra parameter 'food_item_position'. This parameter consists of a list of elements, one per each confirmed dish, and it must include an integer identifying the segmented region it corresponds to (see 'food_item_position' in returned json for /segmentation endpoints). If you desire to confirm a dish that does not belong to any of the detected regions then a string has to be provided that will act as an unique identifier for that extra confirmed dish. **Important notes about dish IDs:** - If the image is a **default API intake**, the dish IDs you can confirm must belong to LogMealβs global dataset. You can check the full list of available dishes in the endpoint `/dataset/dishes`. - If the image is a **kiosk/tray intake**, then the dish IDs must match the dishes actually offered that day and shift in the restaurant. These valid dish IDs can be retrieved from the endpoint `/kiosk/external/dishes`. To know if an image is of type *kiosk*, you can check the endpoints `[GET] /intake` or `/getIntakesList`. If the field `is_kiosk_image` is `true`, then you must use the kiosk dish IDs instead of the global dataset. **Example payload** Suppose an image has already detected dishes with IDs `2284`, `2270`, and `2290`. If you want to confirm those three and also add a new dish with ID `2267`, you need to send *all* the confirmed IDs and their positions, plus the new one: ```json { "imageId": 1982196, "confirmedClass": [ 2284, 2270, 2299, 2267 ], "source": [ "logmeal", "logmeal", "logmeal", "logmeal" ], "food_item_position": [ 1, 2, 3, 4 ] } ``` Each list must include both the existing confirmed dishes and any new ones you are adding.
- [π΄ Confirm food group after applying image recognition.](https://docs.logmeal.com/reference/post_v2-image-confirm-food-group-model-version.md): With this endpoint, the user has the option to confirm which of the predicted food groups in the image are the correct ones. Please see endpoint '/v2/image/segmentation/complete' for more information on food groups predictions. The user can provide a list of food groups for all the dishes present in the image. These food groups must be from the logmeal database. The complete list of available food groups can be obtained by calling the endpoint '/v2/dataset/foodGroups'.
- [π΄ Confirm food group after applying image recognition.](https://docs.logmeal.com/reference/post_v2-image-confirm-food-group.md): With this endpoint, the user has the option to confirm which of the predicted food groups in the image are the correct ones. Please see endpoint '/v2/image/segmentation/complete' for more information on food groups predictions. The user can provide a list of food groups for all the dishes present in the image. These food groups must be from the logmeal database. The complete list of available food groups can be obtained by calling the endpoint '/v2/dataset/foodGroups'.
- [π΄ Food recognition only on a manually-specified food type β±β](https://docs.logmeal.com/reference/post_v2-image-confirm-type-model-version.md): Β© Consumes your monthly credits. Limited amount of monthly calls, exceeding calls will be charged as extras. (D) Limited amount of daily calls per user. (S) Limited amount of calls per second. **Note:** (M) will only take effect if a recognition process is triggered by choosing a food type recognition that was not previously applied on the same image. Depending on the detected food type, specific recognition algorithms are applied. This endpoint allows to correct the provided food type (if wrong) and thus, apply a new food recognition. This correction is intended to be performed by the end user when receiving the result.
- [π΄ Food recognition only on a manually-specified food type β±β](https://docs.logmeal.com/reference/post_v2-image-confirm-type.md): Β© Consumes your monthly credits. Limited amount of monthly calls, exceeding calls will be charged as extras. (D) Limited amount of daily calls per user. (S) Limited amount of calls per second. **Note:** (M) will only take effect if a recognition process is triggered by choosing a food type recognition that was not previously applied on the same image. Depending on the detected food type, specific recognition algorithms are applied. This endpoint allows to correct the provided food type (if wrong) and thus, apply a new food recognition. This correction is intended to be performed by the end user when receiving the result.
- [π΄ Multiple Food Dishes Segmentation β±β Detects every food item on the image and recognises it.](https://docs.logmeal.com/reference/post_v2-image-segmentation-complete-model-version.md): Β© Consumes your monthly credits. Limited amount of monthly calls, exceeding calls will be charged as extras. (D) Limited amount of daily calls per user. (S) Limited amount of calls per second. Given an image, it segments and detects each food item or food region appearing on it. Then the most probable dishes are recognized for each of the regions separately. These dishes come with their names, the corresponding ids and the associated probabilities (confidence). Note that the segmentation_results, which contain the bounding boxes and segments detected, might not be directly applicable to the uploaded image size. The segmentation pixel values are scaled depending on the 'processed_image_size' values provided for each of the images (the images might be sometimes resized depending on the needs of the food recognition algorithms used). **Geographic Personalization**: we recommend setting the `country` parameter associated to the end-user (APIUser) before applying any food recognition/segmentation call. See any `/modifyUserProfileInfo` endpoint for additional details. If you have a LogMeal Recommend plan or higher we recommend using the /segmentation/complete/quantity endpoint, instead. It provides the same information in the current endpoint and furthermore it automatically estimates the food quantity present on the picture.
- [π΄ Multiple Food Dishes Segmentation β±β Detects every food item on the image and recognises it.](https://docs.logmeal.com/reference/post_v2-image-segmentation-complete.md): Β© Consumes your monthly credits. Limited amount of monthly calls, exceeding calls will be charged as extras. (D) Limited amount of daily calls per user. (S) Limited amount of calls per second. Given an image, it segments and detects each food item or food region appearing on it. Then the most probable dishes are recognized for each of the regions separately. These dishes come with their names, the corresponding ids and the associated probabilities (confidence). Note that the segmentation_results, which contain the bounding boxes and segments detected, might not be directly applicable to the uploaded image size. The segmentation pixel values are scaled depending on the 'processed_image_size' values provided for each of the images (the images might be sometimes resized depending on the needs of the food recognition algorithms used). **Geographic Personalization**: we recommend setting the `country` parameter associated to the end-user (APIUser) before applying any food recognition/segmentation call. See any `/modifyUserProfileInfo` endpoint for additional details. If you have a LogMeal Recommend plan or higher we recommend using the /segmentation/complete/quantity endpoint, instead. It provides the same information in the current endpoint and furthermore it automatically estimates the food quantity present on the picture.
- [β«π΄π΅ Returns the available languages to be assigned to APIUsers.](https://docs.logmeal.com/reference/get_v2-info-languages.md): Endpoint that returns a JSON containing the languages that can be associated to each of the APIUsers. By using the language parameters, all image recognition predictions and any other information returned to the APIUser will be translated into that language. Each language will always be identified by a 3 character ISO 639-2/T code, which corresponds to the key of the JSON provided by this endpoint.
- [β« Get information about your current account limitations.](https://docs.logmeal.com/reference/get_v2-info-limitations.md): Summary of limitations: Β© Consumes your monthly credits. Limited amount of monthly calls, exceeding calls will be charged as extras. (D) Limited amount of daily calls per user. (S) Limited amount of calls per second. Use this endpoint to retrieve the current limitations of your LogMeal Plan. Additional usage information is returned in the HTTP response headers. The headers included depend on the type of authenticated user making the request.
Common headers (all authenticated users):
- User-ID: Identifier of the authenticated user.
- X-Account-Credits-Used: Credits consumed in the current billing period.
- X-Account-Credits-Remaining: Remaining credits until the next billing cycle.
APIUSER only:
- RateLimit-Limit: Maximum allowed requests per rolling 24-hour window.
- RateLimit-Remaining: Remaining requests available in the current 24-hour window.
- RateLimit-Reset: Seconds until the rate limit resets.
- [β«π΄π΅ Get information about the available nutritional indicators.](https://docs.logmeal.com/reference/get_v2-info-nutrients.md): This endpoint returns information about the nutritional indicators available in our API. The response contains an object for each nutrient, with the nutritional code as a key. Most of our endpoints that provide responses containing information about nutritional indicators will use this nutritional code as a reference. It will also return custom nutritional indicators. Only if they have been defined.
- [β«π΄π΅ Get list of accessible services (endpoints).](https://docs.logmeal.com/reference/get_v2-info-services.md): Returns the list of services available by the requesting user's APICompany. The services returned depend on the LogMeal Plan the company is subscribed.
- [β«π΄ Get API usage info.](https://docs.logmeal.com/reference/get_v2-info-usages.md): Endpoint that returns a JSON containing the list of requests performed by an APIUser. If no APIUser is specified, then the usage for all available APIUsers will be retrieved instead.
- [π΄ Get a recommendation about the daily macronutrient intake based on the user information. β±](https://docs.logmeal.com/reference/get_v2-nutrition-getrecommendeddailyintake.md): (S) Limited amount of calls per second. Returns a daily intake recommendation for calories and the main macronutrients. The recommendations are based on the user's profile information. If any user profile information is missing, the results will be based on the average worldwide. If the user has nutritional goals created, they will be returned with the recommendation. Check the documentation on '/v2/daily_nutritional_goal' for more information. It also returns two ranges. range and warning_range. range is where the ideal intake is, ok range. warning_range is where there is still room for improvement, fairly ok range. If the nutrient range only has a minimum value, above the minimum, ok range. All the values below the warning_range will be considered bad. If the nutrient range only has a maximum value, under the maximum, ok range. All the values above the warning_range will be considered bad. If the nutrient has minimum and maximum values, between them, ok range. All the values under the lower warning_range and values above the bigger warning_range will be considered bad. If the company has a Monitor or higher plan, they will also get recommendation values for the rest of available nutrients. Just like in /v2/daily_nutritional_goal/autocompute, some nutrients do not give out and automatic calculation. They will be in the response as null. See /v2/daily_nutritional_goal/autocompute's documentation for more information. If the user does not have a 'sex' assigned or has one which is not 'male' nor 'female' an average between these two will be used for all the calculations. Note that the output of this endpoint is based on a personalized but automated recommendation based on the Harris-Benedict formula. A professional dietitian should be consulted by the customer in order to assure it fits the user's needs. Once the recommended values have been computed based on the user profile information they will not be re-adjusted automatically unless you specifically call the endpoint /v2/daily_nutritional_goal/autocompute.
- [π΄π΅ Confirm ingredients and their quantities.](https://docs.logmeal.com/reference/post_v2-nutrition-confirm-ingredients.md): With this endpoint, the user has the option to modify the ingredients list for each food item in the image. Ingredients should be confirmed by ID (ingredientId), a list of valid ingredient IDs can be retrieved by calling /dataset/ingredients). If instead a name is provided (ingredientName), the ingredient will be considered a free-text ingredient that does not exist in the database and thus, no nutritional information will be retrieved for it. The user must make sure to pass either the ingredientId or the ingredientName, but never both. Optionally the amount (weight) can be specified. If the amount of the ingredient isn't provided we'll use the average serving size for that specific ingredient. If confirmed by Name the weight is mandatory since the system does not know what ingredient is it Also, the preferred measurement system and specific measure for each ingredient can be specified with a LogMeal Monitor plan or higher. This endpoint can only be used for images that have a **segmentation** prediction.
- [π΄π΅ Confirms food quantity (serving size) for a specific image id.](https://docs.logmeal.com/reference/post_v2-nutrition-confirm-quantity.md): Given an imageId you can specify the quantity consumed by the user (in grams). After specifying the quantity, the output of the endpoints /nutrition/recipe/ingredients and /nutrition/recipe/nutritionalInfo will be recalculated accordingly.\ If food segmentation was applied to the image, quantities for each food item should be specified in an object structure. The object's key is the identifier for the segment (food_item_position) and the value its new quantity. You can confirm quantity for as many food items as you want in a single call to the endpoint.\ In the case food recognition was applied to the image, quantity can only be specified for all food in the image at once by providing an integer with the total weight of all predicted or confirmed items.\ You can also specify the quantity of sugar, salt and oil consumed by the user. If the user does not use salt in any of their recipes for example, modifying this will be considered when retrieving the nutritional information of the image (requires a LogMeal Plan Measures endpoints).\ **Note**: Sugar modulation is only applied to dishes we consider to often include added sugars.\ Also, the preferred measurement system and specific measure for each food item can be specified with a LogMeal Monitor plan or higher. If none of the optional parameters is provided, no changes will be applied.
- [π΄π΅ Computes the nutritional information of a recipe from a list of ingredients.](https://docs.logmeal.com/reference/post_v2-nutrition-recipe-compute-nutrients.md): This endpoint receives a list of ingredients and automatically computes the overall nutritional information for the recipe based on their combined nutritional values. Each ingredient must be specified with either: - `ingredientId`: the internal ID of the ingredient within the LogMeal system, or - `ingredientName`: a custom ingredient name (used only if the ID is not available) And must include: - `ingredientAmount`: the quantity (in grams) of the ingredient. The system aggregates the nutritional contributions of all ingredients and returns a list of computed nutritional indicators (such as calories, proteins, sugars, etc.), including the indicator code and total quantity.
- [π΄ Identifies the ingredients on the image. β±](https://docs.logmeal.com/reference/post_v2-nutrition-recipe-ingredients-model-version.md): (S) Limited amount of calls per second. Returns the list of most likely ingredients (recipe-like) to be present on the recognized or confirmed food dish (see /confirm/dish). Make sure you first confirm the correct food items with the /confirm/dish endpoint before calling this. Otherwise, the top 1 predictions for each of the detected food item positions will be considered the correct ones and will be returned in this endpoint. All the information provided is scaled to the standard/average portion for a single person. If the endpoint /confirm/quantity has been used, then all ingredient quantities will be rescaled according to the confirm food quantity per item. Note that, in all the cases, the βweightβ attribute associated to each ingredient is specified in grams or milliliters.
- [π΄ Identifies the ingredients on the image. β±](https://docs.logmeal.com/reference/post_v2-nutrition-recipe-ingredients.md): (S) Limited amount of calls per second. Returns the list of most likely ingredients (recipe-like) to be present on the recognized or confirmed food dish (see /confirm/dish). Make sure you first confirm the correct food items with the /confirm/dish endpoint before calling this. Otherwise, the top 1 predictions for each of the detected food item positions will be considered the correct ones and will be returned in this endpoint. All the information provided is scaled to the standard/average portion for a single person. If the endpoint /confirm/quantity has been used, then all ingredient quantities will be rescaled according to the confirm food quantity per item. Note that, in all the cases, the βweightβ attribute associated to each ingredient is specified in grams or milliliters.
- [π΄π΅ Identifies the nutritional information for the dishes on the image. β±](https://docs.logmeal.com/reference/post_v2-nutrition-recipe-nutritionalinfo-model-version.md): (S) Limited amount of calls per second. This endpoint provides all the nutritional information of the provided imageId or class_id. Make sure you first confirm the correct food items with the /confirm/dish endpoint before calling this. Otherwise, the top 1 predictions for each of the detected food item positions will be considered the correct ones and will be returned in this endpoint. If a food segmentation has been applied on the image (see /segmentation endpoints), then an extra attribute named 'nutritional_info_per_item' will be returned in the response. This contains the detailed nutritional information for each of the food segments/regions that have been detected or confirmed on the image. Some extra information related to the daily intake reference is also provided, which serves as a fast and simple way to compare the nutritional information of the intake with what is the global average intake expected from people (note that these are just approximations). The way the 'dailyIntakeReference' levels are generated is the following: - LOW - If the intake represents less than 20% of the daily reference value - MEDIUM - If the intake represents more than 20% and less than 35% of the daily reference value - HIGH - If the intake represents equal or more than 35% of the daily reference value - NONE - If the reference value could not be calculated or the nutritional indicator has the levels disabled. Unless an automated quantity recognition is done on the image or the /confirm/quantity endpoint has been used, all the information provided is scaled to the standard/average portion for a single person. Be aware that not all the entries of this response will contain nutritional information. If the images have not been confirmed or don't have any prediction on a dish level, the nutritional information won't be generated. If the element from the intake list has the flag 'hasNutritionalInfo' set to False, 'nutritional_info' won't be present in the object. Also, confirmed dishes that are not in the 'logmeal' database won't contribute to the nutritional information. They will still be returned in the 'foodNames' field, and will be represented with a null value in the 'ids' field.
- [π΄π΅ Identifies the nutritional information for the dishes on the image. β±](https://docs.logmeal.com/reference/post_v2-nutrition-recipe-nutritionalinfo.md): (S) Limited amount of calls per second. This endpoint provides all the nutritional information of the provided imageId or class_id. Make sure you first confirm the correct food items with the /confirm/dish endpoint before calling this. Otherwise, the top 1 predictions for each of the detected food item positions will be considered the correct ones and will be returned in this endpoint. If a food segmentation has been applied on the image (see /segmentation endpoints), then an extra attribute named 'nutritional_info_per_item' will be returned in the response. This contains the detailed nutritional information for each of the food segments/regions that have been detected or confirmed on the image. Some extra information related to the daily intake reference is also provided, which serves as a fast and simple way to compare the nutritional information of the intake with what is the global average intake expected from people (note that these are just approximations). The way the 'dailyIntakeReference' levels are generated is the following: - LOW - If the intake represents less than 20% of the daily reference value - MEDIUM - If the intake represents more than 20% and less than 35% of the daily reference value - HIGH - If the intake represents equal or more than 35% of the daily reference value - NONE - If the reference value could not be calculated or the nutritional indicator has the levels disabled. Unless an automated quantity recognition is done on the image or the /confirm/quantity endpoint has been used, all the information provided is scaled to the standard/average portion for a single person. Be aware that not all the entries of this response will contain nutritional information. If the images have not been confirmed or don't have any prediction on a dish level, the nutritional information won't be generated. If the element from the intake list has the flag 'hasNutritionalInfo' set to False, 'nutritional_info' won't be present in the object. Also, confirmed dishes that are not in the 'logmeal' database won't contribute to the nutritional information. They will still be returned in the 'foodNames' field, and will be represented with a null value in the 'ids' field.
- [β«π΄π΅ Deletes an uploaded intake.](https://docs.logmeal.com/reference/delete_v2-intake-imageid.md): Given an image id, this endpoint allows to remove its existent upload and all the information related to it (nutritional information).
- [β«π΄π΅ Obtain a daily intake summary. β±](https://docs.logmeal.com/reference/get_v2-history-getdailysummary.md): (S) Limited amount of calls per second. This endpoint provides a daily summary of a user given a date. It also returns a dictionary named `translations` which includes the translations into the user-preferred language for all food groups and subgroups included in the summary. For each day it informs of: - Daily calorie distribution: How many calories were eaten throughout the day by occasions. Grams and % of the total. - Daily energy: For calories, carbs, fat and protein the amount reported and recommended amount. - Daily portions: Recommended daily portions for dairy products, grains and tubers, vegetables, fruit, whole grain and water. For each one it returns a variable whether the goal was achieved, the number of eaten portions and the recommended portion range. It also returns a field called contribution_by_category, where we can see how the total eaten portions and quantity of the food group divide in each category belonging to the food group. The total eaten portions are calculated by adding all the eaten portions of the different categories and then rounding up if >= 0.85 (more than 85% of a portion is considered as one) and down if < 0.85. The image ID's that contain the food group in their prediction are included in the field image_ids. - Portion information: Gives extra information about the quantities used to calculate the portions The response includes `nutrient_report`, an aggregated nutrient report for the selected day. Energy-contributing nutrients include %EC fields calculated against the total daily energy.
- [β«π΄π΅ List all user intakes with their nutritional information and ingredients between two dates. β±](https://docs.logmeal.com/reference/get_v2-history-getintakeslist.md): (S) Limited amount of calls per second. This endpoint provides a history of the user's intakes between two dates based on the content of the images the user has uploaded during that period of time. The response contains a list with information about every single intake uploaded by the user (containing the timestamp, occasion, nutritional information, ingredients list and the URL to the image*), as well as the total intake of the main nutrients obtained from the images (calories, carbohydrates, fat and protein). All elements in the intakes list are sorted from older to newer. If a food segmentation has been applied on one of the images (see /segmentation endpoints), then three extra attributes will be returned in the response. The attribute `nutritional_info_per_item`, which contains the detailed nutritional information for each of the food segments/regions that have been detected or confirmed on the image; `recipe_per_item`, which contains the list of ingredients for each segment/region detected; and `segmentation_data`, which contains the list of food segments/regions that have been detected automatically on the image. Note that the segmentation_data might not be directly applicable to the uploaded image size. The segmentation pixel values are scaled depending on the `processed_image_size` values provided for each of the images (the images might be sometimes resized depending on the needs of the food recognition algorithms used). Energy-contributing nutrients include additional response-only fields: `energy_kcal`, `energy_factor_kcal_per_g`, and `energy_contribution_percentage`. The `energy_contribution_percentage` field corresponds to %EC and is calculated against the calories of the individual intake. Additional Notes for Kiosk Images:
When the field `is_kiosk_image` is True, an additional field named `annotation_data` may be present. This field includes user-corrected bounding boxes (bboxes) for each detected food item, replacing the automatically generated ones provided inside `segmentation_data`. These manually validated coordinates should be considered as the reference for segmentation and nutritional calculations, as they represent verified information with higher accuracy. The presence of `annotation_data` indicates that the image has been manually annotated within the Kiosk environment. Be aware that not all the entries of this response will contain nutritional information and ingredients list. If the images have not been confirmed or don't have any prediction on a dish level, the nutritional information won't be generated. If the element from the intake list has the flag `hasNutritionalInfo` set to False, `nutritional_info` won't be present in the object. Also, confirmed dishes that are not in the 'logmeal' database won't contribute to the nutritional information. They will still be returned in the `foodNames` field, and will be represented with a null value in the `ids` field. If Food Waste Detection services are included in your LogMeal Subscription, an extra field named `food_waste` will be included for each of the intakes or images returned by this endpoint. If there is currently no waste image assigned to a specific intake, then the field `food_waste` will take the value None/null. Otherwise, the full information included for each intake will be also provided for the corresponding food waste image. The `food_waste` contains an additional attribute named `matches_mapping_pre_to_waste`, which provides a mapping between the preconsumption image `food_item_position`s to the waste image original `food_item_position`s predictions provided inside `segmentation_data`. This allows to reference the predicted items positions in the image. If some element is mapped to null means that the food item is not present in the waste image, thus it was completely consumed. Furthermore, also if Food Waste Detection services are included in your LogMeal Subscription, an extra field named `actual_intake` will be included for each of the intakes. This information will be complementary to the `food_waste` previously described and it will specify the actual food intake by subtracting the initially reported image minus the food waste detected. Note: for security purposes, the URLs provided to load the images have an expiration time of 1h since their creation. If they get expired you will have to request a new url.
- [β«π΄π΅ Get the total nutrient intake computed from the images uploaded on a given date (in a span of 24h). β±](https://docs.logmeal.com/reference/get_v2-history-gettotalintakebyday-date.md): (S) Limited amount of calls per second. Returns the sum of the nutrient intakes, obtained from the images uploaded to our API during the timespan of the day provided. This timespan takes into account the user's timezone, so the results will always contain all the information for the given day based on the user's current timezone (UTC by default). Note that the output of this endpoint is based on approximations obtained from the user's images and should always be supervised by an expert.
- [β«π΄π΅ Get the total nutrient intake computed from the images uploaded on a given date (in a span of 24h). β±](https://docs.logmeal.com/reference/get_v2-history-gettotalintakebyday.md): (S) Limited amount of calls per second. Returns the sum of the nutrient intakes, obtained from the images uploaded to our API during the timespan of the day provided. This timespan takes into account the user's timezone, so the results will always contain all the information for the given day based on the user's current timezone (UTC by default). Note that the output of this endpoint is based on approximations obtained from the user's images and should always be supervised by an expert.
- [β«π΄π΅ Obtain a weekly intake summary. β±](https://docs.logmeal.com/reference/get_v2-history-getweeklysummary.md): (S) Limited amount of calls per second. This endpoint provides a weekly summary of a user given a date. Any date can be passed. The information returned will be of the week that day belongs to. It also returns a dictionary named `translations` which includes the translations into the user-preferred language for all food groups and subgroups included in the summary. For every week it informs of: - Day by day summary: Summary of a specific day (very similar to the response of /v2/history/getDailySummary). - Week: Returns the monday and sunday date of the week the passed date belongs to. - Week averages: For every macronutrient and the energy (carbs, fat, protein and calories) the daily average reported along with the recommended value and the achieved percentage. - Weekly occasion distribution: For every reported occasion it returns the total calories reported along with the percentage they represent of the total week calories. - Weekly portions: Recommended weekly portions for legumes, fish, eggs, nuts, meat and red meat. For each one it returns a variable with a color whether the goal was achieved, the number of eaten portions, quantity and the recommended portion range. Transparent color means there is a minium defined but it has not been achieved. Green means the eaten portions matches the recommendation. Red the rest of cases. It also returns a field called contribution_by_category, where we can see how the total eaten portions and quantity of the food group divide in each category belonging to the food group. The total eaten portions are calculated by adding all the eaten portions of the different categories and then rounding up if >= 0.85 (more than 85% of a portion is considered as one) and down if < 0.85. The image ID's that contain the food group in their prediction are included in the field image_ids. - Portion information: Gives extra information about the quantities used to calculate the portions The response includes `nutrient_report`, an aggregated nutrient report for the selected week. Quantities and energy values are daily averages over the reported days. Energy-contributing nutrients include %EC fields calculated against the average daily energy. NOTE: if the user does not consume a minimum amount of calories per day, the intakes information for that date will not be included in the weekly averages computation. The minimum calories value depends on the `sex` of the user: female = 1000kcal, male = 1200kcal, N/A = 1100kcal.
- [β«π΄π΅ Returns the number of intakes a given user has on a date or range of dates](https://docs.logmeal.com/reference/get_v2-history-hasintake.md): This endpoint provides the number of intakes reported for a user on a given date. Provide either the parameter date if only one date is wanted or provide both date_from and date_to if a range is wanted.
- [β«π΄π΅ Retrieves the full intake information (similar to /getIntakesList).](https://docs.logmeal.com/reference/get_v2-intake-imageid.md): Retrieve full information for a specific intake (image_id). It will return the same result as /getIntakesList but for a specific image only. See /getIntakesList description in order to better understand the output of this endpoint. The only change present in this endpoint is that instead of the key `intakes_list` with a list of images' info, the current endpoint returns the key `intake_info`, which contains a single object/dictionary with the intake info.
- [π΄ Scans a barcode and returns its dish id β±β](https://docs.logmeal.com/reference/post_v2-barcode-scan-barcode-id.md): Β© Consumes your monthly credits. Limited amount of monthly calls, exceeding calls will be charged as extras. (S) Limited amount of calls per second. It scans a barcode and returns its dish id without creating any new intake for the user. This is useful for introducing manual intakes or confirming new items into a recognized image that contain barcode products, among others. The database has over 3 million products from 150 different countries and its periodically updated based on new products appearing in the market.
- [π΄ Scans a barcode and creates a new intake for the user β±β](https://docs.logmeal.com/reference/post_v2-intake-barcode-scan-barcode-id.md): Β© Consumes your monthly credits. Limited amount of monthly calls, exceeding calls will be charged as extras. (S) Limited amount of calls per second. It scans a barcode and creates a new intake for the user. The database has over 3 million products from 150 different countries and its periodically updated based on new products appearing in the market.
- [β«π΄π΅ Modify the custom name of an uploaded intake](https://docs.logmeal.com/reference/post_v2-intake-image-id-modify-name.md): Updates the custom name (intake_name) of an existing intake image. Requires specific company service permissions (Modify Intake Name).
- [π΅ Create a manual intake (without image-based prediction) and assign it to a set of specific APIUsers.](https://docs.logmeal.com/reference/post_v2-intake-manualinput-assign.md): **[NOTE] This endpoint is DEPRECATED. We recommend using the endpoint POST /intake/manualInput/bulkAssign instead.** Endpoint callable by APIUserManager only. Creates a manual intake consisting of a consumed dish or a list of consumed food groups, without using an image-based prediction. This is an alternative to the /recognition endpoints. This endpoint can be used to add an intake without the need of an image nor applying the recognition process. The manual intake can be assigned simultaneously to multiple APIUsers. You must provide either the parameter `class_ids` or the parameter `food_group_ids`, but never both.
- [π΅ Create manual intakes in bulk (without image-based prediction).](https://docs.logmeal.com/reference/post_v2-intake-manualinput-bulkassign.md): Used by APIManagers to assign intakes to their APIUsers in bulk.
- [π΄π΅ Create a manual intake (without image-based prediction).](https://docs.logmeal.com/reference/post_v2-intake-manualinput-userid.md): Creates an intake for the specified APIUser without using an image-based prediction. This is an alternative to the recognition endpoints.\ Multiple dishes can be specified in the intake, with only a valid **id** for the dish being necessary (A list of valid classes can be obtained by calling /dataset/dishes).\ Optionally, **quantity**, **levels** and **ingredients** can be specified for each dish in the intake. If provided, these parameters will be applied in the following order: 1. **Ingredients**: Use the given list of ingredients for the dish's recipe instead of using the default recipe for the dish id. 2. **Levels**: Scale the level of salt, sugar and oil in dishes. The weights for ingredients specified in the ingredients field may be altered if you include this parameter. 3. **Quantity:** If provided the ingredients quantities will be scaled proportionally so that they sum up to add the given quantity.
- [π΄ Create a manual intake (without image-based prediction)](https://docs.logmeal.com/reference/post_v2-intake-manualinput.md): **[NOTE] This endpoint is DEPRECATED. We recommend using the endpoint POST /intake/manualInput/{userId} instead.** Endpoint callable by APIUser only. Creates a manual intake consisting of a consumed dish or a list of consumed food groups, without using an image-based prediction. This is an alternative to the /recognition endpoints. This endpoint can be used to add an intake without the need of an image nor applying the recognition process. You must provide either the parameter `class_ids` or the parameter `food_group_ids`, but never both.
- [π΄π΅ Modify the nutritional info of an uploaded intake](https://docs.logmeal.com/reference/post_v2-intake-modifynutritionalinfo.md): Modify the nutritional information indicators of a previously uploaded intake (image). The changes will take place on the /history/getIntakesList endpoint or any other endpoint that retrieves the nutritional information for an image. A different format has to be provided for the submitted nutritional information depending on whether the image has a prediction of type food recognition or of type food segmentation. - In case the image at hand has a **prediction of type segmentation**, then you have to provide the parameter `nutritional_indicators_per_item` containing an object where keys are food item identifiers and values are lists of nutritional codes and values. - In case the image at hand has a **prediction of type recognition**, then you have to provide the parameter `nutritional_indicators` containing a list of nutritional codes and values. Check the provided examples for additional information. Note that if you confirm a new list of dishes for this intake or you apply any ingredient modification, the nutritional information will be re-calculated based on the new list of dishes or ingredients.
- [β«π΄π΅ Modify the occasion of an uploaded intake](https://docs.logmeal.com/reference/post_v2-intake-modifyoccasion.md): Modify the occasion of a previously uploaded intake (image). By default the images have an occasion assigned based on the moment of the request as the timestamp (taking into consideration the user's assigned timezone and if the user belongs to a company, in this case, if the company has defined occasions). This endpoint can be used to group the intakes for each occasion of the day, so it can be taken into account, for example, for displaying purposes.
- [β«π΄π΅ Modify the timestamp of an uploaded intake](https://docs.logmeal.com/reference/post_v2-intake-modifytimestamp.md): Modify the timestamp of a previously uploaded intake (image). By default the images are created with the moment of the request as the timestamp (taking into consideration the user's assigned timezone). This endpoint can be used to move intakes to a moment of your choice, so it can be taken into account properly in the nutritional intake history. When editing the image timestamp using this endpoint its occasion will be updated accordingly (e.g. if changing its timestamp to 12:30pm its occasion will become 'lunch'), **unless the optional parameter `freeze_occasion` is provided**.
If `freeze_occasion` is present in the request, the intake occasion will remain unchanged regardless of the new timestamp.
See more info about occasions in /intake/modifyOccasion. **Important limitation:** This feature cannot be used with images that come from a *kiosk*. The reason is that these images are tied to what was served on a specific day and time. Changing their timestamp would create inconsistencies with the meals available at that moment. To know if an image is of type *kiosk*, you can check the endpoints `/getIntakesList` or `[GET] /intakes`. If the image has the flag `is_kiosk_image = true`, its timestamp cannot be modified.
- [π΄ Get total Nutri-Score for a specific date. β±](https://docs.logmeal.com/reference/get_v2-score-date-meal-nutriscore.md): (S) Limited amount of calls per second. This endpoint returns the information about the Nutri-Score for a provided date based on the APIUser's food intake on that day. This score is the average Nutri-Score of all the images for the given day. For more information about Nutri-Score of images, see endpoint '/v2/score/{imageId}/nutriScore'. For more information about the Nutri-Score [visit this link](https://nutriscore.colruytgroup.com/colruytgroup/en/about-nutri-score) Read the specification of the response body to see the available fields with their descriptions.
- [π΄ Get total Nutri-Score for specific date and occasion. β±](https://docs.logmeal.com/reference/get_v2-score-date-meal-occasion-nutriscore.md): (S) Limited amount of calls per second. This endpoint returns the information about the Nutri-Score for a provided date and occasion based on the APIUser's food intake on that day. This score is the average Nutri-Score of all the images for the given day and occasion. For more information about Nutri-Score of images, see endpoint '/v2/score/{imageId}/nutriScore'. For more information about the Nutri-Score [visit this link](https://nutriscore.colruytgroup.com/colruytgroup/en/about-nutri-score) Read the specification of the response body to see the available fields with their descriptions.
- [π΄ Get Nutri-Score for an image.](https://docs.logmeal.com/reference/get_v2-score-imageid-nutriscore.md): This endpoint returns the total Nutri-Score for an image corresponding to the provided image id. The image id should be for one of the images that the APIUser has already uploaded to the LogMeal API as part of any queries related to food recognition or nutritional information analysis. The score calculation takes into consideration all dishes appearing in the image and gets the average of the Nutri-Scores per 100g of each dish. The range of values for the standardized Nutri-Score is between 0 and 100 with 100 being the best score possible. This is a rescaled and standardized version of the original Nutri-Score where the values are between -15 to 40. Like the original score scale, this rescaled score range can be represented as 5 categories namely A,B,C,D,E. Values Category 0 - 36 E 37 - 52 D 53 - 67 C 68 - 72 B 73 - 100 A The Nutri-Score values provided can be null in case a dish name was confirmed in the endpoint /confirm/dish that does not belong to the logmeal source, thus we do not have nutritional information for it. For more information about the Nutri-Score [visit this link](https://nutriscore.colruytgroup.com/colruytgroup/en/about-nutri-score). Read the specification of the response body to see the available fields with their descriptions.
- [π΄ Get Variety Score for a provided time period and an occasion (optional). β±](https://docs.logmeal.com/reference/get_v2-score-variety.md): (S) Limited amount of calls per second. This endpoint returns the information about the 'Variety Score' for a duration of time and occasion (if provided) based on the APIUser's food intake over that time. The 'Variety Score' is a method of intake analysis for a measurement of how varied a user's diet is. This score considers two main aspects of the user diet. First one is the variety element (e.g. how many different types of food groups the user diet has covered) and the second one is the nutritional scoring of dishes belonging to these food groups. The nutritional scoring is optional and only considered on user requests. The more varied the diet for certain user is, the higher this score will be. If the nutritional scoring is considered, it works as a weighing term for the variety of food groups consumed. The range of the value for the variety score is between 0-100 with 100 being the best score possible. For more information about the Nutri-Score [visit this link](https://nutriscore.colruytgroup.com/colruytgroup/en/about-nutri-score) Our customized 'Variety Score' is also inspired by the 'Dietary Variety Score' that was proposed and clinically tested in this scientific study: Drewnowski A, Renderson SA, Driscoll A, Rolls BJ. The Dietary Variety Score: assessing diet quality in healthy young and older adults. Journal of the American Dietetic Association. 1997 Mar 1;97(3):266-71. Read the specification of the response body to see the available fields with their descriptions.
- [β« Deactivate a specific customer](https://docs.logmeal.com/reference/delete_v2-kiosk-external-customers-external-user-id.md): Deactivates Kiosk identifiers associated with a specific `external_user_id` for the given restaurant.
- [β« Deactivate all customers for a restaurant](https://docs.logmeal.com/reference/delete_v2-kiosk-external-customers.md): Deactivates all Kiosk customers assigned to a specified restaurant. You must specify the `id_restaurant` in the request body.
- [β« Get all customer identifiers for your company](https://docs.logmeal.com/reference/get_v2-kiosk-external-customers.md): Retrieves a list of all current Kiosk customer identifiers grouped by restaurant for your company.
- [β« Get dishes served based on an image ID](https://docs.logmeal.com/reference/get_v2-kiosk-external-dishes.md): Retrieves a list of dishes that were served in a restaurant during a specific shift and date, based on the provided image ID. This endpoint allows users to obtain the dish information associated with a meal image. Each dish entry includes its internal identifier, name, and serving size. The response will return only dishes that were detected or registered in the restaurant's daily menu corresponding to the given image.
- [β« List Kiosk dishes recipes](https://docs.logmeal.com/reference/get_v2-kiosk-external-recipes.md): Returns all dishes of the SMTCompany, along with the nutritional information and ingredients of each one, if available. Optionally, you can specify the language in which you want to obtain the name using a 3-letter ISO code in the optional "language" parameter.
- [β« List Kiosk restaurants](https://docs.logmeal.com/reference/get_v2-kiosk-external-restaurants.md): Returns a list of restaurants linked to your Kiosk company, including their IDs and display names.
- [β« Update a restaurant recipe](https://docs.logmeal.com/reference/patch_v2-kiosk-external-recipe-restaurant-class-id.md): Edit a recipe for a company dish. If the dish doesn't have a recipe, a new one will be created. This endpoint allows you to modify the default dish name (used for display purposes) and add new translations. There are two ways to update a recipe: you can provide a list of ingredients along with the nutritional values. This is the standard method, giving the user complete control over the values. Alternatively, you can provide only the list of ingredients IDs, which will automatically calculate the recipe's nutritional value internally. Any ingredient passed with the "ingredientName" field instead of "ingredientId" will not be taken into account for this calculation. It's important to note that only ingredients with a valid, existing and associated ID will be considered. The origin of ingredient and nutritional data can be specified using `ingredients_source` and `nutrition_source`. These fields are optional and are used to indicate how the data was obtained (e.g. LogMeal database, import, or external provider). You can also assign a sample image to the dish, which will be associated with it for display purposes. The image file must be in JPG or JPEG format.
- [β« Import multiple customers using a TSV file](https://docs.logmeal.com/reference/post_v2-kiosk-external-customers-import.md): Upload a `.tsv` file to bulk import multiple Kiosk customers into your company account. The file must conform to the format defined in this spreadsheet: [Customer Import Format](https://docs.google.com/spreadsheets/d/1AmsD3NNwfGwiwBL63akzTVrtlsxFZOMq4mnDb9EnsjY/edit?gid=2104741353#gid=2104741353)
- [β« Add Kiosk customers for a restaurant](https://docs.logmeal.com/reference/post_v2-kiosk-external-customers.md): Create one or more new Kiosk customers associated with a given restaurant. Anonymous identifiers can be included using `"None"` as the external user key.
- [β« Import Kiosk dishes recipes](https://docs.logmeal.com/reference/post_v2-kiosk-external-recipes-import.md): Upload a ZIP file containing `.xls`, `.xlsx` or `.pdf` files with restaurant recipes. Each file represents a dish and should follow this naming format: `_.` - `id` (optional): External ID of the dish. - If provided, it must match an existing dish and the recipe will be updated. - If missing or invalid, the dish will require manual review. - `name`: Free text for identification purposes. In addition all files must follow the expected format, including: - A valid recipe name - Ingredients and quantities - Nutritional information - Optional sample image --- The system will validate each file individually. If any error is found, the import will fail and detailed feedback will be returned. If any errors that may have occurred are related to obtaining the sample images, the recipes will still be uploaded, returning a warning with a list of the names of those files that have had a conflict. --- **Two-phase import process** The import may be completed in one or two phases: **Phase 1 β Automatic processing** - The system parses all files and attempts to process them automatically. **Possible outcomes:** - All recipes are valid -> recipes are imported directly without further interactions - Issues detected -> a `recipes_review.zip` file is returned **Phase 2 β Manual review (if required)** - The returned ZIP contains files that must be reviewed and completed before re-uploading: - `recipes_review.xlsx` β used to validate each dish: - **Status** β define if the dish already exists (`OK`) or must be created (`NEW`) - **Dish ID** β required when `Status = OK` - **Dish Name** β required for new dishes or to update an existing name - `ingredients_review.xlsx` (optional) β used to map ingredients that could not be automatically recognized: - Assign an existing Ingredient ID or leave it empty to keep it as free text - **Images folder** (if applicable) β contains extracted images associated with each recipe - After completing the required fields, the ZIP must be uploaded again to finalize the import. --- **Important behavior** If an ID for an existing recipe is provided (duplicate ID), that recipe will be overwritten. Make sure the IDs are unique, and if you really want to modify a recipe, make sure the ID belongs to that existing recipe. --- **Full documentation** For detailed instructions, examples, and Excel format: [Visit the Kiosk documentation](https://docs.google.com/document/d/1RBhhAq2ysk5_gwvIlZJZtsPAoD-PI3WgMdf2XlaUEco/edit?tab=t.0#heading=h.x523188zr7p) --- Optional: `custom_sections` can be provided to override default Excel section names or nutrient labels. Only the specified keys are overridden; missing keys fall back to defaults. Supported keys: - header_row - ingredients_start - serving_size - nutrients_start - file_end - calorie_nutrient_code - protein_nutrient_code - carbohydrates_nutrient_code - sugar_nutrient_code - fats_nutrient_code - saturated_fats_nutrient_code - polyunsaturated_fats_nutrient_code - monosaturated_fats_nutrient_code - fiber_nutrient_code - sodium_nutrient_code Example: { "header_row": "RECEPTA", "ingredients_start": "INGREDIENTES" }
- [π΄π΅ Delete a nutritional plan by its ID.](https://docs.logmeal.com/reference/delete_v2-nutritional-plan.md): Permanently deletes a nutritional plan based on its unique ID. This action is irreversible and will remove all data associated with the plan. **NOTE**: If the deleted nutrition plan had an associated measure goal, that goal will also be deleted. Make sure the nutritional plan ID provided corresponds to an existing plan assigned to the user.
- [β«π΄π΅ Get all the available nutritional plans and their required fields.](https://docs.logmeal.com/reference/get_v2-nutritional-plan-info.md): This endpoint provides an informative list of the available nutritional plans along with the required fields for each one. The returned information helps to understand which data is needed to assign a nutritional plan to a client, which is done via the endpoint: `POST /nutritional_plan`. Each plan includes the names and data types that should be included in the creation request, serving as a guide to correctly build that request.
- [π΄π΅ Retrieve all nutritional plans assigned to a user.](https://docs.logmeal.com/reference/get_v2-nutritional-plan-user-id.md): Returns a list of all nutritional plans associated with the specified user. Each plan contains relevant metadata such as the type of plan, whether it's active, initial weight, associated goals, and more. The response allows clients to track the userβs dietary progress over time, identify which plan is currently active, and understand historical changes in their nutritional approach.
- [π΄π΅ Simulates a nutritional plan and returns personalized estimations.](https://docs.logmeal.com/reference/post_v2-nutritional-plan-simulate.md): Simulates a nutritional plan for a user based on their profile data and optional goal parameters. This endpoint returns: - Estimated timeframes to reach a weight goal. - Ideal weight recommendations. - Potential outcomes based on intensity/duration (for muscle gain). Additionally, depending on the parameters provided in the payload, the endpoint may also perform a **nutritional goals simulation**. This simulation calculates the daily caloric and macronutrient targets required to reach the intended outcome, using either the target weight supplied by the user or the weight recommendation generated during the plan simulation, depending on the plan type and the fields provided. --- Requirements - The user profile must contain the following data: - **Weight** - **Height** - **Sex** - **Lifestyle** - If missing, the request will fail with a detailed error and instructions to update the profile using: - `/v2/profile/modifyUserProfileInfo` (π΄ APIUSER) - `/v2/users/modifyUserProfileInfo` (π΅ APIUSERMANAGER) --- **Optional Fields by Plan Type** --- Type: **WEIGHT_LOSS** - Optional Fields: **weight_goal, date** Description: - _No `weight_goal` or `date` provided_: - Returns ideal healthy weight range and estimated timeframe to reach it. - No nutritional simulation will be performed. - _`weight_goal` provided_: - Returns estimated timeframes to reach the target weight. - No nutritional simulation will be performed. - _`date` provided_: - Returns the lowest achievable weight by the given date, based on the maximum healthy caloric deficit. - Nutritional simulation is performed using the weight recommendation generated in the plan simulation. - _Both `weight_goal` and `date` are provided_: - No weight-loss plan simulation will be performed, as we already have both the target date and target weight, which is the purpose of the endpoint. - Nutritional simulation is performed using the target weight provided in the payload. Special Case Handling: - If the user is already at their ideal weight: - The timeframe fields will return today's date. - A `"warning"` field will be included to indicate this situation. - If the user is **below** their ideal weight: - The timeframe fields will return today's date. - A `"warning"` field will explain that weight loss is not necessary. - If the user has **BMI < 18.5**: - The timeframe fields will return today's date. - A `"warning"` field will inform that a weight loss plan is not recommended for underweight individuals. --- Type: **GAIN_MUSCLE** - Optional Fields: **growth_intensity, date** Description: - _No `growth_intensity` or `date`_: - Returns suggested presets for intensity and duration. - No nutritional simulation will be performed. - _Both provided_: - Returns estimated weight goal, maximum weight gain, and BMI alert if unhealthy. - Nutritional simulation is performed using the weight recommendation generated in the plan simulation. - _Only `growth_intensity` or `date` is provided_: - Causes an error because both values are required for internal calculations. --- Type: **BALANCED_DIET** - Optional Fields: None Description: - _This plan doesn't require any parameters as no further calculations or simulations are needed._ - Returns an object containing only the nutritional goals simulation to maintain the user's current weight. ---
- [π΄π΅ Assign a new nutritional plan to a user.](https://docs.logmeal.com/reference/post_v2-nutritional-plan.md): Creates and assigns a new nutritional plan to the specified user. If a nutritional plan already exists for today's date, it will be **deleted and replaced**. If there's an active plan, it will be **deactivated**. --- Requirements - The user profile must contain the following data: - **Weight** - **Height** - **Sex** - **Lifestyle** - If missing, the request will fail with a detailed error and instructions to update the profile using: - `/v2/profile/modifyUserProfileInfo` (π΄ APIUSER) - `/v2/users/modifyUserProfileInfo` (π΅ APIUSERMANAGER) --- **Field Requirements by Plan Type** --- - Type: **BALANCED_DIET** - Required Fields: **type, user_id** Description: No further parameters are required. --- - Type: **GAIN_MUSCLE** - Required Fields: **type, user_id, growth_intensity, date** Description: Requires both the muscle growth intensity and the goal date to be specified. --- - Type: **WEIGHT_LOSS** - Required Fields: **type, user_id, weight_goal, date** Description: Requires a target weight and future date. --- Refer to the __`v2/nutritional_plan/info`__ endpoint to retrieve required fields dynamically based on plan type.
- [π΄ Get dish recommendation for an APIUser. β±β](https://docs.logmeal.com/reference/get_v2-recommend-dish.md): Β© Consumes your monthly credits. Limited amount of monthly calls, exceeding calls will be charged as extras. (S) Limited amount of calls per second. This endpoint returns a list of dish ids as a recommendation after analysing the APIUser's intakes over the last days. The returned dishes belong to the LogMeal database, see endpoint '/v2/dataset/dishes'. The recommendation process first analyses the nutritional information of the APIUser's intakes over the last days and calculates a measurement named 'Variety Score'. For more information about this score, check endpoint '/v2/score/variety'. After this step, a list of food groups is calculated that should optimize this score and finally optimal dishes belonging to these food groups are recommended as the final output. Read the specification of the response body to see the available fields with their descriptions.
- [π΄ Get recipes recommendation for an APIUser. β±β](https://docs.logmeal.com/reference/get_v2-recommend-recipe.md): Β© Consumes your monthly credits. Limited amount of monthly calls, exceeding calls will be charged as extras. (S) Limited amount of calls per second. This endpoint returns a set of recommended recipes for an APIUser based on the intakes reported. The recipes recommended contain all the detailed information for cooking the dish with a similar format of a food recipe book. The recommendation process consists of three main steps: 1. First, it tries to get the suitable dishes that the users should eat to improve the 'Variety Score' of their diet. For more information about this score, check endpoint '/v2/score/variety' (alternatively, a list of preferred dishes can be provided as a parameter to this endpoint). If not provided, the 'v2/recommend/dish' endpoint is used internally to get the recommended dishes. 2. Once the dishes are obtained, a list of pre-stored recipes for these dishes are gathered. 3. In order to improve the personalisation of this recommendation process, a final filtering method is carried out where APIUser's diet preferences and food restrictions are taken into consideration. So for better results, it is advised to add these user attributes to the API via the '/v2/profile/modifyUserProfileInfo' endpoint. Read the specification of the response body to see the available fields with their descriptions.
- [β«π΄π΅ Returns a list of ingredients that can be used as salt, sugar and oil for a dish.](https://docs.logmeal.com/reference/get_v2-dataset-referenceingredients.md): This endpoint returns a complete list of the ingredients that can be used as the user's choice of salt, sugar and oil. When calculating recipe information we'll check if the user has defined any of these reference ingredients and use them instead of any other types of salt, sugar & oil present in the recipe.
- [β«π΄π΅ Returns information about all weight measures used to display dish weights.](https://docs.logmeal.com/reference/get_v2-dataset-weightmeasures-dishes.md): This endpoint returns an object populated with useful information for displaying dish weight measures such as the full length and abbreviated name of each measure, and its conversion rate to grams. The conversion rate is specially important as our API requires all weights to be provided to us in grams. All measures returned will be translated into the user-preferred language. Check endpoint '/profile/modifyUserProfileInfo' for extra details.
- [β«π΄π΅ Returns information about all weight measures used to display ingredient weights.](https://docs.logmeal.com/reference/get_v2-dataset-weightmeasures-ingredients.md): This endpoint returns an object populated with useful information for displaying ingredient weight measures such as the full length and abbreviated name of each measure, and its conversion rate to grams. The conversion rate is specially important as our API requires all weights to be provided to us in grams. All measures returned will be translated into the user-preferred language. Check endpoint '/profile/modifyUserProfileInfo' for extra details.
- [How To Use the LogMeal API Reference](https://docs.logmeal.com/reference/api-reference-how-to-use-logmeal-api.md): This section helps you quickly understand how to authenticate, respect limits, and navigate the available LogMeal API plans.
- [Authentication](https://docs.logmeal.com/reference/authentication.md): Login by verifying the email address used when signing up at logmeal.com in order to automatically get your API keys / tokens available for interacting with the API documentation.
- [Getting Started](https://docs.logmeal.com/reference/getting-started.md): Make your first call to the LogMeal API. Make sure you already signed up at www.logmeal.com/api before proceeding.
- [My Requests](https://docs.logmeal.com/reference/my-requests.md): Set up the welcome page for your API to help users make their first call.
## Recipes
- [Confirm Food Quantity](https://docs.logmeal.com/recipes/confirm-food-quantity.md)
- [Edit Ingredients and Quantities](https://docs.logmeal.com/recipes/edit-ingredients-and-amounts.md)
- [Food Items Confirmation](https://docs.logmeal.com/recipes/food-items-confirmation.md)
- [Image-based Food Recognition](https://docs.logmeal.com/recipes/image-based-food-recognition.md)
- [Manual Dish Search](https://docs.logmeal.com/recipes/manual-dish-search.md)
- [Personalize Food Recognition](https://docs.logmeal.com/recipes/personalize-dish-recognition.md)
- [Retrieve Ingredients & Quantities](https://docs.logmeal.com/recipes/retrieve-ingredients-quantities.md)
- [Retrieve Nutritional Information](https://docs.logmeal.com/recipes/retrieve-nutritional-information.md)