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 Fields
  • Example
  • Example with total Macros
  • About Dates
  • Normal Flow
  • Other Considerations

Was this helpful?

  1. Suggestic API Reference
  2. Queries
  3. Meal Plan

Meal Plan

Returns a 7-day meal plan based on the user's profile.

PreviousMeal PlanNextCustom Meal Plan

Last updated 10 months ago

Was this helpful?

The MealPlan query will return the current and previous 7-day meal plans for the user, so it will return a maximum of 14 days. Each day of the meal plan will contain a certain number of meals according to the user's profile.

Each meal contains a with all its expected properties along with the amount of recommended servings (numOfServings).

Meal Plan Settings

Macros, caloric ranges, meals per day, and other settings can be defined for each user using the mutation. If this object is null, the meal plan will be generated using the user's .

Meal Plan Generation

In order for a meal plan to exists it first needs to be created using the mutation.

Available Fields

Field

Type

Note

day

Int

Number of days in the returned meal plan

date

String

Date assigned to the "day" of the meal plan

calories

Float

Total calories (in Kcal) for the day

protein

Float

Total protein (g) for the day

carbs

Float

Total carbs (g) for the day

fat

Float

Total fat (g) for the day

meals

Example

{
  mealPlan {
    day
    date(useDatetime: false)
    calories
    meals {
      id
      calories
      meal
      numOfServings
      recipe {
        name
        numberOfServings
        nutrientsPerServing {
          calories
        }
      }
    }
  }
}
{
  "data": {
    "mealPlan": [
      {
        "day": 1,
        "date": "2020-11-10",
        "calories": 2494.40432435512,
        "meals": [
          {
            "id": "TWVhbDo0NTIzOTU=",
            "calories": 1140.70631,
            "meal": "breakfast",
            "numOfServings": 4,
            "recipe": {
              "name": "Meyer Lemon Poppy Seed Pancakes",
              "numberOfServings": 8,
              "nutrientsPerServing": {
                "calories": 285.18
              }
            }
          },
          {
            "id": "TWVhbDo0NTIzOTY=",
            "calories": 55.979,
            "meal": "snack",
            "numOfServings": 1,
            "recipe": {
              "name": "Dried Cranberries",
              "numberOfServings": 1,
              "nutrientsPerServing": {
                "calories": 400
              }
            }
          },
          {
            "id": "TWVhbDo0NTIzOTc=",
            "calories": 274.496096881456,
            "meal": "lunch",
            "numOfServings": 1,
            "recipe": {
              "name": "Greek Salad",
              "numberOfServings": 2,
              "nutrientsPerServing": {
                "calories": 274.5
              }
            }
          },
          {
            "id": "TWVhbDo0NTIzOTg=",
            "calories": 88.0264,
            "meal": "snack",
            "numOfServings": 1,
            "recipe": {
              "name": "Apple Slices",
              "numberOfServings": 1,
              "nutrientsPerServing": {
                "calories": 88.03
              }
            }
          },
          {
            "id": "TWVhbDo0NTIzOTk=",
            "calories": 935.196517473667,
            "meal": "dinner",
            "numOfServings": 2,
            "recipe": {
              "name": "Coconut Lime Shrimp",
              "numberOfServings": 4,
              "nutrientsPerServing": {
                "calories": 467.6
              }
            }
          }
        ]
      },
      {
        "day": 7,
        "date": "2020-11-09",
        "calories": 2534.62785666846,
        "meals": [
          {
            "id": "TWVhbDo0NDM1MzQ=",
            "calories": 893.348881646525,
            "meal": "breakfast",
            "numOfServings": 2,
            "recipe": {
              "name": "Cherry Tomato Bites [Vegan, Gluten-Free]",
              "numberOfServings": 4,
              "nutrientsPerServing": {
                "calories": 446.67
              }
            }
          },
          {
            "id": "TWVhbDo0NDM1MzU=",
            "calories": 242.991933333333,
            "meal": "snack",
            "numOfServings": 1,
            "recipe": {
              "name": "Peanut Butter Milkshake",
              "numberOfServings": null,
              "nutrientsPerServing": {
                "calories": 242.99
              }
            }
          },
          {
            "id": "TWVhbDo0NDM1MzY=",
            "calories": 389.312940753041,
            "meal": "lunch",
            "numOfServings": 2,
            "recipe": {
              "name": "Confetti Quinoa",
              "numberOfServings": 2,
              "nutrientsPerServing": {
                "calories": 194.66
              }
            }
          },
          {
            "id": "TWVhbDo0NDM1Mzc=",
            "calories": 243.90417195952,
            "meal": "snack",
            "numOfServings": 1,
            "recipe": {
              "name": "Green Beans With Garlic And Lemon",
              "numberOfServings": 2,
              "nutrientsPerServing": {
                "calories": 243.9
              }
            }
          },
          {
            "id": "TWVhbDo0NDM1Mzg=",
            "calories": 765.069928976041,
            "meal": "dinner",
            "numOfServings": 4,
            "recipe": {
              "name": "Chicken Breast With Honey-Balsamic Glaze",
              "numberOfServings": 4,
              "nutrientsPerServing": {
                "calories": 191.27
              }
            }
          }
        ]
      }
    ]
  }
}

Example with total Macros

query{
  mealPlan{
    date
    calories
    protein
    carbs
    fat
    day
    meals{
      recipe{
        name
      	id
        mealTags
        tags
      }
    }
  }
}
{
  "data": {
    "mealPlan": [
      {
        "date": "2024-07-16 02:00:00+00:00",
        "calories": 1062.0772445391667,
        "protein": 60.19781906916667,
        "carbs": 100.0011865825,
        "fat": 46.80902465916666,
        "day": 7,
        "meals": [
          {
            "recipe": {
              "name": "Bean And Cheese Quesadilla",
              "id": "UmVjaXBlOjQ5MGY3ZGZiLTBjNmMtNDU4Mi1iZTIxLThjNjJiYjEyOTdiNw==",
              "mealTags": null,
              "tags": [
                "Lunch",
                "main dish",
                "Breakfast",
                "UNDER 15 MINUTES",
                "main course",
                "Fast & Easy",
                "Dinner"
              ]
            }
          },
          {
            "recipe": {
              "name": "Double Chocolate Thickshake",
              "id": "UmVjaXBlOjZhMTAzY2NmLTkxYWEtNGMyZi1iMDQ3LThhYzkxNjIzMjBkYg==",
              "mealTags": null,
              "tags": [
                "VEGETARIAN",
                "GLUTEN_FREE",
                "DAIRY_FREE"
              ]
            }
          },
          {
            "recipe": {
              "name": "Israeli Cauliflower Salad With Superfood Dukkah",
              "id": "UmVjaXBlOmI1M2E2ZGM5LTA2ZmQtNDA5Ny04YWQ4LWI5MjJkZTZjNTgzMw==",
              "mealTags": null,
              "tags": [
                "VEGETARIAN",
                "GLUTEN_FREE",
                "DAIRY_FREE",
                "VEGAN"
              ]
            }
          },
          {
            "recipe": {
              "name": "Air Fryer Cajun Crab Cakes",
              "id": "UmVjaXBlOjRlZjU5NDVhLTM3MWQtNDQ3ZS1hNWI0LTkyMzMzYmFiYjQ0Ng==",
              "mealTags": null,
              "tags": [
                "Lunch",
                "Dinner",
                "main course",
                "main dish",
                "Fast & Easy",
                "Seafood"
              ]
            }
          }
        ]
      },
      {
        "date": "2024-07-15 02:00:00+00:00",
        "calories": 1223.7193252078278,
        "protein": 78.21256417252481,
        "carbs": 127.78186363617326,
        "fat": 44.415734885892846,
        "day": 6,
        "meals": [
          {
            "recipe": {
              "name": "Mince Pies",
              "id": "UmVjaXBlOjE3NWU5ZTIwLTQ4YzktNDQ5ZS05NmNhLWNlYTE2ZDY4YmIzYQ==",
              "mealTags": null,
              "tags": [
                "15 - 30 MINUTES",
                "STEAMED"
              ]
            }
          },
          {
            "recipe": {
              "name": "Walnut No-Meat Meatballs",
              "id": "UmVjaXBlOmQwYTE5NzZkLTY5NGYtNDU0MC04ZTVkLTg5MjgwZmQzNTUwOQ==",
              "mealTags": null,
              "tags": [
                "VEGETARIAN",
                "GLUTEN_FREE"
              ]
            }
          },
          {
            "recipe": {
              "name": "Naked Kitchari Burgers",
              "id": "UmVjaXBlOmMyNTJjMWJlLTExN2YtNGY4Yi1hMTVlLTBlZWQxNDc3OTEzMQ==",
              "mealTags": null,
              "tags": [
                "VEGETARIAN",
                "GLUTEN_FREE"
              ]
            }
          },
          {
            "recipe": {
              "name": "Bourbon Chicken",
              "id": "UmVjaXBlOjRmMzUxYjY2LTczZGUtNDJhZC1iNGJlLWY5ZTNjYzAwY2MyOA==",
              "mealTags": null,
              "tags": [
                "Low-Fat",
                "ABOVE 30 MINUTES",
                "Dinner",
                "ACIDIC FOODS/DRINKS",
                "LABOR INTENSIVE",
                "PROTEIN-DENSE",
                "DOES NOT DISSOLVE VIA SALIVA",
                "Lunch"
              ]
            }
          }
        ]
      },
      {
        "date": "2024-07-14 02:00:00+00:00",
        "calories": 1026.4874236915025,
        "protein": 55.22026352413019,
        "carbs": 102.84088183299365,
        "fat": 43.804760251445245,
        "day": 5,
        "meals": [
          {
            "recipe": {
              "name": "Savoury Cheese + Black Pepper Scones",
              "id": "UmVjaXBlOjA4YWJlNzkyLTdlMTAtNDgzYy1hYWEzLTA4ZmJiZGUzMTc2NQ==",
              "mealTags": null,
              "tags": [
                "VEGETARIAN",
                "Peanut-Free",
                "Sesame-Free",
                "Fish-Free",
                "Kids"
              ]
            }
          },
          {
            "recipe": {
              "name": "Veggie Chips",
              "id": "UmVjaXBlOjlhYThhNjNmLWU3YTAtNGE1Yy1hYzk1LTBmZDNkYmM2MjlhYg==",
              "mealTags": null,
              "tags": [
                "VEGETARIAN",
                "GLUTEN_FREE",
                "DAIRY_FREE",
                "VEGAN",
                "Peanut-Free",
                "Egg-Free",
                "Kids"
              ]
            }
          },
          {
            "recipe": {
              "name": "Brussels Sprout + Green Pea Slice",
              "id": "UmVjaXBlOjk4ZWJlY2ZiLTQ2N2QtNDY1MS1iOTZkLWMyMTM1YWNlOTEwNQ==",
              "mealTags": null,
              "tags": [
                "GLUTEN_FREE",
                "VEGETARIAN"
              ]
            }
          },
          {
            "recipe": {
              "name": "Coq Au Vin",
              "id": "UmVjaXBlOmY2OTg2OGFiLWQ2OGItNDY1YS04ZjQxLTY4ODllZDgwNWEwMg==",
              "mealTags": null,
              "tags": [
                "ABOVE 30 MINUTES",
                "main dish",
                "Dinner",
                "main course",
                "Lunch",
                "Fast & Easy"
              ]
            }
          }
        ]
      }
     ]
   }
}

As follows find an example of how the numOfServings, servingWeigth, numberOfServings, and weightInGramms are used and calculated within this mutation:

About Dates

Returned results are sorted by date in descending order.

In older versions of the API, dates were returned as datetimes in UTC, and you had to make sure to adjust for your user's timezone and convert the datetime to date in order to avoid issues with date assignment. For compatibility, this is still the default. To receive an already converted date, you have to send the useDatetime: false argument in the date field.

Unless you're working with an older version of the API, always send the useDatetime: false argument in the date field.

Normal Flow

  1. A new user is created, it doesn't have a meal plan yet

  2. Use generateMealPlan for the first time. This returns success=true if the meal plan is generated successfully.

    1. Call mealPlan to obtain the first set of 7 days (or the first meal plan).

    2. The first day (day 1) will have the date of the day in which you called generateMealPlan

  3. At any time, you should use mealPlan to obtain the currently running meal plan. This will return up to 14 days. These 14 days normally represent the current "running meal plan" and the previous week (if it exists).

    1. Please note that in the cases where the user's profile has changed and generateMealPlan was used again (before the end of the running meal plan), then when looking at the data returned by mealPlan you may be looking at more than 2 meal plans in the same set of 14 days.

  4. When you reach day 7 you have 2 options

  5. If day 7 of the last running meal plan has gone by and a new meal plan has not been requested, then you'll still be looking at the original 7 days when calling mealPlan. At this point, you'll need to call generateMealPlan to request a new set of 7 days, as in point #2.

    1. The options in point #6 will also be available

    2. IMPORTANT: A new meal plan will not be automatically generated when the previous one has ended

  6. Any time you call generateMealPlan make sure the success status is True. If the value returned is False then a new meal plan failed to generate and will be looking at "old" data if you call mealPlan at this point.

Other Considerations

  • A margin of error has been set for the resulting meal plan for both calories and macronutrients

  • No meal will repeat on the same day

  • This query takes into account the user's goals, program, and preferences

  • A number of quality-related filters have been set, by default, in order to ensure high-quality meal plans:

    • Excludes recipes with under 40 calories per serving

    • Excludes recipes for desserts, sauces, dips, bread, cocktails, and similar

    • Excludes snacks with over 5 ingredients

    • Excludes recipes with over 15 servings

    • Excludes recipes with more than 45-minute of cooking and preparation time

    • Excludes 0 calorie foods

    • Excludes packaged foods

[]

A along with the total calories of the meal, name of the meal, and amount of recommended servings

Associated to each day of the meal plan, the date value contains the date that corresponds to that particular day based on the last time a meal plan was generated. Read more about how dates are assigned .

If at any time during the 7 days while a meal plan is "running" you call generateMealPlan, nothing will happen, unless the user's settings have changed. Read more .

Generate a new set of 7 days using generateMealPlan with (the new day 1 will come after the "current" day 7)

Repeat the previous 7 days using generateMealPlan with (same behavior but with the same meals as before)

If a meal plan cannot be generated because of the user's restrictions, will be displayed

recipe
profileMealPlanSettings
goals
generateMealPlan
a message
meal
Recipe
here
here
addDays: true
repeat: "date"