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
  • Available Arguments
  • Available Fields
  • Pagination
  • Examples
  • GraphQL Examples
  • curl Example
  • GraphQL Example
  • GraphQL Example with nutrients and all food data types

Was this helpful?

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

Food Log Entries

The foodLogs query retrieves a comprehensive list of food log entries for the authenticated user within a specified date range. This query allows access to data for all food categories.

Available Arguments

Argument

Type

Required?

Description

Start

Date

True

Starting filter date range, format YYYY-mm-dd

End

Date

True

Ending filter date range, format YYYY-mm-dd

Id

String

False

ID of the logged food. Add this parameter to get the specific information of a logged food.

Available Fields

Field

Type

Note

name

String

Name of the logged item

date

Date

Date of the log entry

mealType

MealType

Type of meal that was logged. RECIPE, MENU_ITEM

servings

Object that contains predefined serving types and sizes

serving

Float

quantity

Float

Quantity of logged servings

servingWeight

Float

Weight in grams of each serving

food

Food

union Food = BrandedFoodNodeProxy, CommonFoodNodeProxy, MealProxy, MyBrandedFoodProxy, MyCommonFoodProxy, RecipeProxy, UserRecipeProxy.

Pagination

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

cursor
    }
     pageInfo {
      endCursor
      hasNextPage
    }

Examples

GraphQL Examples

Get the meals logged on specific dates

The following example retrieves the meals logged between to given dates:

{
  foodLogs(start: "2021-09-01", end: "2021-10-05"){
   edges {
      node
         {
        foodId
        portionModifier
        date
        grams
        mealTime
      }
    }
   }
}
{
  "data": {
    "foodLogs": {
      "edges": [
        {
          "node": {
            "foodId": "QnJhbmRlZEZvb2ROb2RlOjQ3OTk0MQ==",
            "portionModifier": null,
            "date": "2021-10-01",
            "grams": 2,
            "mealTime": "DINNER"
          }
        },
        {
          "node": {
            "foodId": "QnJhbmRlZEZvb2ROb2RlOjQ3OTk0MQ==",
            "portionModifier": null,
            "date": "2021-10-01",
            "grams": 2,
            "mealTime": "DINNER"
          }
        },
        {
          "node": {
            "foodId": "QnJhbmRlZEZvb2ROb2RlOjQ3OTk0MQ==",
            "portionModifier": null,
            "date": "2021-10-01",
            "grams": 2,
            "mealTime": "DINNER"
          }
        },
        {
          "node": {
            "foodId": "Q29tbW9uRm9vZE5vZGU6MTczNDQ0",
            "portionModifier": null,
            "date": "2021-10-02",
            "grams": 2,
            "mealTime": "DINNER"
          }
        },
        {
          "node": {
            "foodId": "QnJhbmRlZEZvb2ROb2RlOjQ3OTk0MQ==",
            "portionModifier": null,
            "date": "2021-10-02",
            "grams": 2,
            "mealTime": "DINNER"
          }
        }
      ]
    }
  }
}

curl Example

curl -XPOST 'https://production.suggestic.com/graphql' \
  -H 'Authorization: Bearer <User-JWT>' \
  -H 'Content-Type: application/json' \
--data-raw '{"query": "{foodLogs(start:\"2021-09-01\", end:\"2021-10-05\"){edges{ node { id date mealTime foodId grams servings}} }}"}'

GraphQL Example

query($first: Int, $start: Date! $end: Date!) {
  foodLogs(first: $first, start: $start, end: $end){
     edges {
       cursor 
         node {
            id 
            date 
            mealTime 
            foodId 
            grams 
            servings
            time 
            portionModifier
           }
          }
        pageInfo {
          hasNextPage
         hasPreviousPage 
         startCursor
         endCursor
            }
        }
    }
{
  "data": {
    "foodLogs": {
      "edges": [
        {
          "node": {
            "foodId": "Q29tbW9uRm9vZE5vZGU6MTczNDQ0",
            "portionModifier": null,
            "date": "2021-09-02",
            "grams": 2,
            "mealTime": "DINNER"
          }
        },
        {
          "node": {
            "foodId": "QnJhbmRlZEZvb2ROb2RlOjQ3OTk0MQ==",
            "portionModifier": null,
            "date": "2021-10-01",
            "grams": 2,
            "mealTime": "DINNER"
          }
        },
        {
          "node": {
            "foodId": "QnJhbmRlZEZvb2ROb2RlOjQ3OTk0MQ==",
            "portionModifier": null,
            "date": "2021-10-01",
            "grams": 2,
            "mealTime": "DINNER"
          }
        },
        {
          "node": {
            "foodId": "QnJhbmRlZEZvb2ROb2RlOjQ3OTk0MQ==",
            "portionModifier": null,
            "date": "2021-10-01",
            "grams": 2,
            "mealTime": "DINNER"
          }
        },
        {
          "node": {
            "foodId": "Q29tbW9uRm9vZE5vZGU6MTczNDQ0",
            "portionModifier": null,
            "date": "2021-10-02",
            "grams": 2,
            "mealTime": "DINNER"
          }
        },
        {
          "node": {
            "foodId": "QnJhbmRlZEZvb2ROb2RlOjQ3OTk0MQ==",
            "portionModifier": null,
            "date": "2021-10-02",
            "grams": 2,
            "mealTime": "DINNER"
          }
        }
      ]
    }
  }
}

GraphQL Example with nutrients and all food data types

query($start: Date! $end: Date!) {
  foodLogs(start: $start, end: $end){
     edges {
       cursor 
         node {
            id 
            date 
            mealTime 
            foodId
            grams 
            servings
            time
            portionModifier
            food {
					... on BrandedFoodNodeProxy {
						brandedFood {
							brandName
							brandOwner
							dataType
							description
							foodDataId
							householdServingFulltext
							name
							nutrients {
							  amount
							  name
							  type
							  unit
							}
							servingSize
							servingSizeUnit
						}
					}
					... on CommonFoodNodeProxy {
						commonFood {
							dataType
							description
							foodDataId
							name
							nutrients {
								amount
								name
								type
								unit
							}
							portions {
								amount
								gramWeight
								modifier
								seqNum
							}
						}
					}
					... on MealProxy {
						meal {
							id
							meal
							numOfServings
							recipe {
								id
								databaseId
								name
								numberOfServings
								nutritionalInfo {
									calcium
									calories
									carbs
									cholesterol
									fat
									fiber
									iron
									potassium
									protein
									saturatedFat
									sodium
									sugar
									transFat
									vitaminD
								}
								serving
								servingWeight
							}
						}
					}
					... on MyBrandedFoodProxy {
						myBrandedFood {
							brandName
							brandOwner
							dataType
							description
							foodDataId
							householdServingFulltext
							name
							nutrients {
							  amount
							  name
							  type
							  unit
							}
							servingSize
							servingSizeUnit
						}
					}
					... on RecipeProxy {
						recipe {
							databaseId
							name
							numberOfServings
							nutritionalInfo {
								calcium
								calories
								carbs
								cholesterol
								fat
								fiber
								iron
								potassium
								protein
								saturatedFat
								sodium
								sugar
								transFat
								vitaminD
							}
							serving
							servings {
							  amount
							  description
							  equivalent
							  unit
							}
							servingWeight
						}
					}
					... on UserRecipeProxy {
						userRecipe {
							name
							nutrientsPerServing {
								amount
								name
								type
								unit
							}
							servingWeight
							text
						}
					}
				}
           }
          }
        pageInfo {
          hasNextPage
         hasPreviousPage 
         startCursor
         endCursor
            }
        }
    }
{
  "data": {
    "foodLogs": {
      "edges": [
        {
          "cursor": "T2Zmc2V0OjE=",
          "node": {
            "id": "Rm9vZExvZzo5ODEwMQ==",
            "date": "2023-01-12",
            "mealTime": "DINNER",
            "foodId": "QnJhbmRlZEZvb2ROb2RlOjFhMDFlMzI5LTc3ZjQtNDgzYy1hNzg4LTZkOTNlYWE1MjMzMQ==",
            "grams": 100,
            "servings": 2,
            "time": null,
            "portionModifier": "halfs",
            "food": {
              "brandedFood": {
                "brandName": null,
                "brandOwner": "OREOS",
                "dataType": "branded_food",
                "description": "OREOS, CHOCOLATE COVERED",
                "foodDataId": "504036",
                "householdServingFulltext": "1 PIECE",
                "name": "Chocolate covered oreos",
                "nutrients": [
                  {
                    "amount": 0,
                    "name": "Calcium, Ca",
                    "type": "CALCIUM_CA",
                    "unit": "MG"
                  },
                  {
                    "amount": 6.43,
                    "name": "Iron, Fe",
                    "type": "IRON_FE",
                    "unit": "MG"
                  },
                  {
                    "amount": 0,
                    "name": "Vitamin A, IU",
                    "type": "VITAMIN_A_IU",
                    "unit": "IU"
                  },
                  {
                    "amount": 0,
                    "name": "Vitamin C, total ascorbic acid",
                    "type": "VITAMIN_C_TOTAL_ASCORBIC_ACID",
                    "unit": "MG"
                  },
                  {
                    "amount": 0,
                    "name": "Cholesterol",
                    "type": "CHOLESTEROL",
                    "unit": "MG"
                  },
                  {
                    "amount": 0,
                    "name": "Protein",
                    "type": "PROTEIN",
                    "unit": "G"
                  },
                  {
                    "amount": 25,
                    "name": "Total lipid (fat)",
                    "type": "FAT",
                    "unit": "G"
                  },
                  {
                    "amount": 71.43,
                    "name": "Carbohydrate, by difference",
                    "type": "CARBS",
                    "unit": "G"
                  },
                  {
                    "amount": 500,
                    "name": "Energy",
                    "type": "ENERGY",
                    "unit": "KCAL"
                  },
                  {
                    "amount": 53.57,
                    "name": "Sugars, total including NLEA",
                    "type": "SUGARS_TOTAL_INCLUDING_NLEA",
                    "unit": "G"
                  },
                  {
                    "amount": 3.6,
                    "name": "Fiber, total dietary",
                    "type": "FIBER_TOTAL_DIETARY",
                    "unit": "G"
                  },
                  {
                    "amount": 232,
                    "name": "Sodium, Na",
                    "type": "SODIUM_NA",
                    "unit": "MG"
                  },
                  {
                    "amount": 0,
                    "name": "Fatty acids, total trans",
                    "type": "FATTY_ACIDS_TOTAL_TRANS",
                    "unit": "G"
                  },
                  {
                    "amount": 12.5,
                    "name": "Fatty acids, total saturated",
                    "type": "FATTY_ACIDS_TOTAL_SATURATED",
                    "unit": "G"
                  }
                ],
                "servingSize": 28,
                "servingSizeUnit": "g"
              }
            }
          }
        }
      ],
      "pageInfo": {
        "hasNextPage": false,
        "hasPreviousPage": false,
        "startCursor": "T2Zmc2V0OjA=",
        "endCursor": "T2Zmc2V0OjE="
      }
    }
  }
}
PreviousFrequently LoggedNextMacros Aggregation

Last updated 1 year ago

Was this helpful?

[]

Index of the element that was logged

Refer to the documentation for more information.

pagination
servings
servings