Meal Plan Settings Object

The meal plan settings object

Meal Plan Settings contain all the essential information based on which your meal plan is created. The Meal Plan API provides you with endpoints to Get and Update the settings as needed.

This is how the data structure of a Meal Plan settings object looks like:

"settings": {
  "servings": 2,
  "calorie_per_day": 4000,
  "included_days": [
    "DAY_OF_WEEK_INVALID"
  ],
  "included_meal_types": [
    "MEAL_TYPE_INVALID"
  ],
  "enabled_auto_generation": true,
  "week_template": [
    ...
  ],
  "replace_only_generated": true,
  "week_start": "DAY_OF_WEEK_MONDAY",
  "generation_algorithm": "GENERATION_ALGORITHM_3_MEAL",
  "food_settings": {
    ...
  },
  "custom_labels": {
    ...
  }
}

The following attributes define the core of the settings object:

Attribute

Type

Description

Example Value

servings

integer

The number of people to serve meals in the meal plan.

2

calorie_per_day

integer

The number of daily calories (with a ±100 kcal variance) that are expected to be served by the meal plan.

4000

included_days

string

This attribute is deprecated and has been replaced by the week_template attribute.

_

included_meal_types

string

This attribute is deprecated and has been replaced by the week_template attribute.

_

enabled_auto_generation

boolean

Agreement to generate the meal plan automatically. This attribute has no impact on the auto-generation algorithm irrespective of its value.

  • true

  • false

week_template

array

The schedule settings of the meal plan. It includes information on preferred days and slots for meals assignment.

replace_only_generated

boolean

Controls the replacement of manually added meals with new auto-generated meals in the meal plan.

  • The attribute is set as true, If the meals that were manually added to the meal plan are retained, and the new meals are only assigned to the empty slots (if any), or they replace the existing auto-generated meals in the plan.

  • The attribute is set as false, If all the existing meals and empty slots are replaced with new meals.

week_start

string

The starting day of the week in the meal plan schedule.

  • DAY_OF_WEEK_MONDAY

  • DAY_OF_WEEK_TUESDAY

  • DAY_OF_WEEK_WEDNESDAY

  • DAY_OF_WEEK_THURSDAY

  • DAY_OF_WEEK_FRIDAY

  • DAY_OF_WEEK_SATURDAY

  • DAY_OF_WEEK_SUNDAY

generation_algorithm

string

The meal generation algorithm.

  • GENERATION_ALGORITHM_3_MEAL: It performs casual filtering of recipes irrespective of the user's nutrition preferences. Though it does prefer including recipes that match the preferences, still it may also include the ones that are not a good match.

  • GENERATION_ALGORITHM_3_MEAL_NUTRITION_BALANCE: It performs strict filtering to include only those recipes that match the user's nutrition preferences. Note: This is the default algorithm utilized by Whisk to auto-generate the meal plan.

food_settings

array

User's preferences related settings for filtering recipes.

custom_labels

array

A list of labels for filtering recipes.

Each array contains additional attributes as described below.

week_template

"week_template": [
  {
    "day": "DAY_OF_WEEK_SUNDAY",
    "meal_templates": [
      {
        "meal_type": "MEAL_TYPE_BREAKFAST",
        "day_slot": 3
      },
      {
        "meal_type": "MEAL_TYPE_LUNCH",
        "day_slot": 4
      },
      {
        "meal_type": "MEAL_TYPE_DINNER",
        "day_slot": 5
      }
    ]
  },
  ...
],

Attribute

Type

Description

Example Value

day

string

Represents a day of the week.

  • DAY_OF_WEEK_MONDAY

  • DAY_OF_WEEK_TUESDAY

  • DAY_OF_WEEK_WEDNESDAY

  • DAY_OF_WEEK_THURSDAY

  • DAY_OF_WEEK_FRIDAY

  • DAY_OF_WEEK_SATURDAY

  • DAY_OF_WEEK_SUNDAY

meal_templates

array

Includes mapping details of different meal-types with day slots, which means what type of meals should be generated to which slot in a day. For more information, see the array break-up below.

"meal_templates": [ { "meal_type": "MEAL_TYPE_BREAKFAST", "day_slot": 3 }, { "meal_type": "MEAL_TYPE_LUNCH", "day_slot": 4

}, { "meal_type": "MEAL_TYPE_DINNER", "day_slot": 5 } ]

The meal_templates array contains the following attributes:

Attribute

Type

Description

Example Value

meal_type

string

The different types of meal that you may have during the day. These meal-types are independent of day slots and can be assigned to any day slot as required. Additionally, the meal-types are also independent of recipe labels, which means you can have a meal-type as Lunch but inside it, you can use a Breakfast recipe for the meal.

  • MEAL_TYPE_BREAKFAST

  • MEAL_TYPE_LUNCH

  • MEAL_TYPE_DINNER

day_slot

integer

Indicates a slot within the day to consume a meal. As part of your meal plan, you can as many as 7 slots in a day dedicated to different meal-types.

3

food_settings

"food_settings": {
  "labels": [
    {
      "label": {
        "diet": "DIET_VEGETARIAN",
        "category": [
          "CATEGORY_QUICK_AND_EASY",
          "CATEGORY_HEALTHY_RECIPES",
          "CATEGORY_HOLIDAYS_AND_EVENTS"
        ],
        "avoidance": "AVOIDANCE_ALCOHOL",
        "cuisine": [
          "CUISINE_EUROPEAN",
          "CUISINE_WORLD_CUISINE"
        ],
        "meal_type": [
          "MEAL_TYPE_BREAKFAST",
          "MEAL_TYPE_BRUNCH",
          "MEAL_TYPE_DESSERTS",
          "MEAL_TYPE_DINNER"
        ],
        "nutrition": "NUTRITION_HEALTHY",
        "feature": "video",
        "holiday": "HOLIDAY_INVALID",
        "seasonality": "SEASONALITY_INVALID"
      },
      "boost": true
    }
  ],
  "include_ingredients": {
    "raw_ingredients": [
      {
        "name": "Tomato"
      }
    ],
    "min_ingredients_should_match": 1
  },
  "health_score": {
    "from": 4
  }
}

Attribute

Type

Description

Example Value

labels

array

Labels specific to the user's preferences for filtering recipes. For more information, see the array break-up below.

"labels": [ { "label": { "diet": "DIET_VEGETARIAN", "category": "CATEGORY_QUICK_AND_EASY", "avoidance": "AVOIDANCE_ALCOHOL", "cuisine": "CUISINE_EUROPEAN", "meal_type": "MEAL_TYPE_BREAKFAST", "nutrition": "NUTRITION_HEALTHY", "feature": "video", "holiday": "HOLIDAY_THANKSGIVING_DAY", "seasonality": "SEASONALITY_WINTER" }, "boost": true }

include_ingredients

array

Includes information on any specific ingredients and the number of ingredients to be considered for filtering recipes for the meal plan. For more information, see the array break-up below.

"include_ingredients": { "raw_ingredients": [ { "name": "Tomato" } ], "min_ingredients_should_match": 1 },

health_score

array

Includes the minimum health score to be considered for filtering recipes for the meal plan. Health Scores are calculated on a 2 to 10 scale based on nutrient density and USDA recommendations for a healthy diet. A higher Health Score means healthier food. For more information, see Heath Score.

"health_score": { "from": 4 }

The labels array contains the following attributes:

Attribute

Type

Description

Example Value

label

array

A list of labels of different categories. For more information, see Labels.

"label": { "diet": "DIET_VEGETARIAN", "category": "CATEGORY_QUICK_AND_EASY", "avoidance": "AVOIDANCE_ALCOHOL", "cuisine": "CUISINE_EUROPEAN", "meal_type": "MEAL_TYPE_BREAKFAST", "nutrition": "NUTRITION_HEALTHY", "feature": "video", "holiday": "HOLIDAY_THANKSGIVING_DAY", "seasonality": "SEASONALITY_WINTER" },

boost

boolean

Controls the filtering approach.

  • The attribute is set as true to casually filter the recipes based on the specified labels. This means that the recipes that match with the specified labels would be preferred over the others but the final results would include both matched and unmatched recipes.

  • The attribute is set asfalse to strictly filter only those recipes that match with the specified labels.

The include_ingredients array contains the following attributes:

Attribute

Type

Description

Example Value

raw_ingredients

string

A name of a particular ingredient to match while filtering recipes.

"raw_ingredients": [ { "name": Tomato" } ],

min_ingredients_should_match

integer

Indicates the minimum number of ingredients that must match while filtering recipes. If the value specified is greater than 0, the result includes recipes, which have at least the specified number of ingredients. And, if it is set as 0, recipes with more matched ingredients are prioritized.

0

custom_labels

"custom_labels": {
  "everywhere": {
    "in": [
      {
        "group": "",
        "label": ""
      }
    ],
    "boost_in": [
      {
        "group": "",
        "label": ""
      }
    ],
    "all": [
      {
        "group": "",
        "label": ""
      }
    ],
    "not": [
      {
        "group": "",
        "label": ""
      }
    ]
  },
  "in_recipe": {
    ...
  },
  "in_ingredients": {
    ...
  },
  "in_instruction_steps": {
    ...
  }
}

Note: These labels are generally created in the Whisk Studio application and are left blank while managing meal plan settings using the Whisk API.

To learn how to pull or update meal plan settings, read the following endpoints' documentation:

Get Meal Plan SettingsUpdate Meal Plan Settings

Last updated