Food Log Guide
A general guide on how to do food logging with the Suggestic API
A log or logbook is a record of important information and it's comprised of a series of entries associated with a date and time. In the same way, a food log is a series of log entries that represent the consumption of different types of foods.
It is important to understand that an entry in the food log doesn't represent the food itself but represents an "event" of food being consumed. As such, it must include at least the following elements: date, time, food that was consumed, and the consumed quantity.
To add a new entry in the food log, for all cases, the createMealLog mutation should be used.
Understanding meal types (mealType)
The first step to a successful implementation of food logging with the Suggestic API is understanding the different types of "loggable" objects defined under the concept of a mealType
mealType
Description
RECIPE
A recipe
USDA_MEAL
A meal or food from the USDA database
MENU_ITEM
A restaurant menu item
OWN_RECIPE
A recipe or meal created by the user
OWN_ITEM
An individual food added/created by the user
Since each mealType
is fundamentally different, the logging of each of these items will require a different set of parameters.
Logging Recipes
To log a RECIPE you should use the createMealLog mutation, making sure you use the correct mealType. In this case, the mealType
would be RECIPE.
Please note that you'll be using the quantity
and customServingEquivalent
fields and not the serving
field.
Example
Logging USDA Items
To log a USDA_MEAL you should use the createMealLog mutation, making sure you use the correct mealType.
Please note that you'll be using the serving
field, not the customServingEquivalent
field.
Logging Menu Items
To log a MENU_ITEM you should use the createMealLog mutation, making sure you use the correct mealType.
Logging "Own Recipes"
To log an OWN_RECIPE you should use the createMealLog mutation, making sure you use the correct mealType.
Logging "Own Items"
To log an OWN_ITEM you should use the createMealLog mutation, making sure you use the correct mealType.
Last updated