Common Foods Search
The commonFoods query allows users to search for any type of common food. Within the search, food can be filtered by using tags.
Common foods are known as the most intake foods on a daily basis. Among these common foods, we can find apples, cookies, milk, rice, sugar, noodles, etc.
Characteristics
Within the common food search you are able to:
Get the nutritional information for a specific food
Use pagination
How to calculate the nutrient according to a food portion
Common food nutrients are per each 100g. The value can be different depending on the portion of each food. For example, the weight of a small banana can be 20g, while a big banana can weigh 30g. To calculate the nutrients, use the following equation:
Where:
weightis equivalent thegramWeightfield included within theportionsobject
Available Arguments
Argument Name
Type
Description
query
Query
Name or keyword of the food. It is possible to add more than one value. The query is case insensitive.
filter
Object that filters food according to different criteria. Use this object to filter:
Id
externalId
Barcode
Name
Tags
Nutrients
mealTime
Ingredients
first
String
Retrieves the first results from the list.
Available Fields
Field Name
Type
Description
id
ID
Id of the food
description
String
Description of the food
foodDataId
String
Food Id to use in the addFoodLog mutation
name
String
Name of the food
nutrients
Object that retrieves the information of the nutrients of the food. For more information on how to use nutrients, see this example.
Pagination
The commonFood query supports the use of pagination. The following fields can be used
Example
Get the nutritional information of a specific food
Get the list of foods that contain "milk chocolate"
UI/UX example
In the same way, we have code examples, this is an implementation example in which see results of the API execution in the Suggestic App.
Login to the App, tap on the Food Log + option, choose the Candies, Milk chocolate recipe (the same recipe retrieved in the above example) and the nutrition information is displayed along with the different available portions for the given recipe:

Use pagination to get the first results of foods that contain bread
Filter all the common foods that include the "fat-free" tag
Filter all the common foods that include the "fat-free" and "caffeine-free" tags
Get all the common foods that contain Vitamin A and Folic Acid
Last updated
Was this helpful?