Technical Docs
  • Introduction
  • Guides
    • Getting Started
    • Attribution Guidelines
    • Core Concepts
      • Adherence Score
      • Programs, Diets, and Rulesets
      • User Profile
      • Datasets
    • Tutorials and Walkthroughs
      • Creating a Meal Plan
      • Food Log Guide
      • Pagination
      • Executing Multiple Mutations
  • Knowledge Base
    • How-to guides
      • How to add desserts to your meal plan
      • How to log your custom recipe
      • How to generate a Meal Plan based on a template
    • Common errors
      • Meal Plan generation
    • FAQs
      • Getting Started on Suggestic
      • API and Authentication
      • Device Compatibility
      • Meal Plan
      • Nutrition
      • Programs
      • Recipes
  • HELPFUL RESOURCES
    • Deprecated Features
    • Glossary
    • Integrations
      • Building a No-code Meal Planning Application
        • Step 1: Creating the Integromat Scenario and Google Forms Connection
        • Step 2: Creating a User, Generating a Meal Plan, and Retrieving It
        • Step 3: Crafting Our PDF and Connecting PDFMonkey
        • Step 4: Sending The Document to Our User
  • Packages and SDKs
    • Node Package (NPM)
  • GraphQL
    • GraphQL Overview
    • Authentication
    • Calling GraphQL
    • GraphQL Playground
  • Changelog
    • 2025
      • March
  • Suggestic API Reference
    • Search
      • Food Log
        • Branded Foods Search
        • Common Foods Search
        • My Branded Food Search
        • My Common Foods Search
        • Food Search
        • Legacy
          • Autocomplete
          • Barcode Search
      • Recipe Search
        • Recipe Search
        • Recipe Search by Name or Ingredients
        • Recipe Search by Ingredients
      • Meal Plan Template Search
      • Profile Search
      • Restaurant Search
        • Restaurant Search by Location
        • Restaurant Search
    • Queries
      • Appointments
        • Upcoming Appointments
        • Past Appointments
        • Appointments Types
      • Assessments
        • Assessment Answers
        • Display Assessments
        • Supplement Recommendations
        • User Assessments
      • Content
        • Content Library
        • Content Categories
        • Content Tags
        • Journey
      • Food Log
        • Frequently Logged
        • Food Log Entries
        • Macros Aggregation
        • Micronutrients Aggregation
        • Macro Goals
        • Recently Logged
        • User's Foods and Recipes
          • User's Recipes
        • Legacy
          • Food Log Entries (Legacy)
          • Own Food Items
          • Own Food Item
          • Own Food Item by Id
          • Own Items
          • Own Recipe
          • Own Recipes
      • Lab Tests
        • Biomarker Categories
        • Biomarker Units
        • Biomarker Catalog
        • Biomarkers
        • Biomarker Results
        • Historical Biomarker Results
        • Historical Results by Biomarker
        • Lab Test Reports
        • Recommended Supplements
        • Recommended Articles
      • Meal Plan
        • Meal Plan
        • Custom Meal Plan
        • Simplified Meal Tracking
          • Meal Tracker
        • Meal Plan Config
        • Meal Planner (deprecated)
      • Program
        • All Programs
        • Program Details
      • Recipes
        • Equivalent Recipes (Macros)
        • Equivalent Recipes (Calories)
        • Recipe by Id
        • Recipes By MealTime
        • Recipes By Tag
        • Recipe Swap Options
        • Popular Recipes
        • Favorite Recipes
        • Premium Program Recipes
      • Restaurants
        • Restaurant By Id
        • Menu Items
        • Menu Item By Id
        • Menu Item by Program
        • Recommend Menu Items
      • Restrictions
        • Restrictions
        • Restriction by ID
      • Shopping List
        • Shopping List by Aisle
        • Shopping List by Recipes
      • Subscriptions
        • Subscription List
      • Supplement Plans
        • Supplement plan list
        • Supplement list
      • Tracking
        • Activity and Exercise
        • Checklists
          • Intake Checklist
        • Daily Recap
          • Get Daily Recap
          • Get Daily Recaps
          • Get Daily Recap Questions
          • Get Daily Mood Summary
        • Inisghts
        • Wellness Score
        • Sleep
          • Sleep Time
          • Sleep Quality Score
        • Steps
        • Water and Hydration
        • Heart Rate
        • HRV
        • Weight Tracker
      • USDA Food
      • Users
        • Users
        • User Profile
      • WGPT
        • Assistants
        • Journey
        • Guardrails
    • Mutations
      • Appointments
        • Update Appointment Credits
      • Assessments
        • New User Assessments
        • Set User Answers
      • Content
        • Mark Content as Read
      • Feedback
      • Food Log
        • Log Entries
          • Food Log
            • Add a Food Log Entry
            • Delete a Food Log Entry
          • Meal Log (Legacy)
            • Create Log Entry
            • Update Log Entry
            • Remove Log Entry
        • User's Foods and Recipes
          • Create a User Recipe
          • Create my Branded Food
          • Create my Common Foods
          • Update a User Recipe
          • Delete a User Recipe
          • Legacy: "Own" Recipe
            • Create "Own" Recipe
            • Update "Own" Recipe
            • Remove "Own" Recipe
        • AI Food Log
          • Process Ai Food
        • Legacy (ownFoods and ownRecipes)
          • Create "own" Food Item
          • Update "own Food"
          • Remove "own" Food Item
      • Journey Status
        • Start Journeys
        • Journey Status
        • Toggle Task Completed
      • Lab Tests
        • Add Biomarker
        • Update Biomarker
        • Add Biomarker Result
        • Add Biomarker Category
        • Update Biomarker Category
        • Remove Biomarker Category
        • Add Lab Test Report
        • Delete Lab Test Report
        • Update Lab Test Report
        • Create Recommended Supplement
        • Update Recommended Supplement
        • Remove Recommended Supplement
        • Create Recommended Article
        • Update Recommended Article
        • Remove Recommended Supplement
      • Meal Plan
        • Create Meal Plan Template
          • Custom Options
          • From Days
          • From Scratch
        • Assign a Meal Plan Template to a User
        • Generate Simple Meal Plan
        • Generate Meal Plan
        • Start Over Meal Plan
        • Swap Meals
        • Simplified Meal Tracking
          • Create a Meal Tracker Entry
        • Remove Meal Plan
        • Remove Meal Plan Recipe
      • Recipes
        • Add new recipe
        • Add Favorite Recipe
      • Shopping List
        • Add Multiple Recipes to the Shopping List
        • Add a Recipe to the Shopping List
        • Bulk Check/Uncheck Items
        • Check/Uncheck an Item
        • Clear Checked Items
        • Clear Shopping List
        • Remove Recipe
        • Update Serving Number
      • Subscriptions
        • Update Subscription
      • Supplement Plans
        • Create supplement plan for user
        • Update user supplement plan
        • Add Supplement
        • Update Supplement
      • Tracking
        • Activity and Exercise
          • Add Exercise Entry
          • Delete Exercise Entry
        • Checklists
          • Create my Checklist Item
          • Delete my Checklist Item
        • Daily Recap
          • Create a daily recap question
          • Select Daily Recap Questions
          • Delete a Daily Recap Question
        • Sleep
          • Add Sleep Time
          • Add Sleep Quality Score
        • Steps
          • Add Steps Count
          • Delete Steps Count
        • Heart Rate
          • Add Heart Rate
          • Delete Heart Rate
        • HRV
          • Add HRV
          • Delete HRV
        • Water and Hydration
        • Weight
          • Add Weight Entry
          • Remove Weight Entry
        • User Tracker Goals
          • Create User Goal
          • Update User Goal
          • Remove User Goal
      • Users
        • Authenticate using a Magic Link
        • Create User
        • Custom Attributes
        • Delete a User Account
        • Login User
        • Merge User Accounts
        • Request Reset Password
        • Reset Password
        • Request Password Reset email
        • Sensitive Profile Attributes
        • Update Profile
        • Update User's Program
        • User's Restrictions
        • Update Meal Plan Settings
        • User's Goals
        • Legacy User Mutations
          • Legacy | User's Biomarkers
          • User's Meal Plan Settings (deprecated)
      • WGPT
        • Add user to journey
  • Objects
    • Appointments
      • Appointment
      • Appointment Type
      • Appointment Credit
      • Attendee
      • Coach
    • Common
      • User
      • Adherence
      • Aisle Name
      • CPC
      • CPCIngredientGroup
      • Meal Times
      • Menu Item
      • Own Serving
      • Own Nutrients
      • MacroNutrientsRangeInput
      • Range
      • Tracker
      • Restaurant
    • Food Logs
      • Food Filter
      • Ingredient Amount
      • Ingredients
      • Own Recipe Ingredient
      • Meal Type
      • Nutrients
        • Nutrient Enum
      • Portions
      • Servings
      • AI Food Log
        • Food Analysis
    • Meal Plan
      • Debug Meal Plan Conditions
      • Meal
      • Meal Plan Day
      • Maximum Time per Meal
      • Maximum Ingredient Count
      • Meal Plan Template
      • Simple Meal Plan Filters
    • Recipe
      • Recipe
        • Tags
        • Cuisines
      • Recipe Swap Options
      • Parsed Ingredient Lines
      • Nutritional Info
      • Nutrients Per Serving
      • Calories Per Serving
      • Relative Calories
      • Source
      • Ingredients
      • Units of Measurement
    • Lab Tests
      • Article
      • Biomarker
    • Supplement
    • Assessments
      • Question
      • Answer
    • Content
      • Content Library
      • Content Categories
      • Content Tag
    • WGPT
      • Journey
      • dayJourney
      • Interaction
  • Case Studies
    • Reverse Health Case Study
Powered by GitBook
On this page
  • Characteristics
  • How to calculate the nutrient according to a food portion
  • Available Arguments
  • Available Fields
  • Pagination
  • Example
  • Get the nutritional information of a specific food
  • Get the list of foods that contain "milk chocolate"
  • 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

Was this helpful?

  1. Suggestic API Reference
  2. Search
  3. Food Log

Common Foods Search

PreviousBranded Foods SearchNextMy Branded Food Search

Last updated 2 years ago

Was this helpful?

The commonFoods query allows users to search for any type of common food. Within the search, food can be filtered by using .

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 for a specific food

  • Use

  • Filter the information to retrieve the following results

    • Name

    • Barcode

    • Meal time

    • Ingredients

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:

nutrientvalue∗weight/100nutrient value *weight/100nutrientvalue∗weight/100

Where:

Available Arguments

Define at least one argument within the query.

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

after

String

before

String

first

String

Retrieves the first results from the list.

last

String

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

portions

Object that retrieves the information of the food portions

tags

String

Pagination

 pageInfo{
      hasNextPage
      hasPreviousPage
      startCursor
      endCursor
    }

Example

Get the nutritional information of a specific food

{
  commonFoods(
    filter: {
      id: "Q29tbW9uRm9vZE5vZGU6N2QyYTY0NDUtN2MwZi00ZTYxLTlkNjctYTA4ZWI2NDhlNTY3"
    }
  ) {
    edges {
      node {
        id
        name
        description
        nutrients {
          type
          amount
          name
          unit
        }
        portions {
          amount
          gramWeight
          modifier
        }
      }
    }
  }
}
{
  "data": {
    "commonFoods": {
      "edges": [
        {
          "node": {
            "id": "Q29tbW9uRm9vZE5vZGU6N2QyYTY0NDUtN2MwZi00ZTYxLTlkNjctYTA4ZWI2NDhlNTY3",
            "name": "Milk crackers",
            "description": "Crackers, milk",
            "nutrients": [
              {
                "type": "VITAMIN_A_IU",
                "amount": 58,
                "name": "Vitamin A, IU",
                "unit": "IU"
              },
              {
                "type": "VITAMIN_K_PHYLLOQUINONE",
                "amount": 3.8,
                "name": "Vitamin K (phylloquinone)",
                "unit": "UG"
              },
              {
                "type": "CHOLINE_TOTAL",
                "amount": 10.8,
                "name": "Choline, total",
                "unit": "MG"
              },
              {
                "type": "FOLIC_ACID",
                "amount": 70,
                "name": "Folic acid",
                "unit": "UG"
              },
              {
                "type": "FOLATE_DFE",
                "amount": 139,
                "name": "Folate, DFE",
                "unit": "UG"
              },
              {
                "type": "FOLATE_FOOD",
                "amount": 20,
                "name": "Folate, food",
                "unit": "UG"
              },
              {
                "type": "SODIUM_NA",
                "amount": 687,
                "name": "Sodium, Na",
                "unit": "MG"
              },
              {
                "type": "TRYPTOPHAN",
                "amount": 0.1,
                "name": "Tryptophan",
                "unit": "G"
              },
              {
                "type": "THREONINE",
                "amount": 0.221,
                "name": "Threonine",
                "unit": "G"
              },
              {
                "type": "METHIONINE",
                "amount": 0.138,
                "name": "Methionine",
                "unit": "G"
              },
              {
                "type": "PHENYLALANINE",
                "amount": 0.376,
                "name": "Phenylalanine",
                "unit": "G"
              },
              {
                "type": "TYROSINE",
                "amount": 0.237,
                "name": "Tyrosine",
                "unit": "G"
              },
              {
                "type": "ALANINE",
                "amount": 0.246,
                "name": "Alanine",
                "unit": "G"
              },
              {
                "type": "GLUTAMIC_ACID",
                "amount": 2.482,
                "name": "Glutamic acid",
                "unit": "G"
              },
              {
                "type": "GLYCINE",
                "amount": 0.264,
                "name": "Glycine",
                "unit": "G"
              },
              {
                "type": "PROLINE",
                "amount": 0.858,
                "name": "Proline",
                "unit": "G"
              },
              {
                "type": "THIAMIN",
                "amount": 0.538,
                "name": "Thiamin",
                "unit": "MG"
              },
              {
                "type": "RIBOFLAVIN",
                "amount": 0.418,
                "name": "Riboflavin",
                "unit": "MG"
              },
              {
                "type": "DHA",
                "amount": 0.001,
                "name": "22:6 n-3 (DHA)",
                "unit": "G"
              },
              {
                "type": "PROTEIN",
                "amount": 7.6,
                "name": "Protein",
                "unit": "G"
              },
              {
                "type": "ASH",
                "amount": 2.2,
                "name": "Ash",
                "unit": "G"
              },
              {
                "type": "COPPER_CU",
                "amount": 0.227,
                "name": "Copper, Cu",
                "unit": "MG"
              },
              {
                "type": "MANGANESE_MN",
                "amount": 0.552,
                "name": "Manganese, Mn",
                "unit": "MG"
              },
              {
                "type": "IRON_FE",
                "amount": 3.58,
                "name": "Iron, Fe",
                "unit": "MG"
              },
              {
                "type": "MAGNESIUM",
                "amount": 22,
                "name": "Magnesium, Mg",
                "unit": "MG"
              },
              {
                "type": "PHOSPHORUS_P",
                "amount": 303,
                "name": "Phosphorus, P",
                "unit": "MG"
              },
              {
                "type": "WATER",
                "amount": 4.7,
                "name": "Water",
                "unit": "G"
              },
              {
                "type": "CALCIUM_CA",
                "amount": 172,
                "name": "Calcium, Ca",
                "unit": "MG"
              },
              {
                "type": "POTASSIUM_K",
                "amount": 114,
                "name": "Potassium, K",
                "unit": "MG"
              },
              {
                "type": "ZINC_ZN",
                "amount": 0.67,
                "name": "Zinc, Zn",
                "unit": "MG"
              },
              {
                "type": "ISOLEUCINE",
                "amount": 0.289,
                "name": "Isoleucine",
                "unit": "G"
              },
              {
                "type": "LEUCINE",
                "amount": 0.541,
                "name": "Leucine",
                "unit": "G"
              },
              {
                "type": "LYSINE",
                "amount": 0.241,
                "name": "Lysine",
                "unit": "G"
              },
              {
                "type": "CYSTINE",
                "amount": 0.159,
                "name": "Cystine",
                "unit": "G"
              },
              {
                "type": "VALINE",
                "amount": 0.333,
                "name": "Valine",
                "unit": "G"
              },
              {
                "type": "ARGININE",
                "amount": 0.307,
                "name": "Arginine",
                "unit": "G"
              },
              {
                "type": "HISTIDINE",
                "amount": 0.167,
                "name": "Histidine",
                "unit": "G"
              },
              {
                "type": "ASPARTIC_ACID",
                "amount": 0.345,
                "name": "Aspartic acid",
                "unit": "G"
              },
              {
                "type": "SERINE",
                "amount": 0.399,
                "name": "Serine",
                "unit": "G"
              },
              {
                "type": "NIACIN",
                "amount": 4.43,
                "name": "Niacin",
                "unit": "MG"
              },
              {
                "type": "FIBER_TOTAL_DIETARY",
                "amount": 3.4,
                "name": "Fiber, total dietary",
                "unit": "G"
              },
              {
                "type": "FATTY_ACIDS_TOTAL_SATURATED",
                "amount": 2.912,
                "name": "Fatty acids, total saturated",
                "unit": "G"
              },
              {
                "type": "FAT",
                "amount": 13.77,
                "name": "Total lipid (fat)",
                "unit": "G"
              },
              {
                "type": "CARBS",
                "amount": 71.73,
                "name": "Carbohydrate, by difference",
                "unit": "G"
              },
              {
                "type": "ENERGY",
                "amount": 446,
                "name": "Energy",
                "unit": "KCAL"
              },
              {
                "type": "SUGARS_TOTAL_INCLUDING_NLEA",
                "amount": 10.32,
                "name": "Sugars, total including NLEA",
                "unit": "G"
              },
              {
                "type": "FATTY_ACIDS_TOTAL_MONOUNSATURATED",
                "amount": 5.485,
                "name": "Fatty acids, total monounsaturated",
                "unit": "G"
              },
              {
                "type": "FATTY_ACIDS_TOTAL_POLYUNSATURATED",
                "amount": 4.867,
                "name": "Fatty acids, total polyunsaturated",
                "unit": "G"
              },
              {
                "type": "VITAMIN_B_12_ADDED",
                "amount": 0,
                "name": "Vitamin B-12, added",
                "unit": "UG"
              },
              {
                "type": "VITAMIN_E_ADDED",
                "amount": 0,
                "name": "Vitamin E, added",
                "unit": "MG"
              },
              {
                "type": "CHOLESTEROL",
                "amount": 11,
                "name": "Cholesterol",
                "unit": "MG"
              },
              {
                "type": "VITAMIN_C_TOTAL_ASCORBIC_ACID",
                "amount": 0.2,
                "name": "Vitamin C, total ascorbic acid",
                "unit": "MG"
              },
              {
                "type": "EPA",
                "amount": 0.001,
                "name": "20:5 n-3 (EPA)",
                "unit": "G"
              },
              {
                "type": "VITAMIN_B_12",
                "amount": 0.08,
                "name": "Vitamin B-12",
                "unit": "UG"
              },
              {
                "type": "PANTOTHENIC_ACID",
                "amount": 0.407,
                "name": "Pantothenic acid",
                "unit": "MG"
              },
              {
                "type": "VITAMIN_B_6",
                "amount": 0.037,
                "name": "Vitamin B-6",
                "unit": "MG"
              },
              {
                "type": "VITAMIN_D_D2_D3",
                "amount": 0,
                "name": "Vitamin D (D2 + D3)",
                "unit": "UG"
              },
              {
                "type": "SELENIUM_SE",
                "amount": 15.9,
                "name": "Selenium, Se",
                "unit": "UG"
              }
            ],
            "portions": [
              {
                "amount": 1,
                "gramWeight": 11,
                "modifier": "cracker",
                "unit": "undetermined"
              },
              {
                "amount": 0.5,
                "gramWeight": 14.2,
                "modifier": "oz",
                "unit": "undetermined"
              }
            ]
          }
        }
      ]
    }
  }
}

Get the list of foods that contain "milk chocolate"

{
  commonFoods(query: "milk chocolate", first: 1) {
    edges {
      node {
        id
        name
        portions {
          modifier
          amount
          gramWeight
        }
        nutrients {
          type
          amount
          name
          unit
        }
      }
    }
  }
}
{
  "data": {
    "commonFoods": {
      "edges": [
        {
          "node": {
            "id": "Q29tbW9uRm9vZE5vZGU6MWFkZjRlMmYtYjQxZi00YmNmLTg2M2MtNjcwYTAyYzMxY2Zi",
            "name": "Milk chocolate candies",
            "portions": [
              {
                "modifier": "cup chips",
                "amount": 1,
                "gramWeight": 168
              },
              {
                "modifier": "bar (1.55 oz)",
                "amount": 1,
                "gramWeight": 44
              },
              {
                "modifier": "bar, miniature",
                "amount": 1,
                "gramWeight": 7
              }
            ],
            "nutrients": [
              {
                "type": "FATTY_ACIDS_TOTAL_SATURATED",
                "amount": 18.509,
                "name": "Fatty acids, total saturated",
                "unit": "G"
              },
              {
                "type": "DHA",
                "amount": 0,
                "name": "22:6 n-3 (DHA)",
                "unit": "G"
              },
              {
                "type": "EPA",
                "amount": 0,
                "name": "20:5 n-3 (EPA)",
                "unit": "G"
              },
              {
                "type": "DPA",
                "amount": 0,
                "name": "22:5 n-3 (DPA)",
                "unit": "G"
              },
              {
                "type": "WATER",
                "amount": 1.5,
                "name": "Water",
                "unit": "G"
              },
              {
                "type": "FATTY_ACIDS_TOTAL_MONOUNSATURATED",
                "amount": 7.186,
                "name": "Fatty acids, total monounsaturated",
                "unit": "G"
              },
              {
                "type": "FATTY_ACIDS_TOTAL_POLYUNSATURATED",
                "amount": 1.376,
                "name": "Fatty acids, total polyunsaturated",
                "unit": "G"
              },
              {
                "type": "STIGMASTEROL",
                "amount": 16,
                "name": "Stigmasterol",
                "unit": "MG"
              },
              {
                "type": "BETA_SITOSTEROL",
                "amount": 37,
                "name": "Beta-sitosterol",
                "unit": "MG"
              },
              {
                "type": "CAFFEINE",
                "amount": 20,
                "name": "Caffeine",
                "unit": "MG"
              },
              {
                "type": "THEOBROMINE",
                "amount": 205,
                "name": "Theobromine",
                "unit": "MG"
              },
              {
                "type": "FAT",
                "amount": 29.66,
                "name": "Total lipid (fat)",
                "unit": "G"
              },
              {
                "type": "CALCIUM_CA",
                "amount": 189,
                "name": "Calcium, Ca",
                "unit": "MG"
              },
              {
                "type": "POTASSIUM_K",
                "amount": 372,
                "name": "Potassium, K",
                "unit": "MG"
              },
              {
                "type": "SELENIUM_SE",
                "amount": 4.5,
                "name": "Selenium, Se",
                "unit": "UG"
              },
              {
                "type": "NIACIN",
                "amount": 0.386,
                "name": "Niacin",
                "unit": "MG"
              },
              {
                "type": "PANTOTHENIC_ACID",
                "amount": 0.472,
                "name": "Pantothenic acid",
                "unit": "MG"
              },
              {
                "type": "VITAMIN_B_6",
                "amount": 0.036,
                "name": "Vitamin B-6",
                "unit": "MG"
              },
              {
                "type": "CAMPESTEROL",
                "amount": 6,
                "name": "Campesterol",
                "unit": "MG"
              },
              {
                "type": "FIBER_TOTAL_DIETARY",
                "amount": 3.4,
                "name": "Fiber, total dietary",
                "unit": "G"
              },
              {
                "type": "IRON_FE",
                "amount": 2.35,
                "name": "Iron, Fe",
                "unit": "MG"
              },
              {
                "type": "MAGNESIUM",
                "amount": 63,
                "name": "Magnesium, Mg",
                "unit": "MG"
              },
              {
                "type": "PHOSPHORUS_P",
                "amount": 208,
                "name": "Phosphorus, P",
                "unit": "MG"
              },
              {
                "type": "SODIUM_NA",
                "amount": 79,
                "name": "Sodium, Na",
                "unit": "MG"
              },
              {
                "type": "COPPER_CU",
                "amount": 0.491,
                "name": "Copper, Cu",
                "unit": "MG"
              },
              {
                "type": "MANGANESE_MN",
                "amount": 0.471,
                "name": "Manganese, Mn",
                "unit": "MG"
              },
              {
                "type": "PROTEIN",
                "amount": 7.65,
                "name": "Protein",
                "unit": "G"
              },
              {
                "type": "ASH",
                "amount": 1.78,
                "name": "Ash",
                "unit": "G"
              },
              {
                "type": "CRYPTOXANTHIN_BETA",
                "amount": 0,
                "name": "Cryptoxanthin, beta",
                "unit": "UG"
              },
              {
                "type": "LYCOPENE",
                "amount": 0,
                "name": "Lycopene",
                "unit": "UG"
              },
              {
                "type": "VITAMIN_C_TOTAL_ASCORBIC_ACID",
                "amount": 0,
                "name": "Vitamin C, total ascorbic acid",
                "unit": "MG"
              },
              {
                "type": "THIAMIN",
                "amount": 0.112,
                "name": "Thiamin",
                "unit": "MG"
              },
              {
                "type": "RIBOFLAVIN",
                "amount": 0.298,
                "name": "Riboflavin",
                "unit": "MG"
              },
              {
                "type": "FOLATE_TOTAL",
                "amount": 12,
                "name": "Folate, total",
                "unit": "UG"
              },
              {
                "type": "VITAMIN_K_DIHYDROPHYLLOQUINONE",
                "amount": 0,
                "name": "Vitamin K (Dihydrophylloquinone)",
                "unit": "UG"
              },
              {
                "type": "VITAMIN_K_PHYLLOQUINONE",
                "amount": 5.7,
                "name": "Vitamin K (phylloquinone)",
                "unit": "UG"
              },
              {
                "type": "CAROTENE_BETA",
                "amount": 0,
                "name": "Carotene, beta",
                "unit": "UG"
              },
              {
                "type": "CAROTENE_ALPHA",
                "amount": 0,
                "name": "Carotene, alpha",
                "unit": "UG"
              },
              {
                "type": "CHOLESTEROL",
                "amount": 23,
                "name": "Cholesterol",
                "unit": "MG"
              },
              {
                "type": "VITAMIN_D_D2_D3_INTERNATIONAL_UNITS",
                "amount": 0,
                "name": "Vitamin D (D2 + D3), International Units",
                "unit": "IU"
              },
              {
                "type": "FLUORIDE_F",
                "amount": 5,
                "name": "Fluoride, F",
                "unit": "UG"
              },
              {
                "type": "SUGARS_TOTAL_INCLUDING_NLEA",
                "amount": 51.5,
                "name": "Sugars, total including NLEA",
                "unit": "G"
              },
              {
                "type": "FOLATE_DFE",
                "amount": 11,
                "name": "Folate, DFE",
                "unit": "UG"
              },
              {
                "type": "VITAMIN_A_IU",
                "amount": 195,
                "name": "Vitamin A, IU",
                "unit": "IU"
              },
              {
                "type": "VITAMIN_A_RAE",
                "amount": 59,
                "name": "Vitamin A, RAE",
                "unit": "UG"
              },
              {
                "type": "VITAMIN_D_D2_D3",
                "amount": 0,
                "name": "Vitamin D (D2 + D3)",
                "unit": "UG"
              },
              {
                "type": "BETAINE",
                "amount": 2.6,
                "name": "Betaine",
                "unit": "MG"
              },
              {
                "type": "VITAMIN_E_ADDED",
                "amount": 0,
                "name": "Vitamin E, added",
                "unit": "MG"
              },
              {
                "type": "VITAMIN_E_ALPHA_TOCOPHEROL",
                "amount": 0.51,
                "name": "Vitamin E (alpha-tocopherol)",
                "unit": "MG"
              },
              {
                "type": "ZINC_ZN",
                "amount": 2.3,
                "name": "Zinc, Zn",
                "unit": "MG"
              },
              {
                "type": "CARBS",
                "amount": 59.4,
                "name": "Carbohydrate, by difference",
                "unit": "G"
              },
              {
                "type": "ENERGY",
                "amount": 535,
                "name": "Energy",
                "unit": "KCAL"
              },
              {
                "type": "LUTEIN_ZEAXANTHIN",
                "amount": 6,
                "name": "Lutein + zeaxanthin",
                "unit": "UG"
              },
              {
                "type": "TOCOPHEROL_BETA",
                "amount": 0,
                "name": "Tocopherol, beta",
                "unit": "MG"
              },
              {
                "type": "TOCOPHEROL_GAMMA",
                "amount": 0.92,
                "name": "Tocopherol, gamma",
                "unit": "MG"
              },
              {
                "type": "CHOLINE_TOTAL",
                "amount": 46.1,
                "name": "Choline, total",
                "unit": "MG"
              },
              {
                "type": "FOLIC_ACID",
                "amount": 0,
                "name": "Folic acid",
                "unit": "UG"
              },
              {
                "type": "FOLATE_FOOD",
                "amount": 11,
                "name": "Folate, food",
                "unit": "UG"
              },
              {
                "type": "VITAMIN_B_12_ADDED",
                "amount": 0,
                "name": "Vitamin B-12, added",
                "unit": "UG"
              },
              {
                "type": "VITAMIN_B_12",
                "amount": 0.75,
                "name": "Vitamin B-12",
                "unit": "UG"
              },
              {
                "type": "ALCOHOL_ETHYL",
                "amount": 0,
                "name": "Alcohol, ethyl",
                "unit": "G"
              },
              {
                "type": "RETINOL",
                "amount": 59,
                "name": "Retinol",
                "unit": "UG"
              }
            ]
          }
        }
      ]
    }
  }
}

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

{
  commonFoods(query: "bread", first: 2) {
    edges {
      node {
        id
        name
        description
        portions {
          amount
          modifier
          gramWeight
        }
        nutrients {
          id
          amount
          name
          unit
        }
      }
       }
     pageInfo{
      hasNextPage
      hasPreviousPage
      startCursor
      endCursor
    }
    }
    
  }
{
  "data": {
    "brandedFoods": {
      "edges": [
        {
          "node": {
            "id": "QnJhbmRlZEZvb2ROb2RlOjM1MDcyNw==",
            "name": "Nabisco oreo cookies oreo 1x10.700 oz",
            "gtinUpc": "00044000042554",
            "brandOwner": "Mondelez Int. US (0074819091009)",
            "servingSize": 29,
            "servingSizeUnit": "g",
            "nutrients": [
              {
                "id": 1162,
                "amount": 0,
                "name": "Vitamin C, total ascorbic acid",
                "unit": "MG"
              },
              {
                "id": 1004,
                "amount": 20.69,
                "name": "Total lipid (fat)",
                "unit": "G"
              },
              {
                "id": 1005,
                "amount": 72.41,
                "name": "Carbohydrate, by difference",
                "unit": "G"
              },
              {
                "id": 2000,
                "amount": 44.83,
                "name": "Sugars, total including NLEA",
                "unit": "G"
              },
              {
                "id": 1087,
                "amount": 40,
                "name": "Calcium, Ca",
                "unit": "MG"
              },
              {
                "id": 1089,
                "amount": 3.48,
                "name": "Iron, Fe",
                "unit": "MG"
              },
              {
                "id": 1092,
                "amount": 138,
                "name": "Potassium, K",
                "unit": "MG"
              },
              {
                "id": 1093,
                "amount": 345,
                "name": "Sodium, Na",
                "unit": "MG"
              },
              {
                "id": 1253,
                "amount": 0,
                "name": "Cholesterol",
                "unit": "MG"
              },
              {
                "id": 1257,
                "amount": 0,
                "name": "Fatty acids, total trans",
                "unit": "G"
              },
              {
                "id": 1258,
                "amount": 6.9,
                "name": "Fatty acids, total saturated",
                "unit": "G"
              },
              {
                "id": 1003,
                "amount": 3.45,
                "name": "Protein",
                "unit": "G"
              },
              {
                "id": 1079,
                "amount": 3.4,
                "name": "Fiber, total dietary",
                "unit": "G"
              }
            ]
          }
        },
        {
          "node": {
            "id": "QnJhbmRlZEZvb2ROb2RlOjM1MTUwOA==",
            "name": "Nabisco oreo cookies oreo 1x45.000 oz",
            "gtinUpc": "00044000013103",
            "brandOwner": "Mondelez Int. US (0074819091009)",
            "servingSize": 42,
            "servingSizeUnit": "g",
            "nutrients": [
              {
                "id": 1162,
                "amount": 0,
                "name": "Vitamin C, total ascorbic acid",
                "unit": "MG"
              },
              {
                "id": 1003,
                "amount": 4.76,
                "name": "Protein",
                "unit": "G"
              },
              {
                "id": 1004,
                "amount": 19.05,
                "name": "Total lipid (fat)",
                "unit": "G"
              },
              {
                "id": 1005,
                "amount": 71.43,
                "name": "Carbohydrate, by difference",
                "unit": "G"
              },
              {
                "id": 2000,
                "amount": 40.48,
                "name": "Sugars, total including NLEA",
                "unit": "G"
              },
              {
                "id": 1087,
                "amount": 44,
                "name": "Calcium, Ca",
                "unit": "MG"
              },
              {
                "id": 1089,
                "amount": 5.19,
                "name": "Iron, Fe",
                "unit": "MG"
              },
              {
                "id": 1092,
                "amount": 155,
                "name": "Potassium, K",
                "unit": "MG"
              },
              {
                "id": 1093,
                "amount": 405,
                "name": "Sodium, Na",
                "unit": "MG"
              },
              {
                "id": 1253,
                "amount": 0,
                "name": "Cholesterol",
                "unit": "MG"
              },
              {
                "id": 1257,
                "amount": 0,
                "name": "Fatty acids, total trans",
                "unit": "G"
              },
              {
                "id": 1258,
                "amount": 4.76,
                "name": "Fatty acids, total saturated",
                "unit": "G"
              },
              {
                "id": 1079,
                "amount": 2.4,
                "name": "Fiber, total dietary",
                "unit": "G"
              }
            ]
          }
        }
      ],
      "pageInfo": {
        "hasNextPage": true,
        "hasPreviousPage": false,
        "startCursor": "YXJyYXljb25uZWN0aW9uOjE=",
        "endCursor": "YXJyYXljb25uZWN0aW9uOjI="
      }
    }
  }
}

Filter all the common foods that include the "fat-free" tag

{
  commonFoods(
  filter: {
      tags: ["fat-free"]
    }
  ) {
    count
    edges {
      node {
        id
        name
        description
        tags

      }
    }
  }
}
{
  "data": {
    "commonFoods": {
      "count": 1,
      "edges": [
        {
          "node": {
            "id": "Q29tbW9uRm9vZE5vZGU6MTczNDQ0",
            "name": "Fat free sour cream",
            "description": "Sour cream, fat free",
            "tags": [
              "fat-free"
            ]
          }
        }
      ]
    }
  }
}

Filter all the common foods that include the "fat-free" and "caffeine-free" tags

{
  commonFoods(
      filter: {
      tags: ["fat-free", "caffeine-free"]
    }
  ) {
    count
    edges {
      node {
        id
        name
        description
        tags

      }
    }
  }
}
{
  "data": {
    "commonFoods": {
      "count": 2,
      "edges": [
        {
          "node": {
            "id": "Q29tbW9uRm9vZE5vZGU6MTc0ODI2",
            "name": "Caffeine free cola zevia beverages",
            "description": "Beverages, ZEVIA, cola, caffeine free",
            "tags": [
              "caffeine-free"
            ]
          }
        },
        {
          "node": {
            "id": "Q29tbW9uRm9vZE5vZGU6MTczNDQ0",
            "name": "Fat free sour cream",
            "description": "Sour cream, fat free",
            "tags": [
              "fat-free"
            ]
          }
        }
      ]
    }
  }
}

Get all the common foods that contain Vitamin A and Folic Acid

{
  commonFoods(filter: {
      nutrients: [
        {nutrient:VITAMIN_A_RAE range: {lte: 100}}
        {nutrient:FOLIC_ACID range: {gte: 10}}
      ]
    }
  )
    {
    count
    edges {
      node {
        id
        name
        description
        foodDataId
      }
    }
  }
}
{
  "data": {
    "commonFoods": {
      "count": 679,
      "edges": [
        {
          "node": {
            "id": "Q29tbW9uRm9vZE5vZGU6MTcyNjk0",
            "name": "Commercially prepared angelfood cake",
            "description": "Cake, angelfood, commercially prepared",
            "foodDataId": "172694"
          }
        },
        {
          "node": {
            "id": "Q29tbW9uRm9vZE5vZGU6MTczMTM2",
            "name": "All flavors snickers marathon energy bar mars snackfood us formulated bar",
            "description": "Formulated bar, MARS SNACKFOOD US, SNICKERS MARATHON Energy Bar, all flavors",
            "foodDataId": "173136"
          }
        },
        {
          "node": {
            "id": "Q29tbW9uRm9vZE5vZGU6MTcxNjcz",
            "name": "With salt cooked with water enriched quick regular yellow corn grits cereals",
            "description": "Cereals, corn grits, yellow, regular, quick, enriched, cooked with water, with salt",
            "foodDataId": "171673"
          }
        },
        {
          "node": {
            "id": "Q29tbW9uRm9vZE5vZGU6MTcxOTU3",
            "name": "Breaded and fried cooked atlantic croaker fish",
            "description": "Fish, croaker, Atlantic, cooked, breaded and fried",
            "foodDataId": "171957"
          }
        },
        {
          "node": {
            "id": "Q29tbW9uRm9vZE5vZGU6MTcyMzg2",
            "name": "Batter fried cooked meat and skin thigh broilers or fryers chicken",
            "description": "Chicken, broilers or fryers, thigh, meat and skin, cooked, fried, batter",
            "foodDataId": "172386"
          }
        },
        {
          "node": {
            "id": "Q29tbW9uRm9vZE5vZGU6MTcxMTcx",
            "name": "Powder dry mushroom gravy",
            "description": "Gravy, mushroom, dry, powder",
            "foodDataId": "171171"
          }
        },
        {
          "node": {
            "id": "Q29tbW9uRm9vZE5vZGU6MTcyMjI4",
            "name": "Flavors other than chocolate with nuts chocolate covered ice cream cone",
            "description": "Ice cream cone, chocolate covered, with nuts, flavors other than chocolate",
            "foodDataId": "172228"
          }
        },
        {
          "node": {
            "id": "Q29tbW9uRm9vZE5vZGU6MTY4OTYw",
            "name": "Unprepared frozen cheese lasagna",
            "description": "Lasagna, cheese, frozen, unprepared",
            "foodDataId": "168960"
          }
        },
        {
          "node": {
            "id": "Q29tbW9uRm9vZE5vZGU6MTc0OTM5",
            "name": "Commercially prepared fruitcake cake",
            "description": "Cake, fruitcake, commercially prepared",
            "foodDataId": "174939"
          }
        },
        {
          "node": {
            "id": "Q29tbW9uRm9vZE5vZGU6MTcyNzE2",
            "name": "Enriched higher fat regular commercially prepared chocolate chip cookies",
            "description": "Cookies, chocolate chip, commercially prepared, regular, higher fat, enriched",
            "foodDataId": "172716"
          }
        },
        {
          "node": {
            "id": "Q29tbW9uRm9vZE5vZGU6MTcxMjkz",
            "name": "Chocolate soft serve light ice cream",
            "description": "Ice cream, light, soft serve, chocolate",
            "foodDataId": "171293"
          }
        },
        {
          "node": {
            "id": "Q29tbW9uRm9vZE5vZGU6MTcyODA5",
            "name": "Toasted (includes gluten) protein bread",
            "description": "Bread, protein, (includes gluten), toasted",
            "foodDataId": "172809"
          }
        },
        {
          "node": {
            "id": "Q29tbW9uRm9vZE5vZGU6MTcyNzA5",
            "name": "Prepared from recipe without frosting white cake",
            "description": "Cake, white, prepared from recipe without frosting",
            "foodDataId": "172709"
          }
        },
        {
          "node": {
            "id": "Q29tbW9uRm9vZE5vZGU6MTcwMjk0",
            "name": "Large patty; plain cheeseburger; single fast foods",
            "description": "Fast foods, cheeseburger; single, large patty; plain",
            "foodDataId": "170294"
          }
        },
        {
          "node": {
            "id": "Q29tbW9uRm9vZE5vZGU6MTczMTQ5",
            "name": "Oats and chocolate chewy high fiber formulated bar",
            "description": "Formulated bar, high fiber, chewy, oats and chocolate",
            "foodDataId": "173149"
          }
        },
        {
          "node": {
            "id": "Q29tbW9uRm9vZE5vZGU6MTcxODQy",
            "name": "With creme filling oatmeal sandwich cookies",
            "description": "Cookies, oatmeal sandwich, with creme filling",
            "foodDataId": "171842"
          }
        },
        {
          "node": {
            "id": "Q29tbW9uRm9vZE5vZGU6MTc0MTQ3",
            "name": "Cran cherry ocean spray beverages",
            "description": "Beverages, OCEAN SPRAY, Cran Cherry",
            "foodDataId": "174147"
          }
        }
      ]
    }
  }
}

weight is equivalent the gramWeightfield included within the object

See

See

See

Object that retrieves the information of the nutrients of the food. For more information on how to use nutrients, see .

Displays the available

The commonFood query supports the use of . The following fields can be used

portions
pagination
tags
pagination
Tags
Nutrients
nutritional information
FoodFilter
pagination
pagination
pagination
nutrients
this example
portions
tags