Recipe

The Recipe API service lets you read and write any internal and external recipes and your Whisk recipe collections.

Let's first understand the Recipe object and its data structure before looking at its endpoints' description.

Recipe Object

A Recipe object is a collection of arrays and attributes that defines the data structure for any given recipe.

This is how the data structure of a recipe looks in JSON format:

{
  "recipe": {
    "id": "107d918699fb79c4ed4a561823f9f77d64e",
    "name": "Blueberry Bakewell muffins",
    "description": "These easy blueberry muffins have a delightfully jammy centre and crunchy crumble topping - a tasty treat for teatime or packed lunch",
    "ingredients": [
      ...
    ],
    "instructions": {
      ...
    },
    "images": [
      ...
    ],
    "videos": [
      ...
    ],
    "source": {
      ...
    },
    "servings": 12,
    "servings_scaled": 2,
    "durations": {
      ...
    },
    "normalized_ingredients": [
      ...
    ],
    "nutrition": {
      ...
    },
    "labels": {
      ...
    },
    "constraints": {
      ...
    },
    "saved": {
      ...
    },
    "author": {
      ...
    },
    "language": "en",
    "custom_labels": [
      ...
    ],
    "main_ingredients": [
      ....
    ]
  }
}

Core Attributes

The following attributes define the core of a recipe:

In addition to the base attributes, there are objects and arrays that contain more information on the recipe.

Ingredients

This array contains information on the ingredients used in the recipe.

"ingredients":[
   {
      "text":"1/4 cup cholesterol-free egg product"
   },
   ...
   {
      "text":"HEINZ Tomato Ketchup",
      "linked_product":{
         "id":"5f75d73bcfed282362a8b3aa",
         "name":"HEINZ Tomato Ketchup",
         "images":[
            ...
         ]
      }
   }
],

The linked_product object contains the following attributes:

Images

This array contains information on one or more images of the completed dish included in the recipe.

"images":[
   {
      "url":"https://whisk-res.cloudinary.com/image/upload/v1603979937/recipe/a322bb09c8934e66d3eca3f98c59004a.jpg",
      "responsive":{
         "url":"https://whisk-res.cloudinary.com/image/upload/v1603979937/recipe/a322bb09c8934e66d3eca3f98c59004a.jpg",
         "width":240,
         "height":208
      }
   },
   ...
],

The responsive object contains the following attributes:

Source

‌This object contains details of the recipe origins.

"source":{
    "name":"myfoodandfamily.com",
    "display_name":"myfoodandfamily",
    "url":"https://www.myfoodandfamily.com/recipe/063765/grab-and-go-breakfast-sandwich?utm=skforu_rdp",
    "image":{
                "url":"https://whisk-res.cloudinary.com/image/upload/v1565965713/publishers/logos/myfoodandfamily-logo.png",
        "responsive":{
            "url":"https://whisk-res.cloudinary.com/image/upload/v1565965713/publishers/logos/myfoodandfamily-logo.png",
            "width":256,
            "height":256
        }
    }
},

Durations

‌This object contains information on the time it takes to prepare and cook the recipe.

"durations":{
    "cook_time":20,
    "prep_time":10,
    "total_time":30
},

Labels

‌‌This object contains information on the labels attached to the recipe that helps distinguish its type, cuisine, category, and the techniques required to cook.

"labels": {
    "meal_type": [
      {
        "name": "main-course",
        "display_name": "Main Course"
      },
      ...

      {
        "name": "dinner",
        "display_name": "Dinner"
      }
    ],
    "cuisine": [
      {
        "name": "french",
        "display_name": "French"
      }
    ],
    "category": [
      {
        "name": "dinner",
        "display_name": "Dinner"
      },
      {
        "name": "lunch",
        "display_name": "Lunch"
      }
    ],
    "technique": [
      {
        "name": "simmering",
        "display_name": "Simmering"
      },
      ...

      {
        "name": "pan-frying",
        "display_name": "Pan Frying"
      }
    ]
  },

Each label attached to the recipe appears as a child-array.

Each of these arrays contains the following attributes:

For information on supported labels, see Recipe Labels.

Author

‌This object includes information about the Whisk user who created the recipe.

"author":{
    "id": "10297e19d97dd5a43ecbd9a13172ce65bfb"
    "name":"Sara Buenfeld"
    "image":{
      "url":"https://img.cjthemarket.com/images/file/author/973/20191226105710715.jpg",
      "responsive":{
         "url":"https://whisk-res.cloudinary.com/image/upload/v1602854082/author/8bade35e90ecf44eac6ec7ae5346d228.jpg",
         "width":300,
         "height":300
      }
},

Custom Labels

‌This array includes a list of user-defined labels linked to the recipe.

"custom_labels":[
   {
      "name":"brand-category",
      "labels":[
         {
            "name":"cj-chinese"
         },
         {
            "name":"cj-etc"
         }
      ]
   },
   {
      "name":"brand",
      "labels":[
         {
            "name":"kraft-cheese"
         }
      ]
   },
   {
      "name":"barcode-number",
      "labels":[
         {
            "name":"00013000006409"
         }
      ]
   }
]

Tips

‌This array includes a list of advice linked to the recipe.

 "tips": [
    {
      "header": "string",
      "text": "string"
    }
 ]

Main ingredients

The most important products of a recipe. We consider them to be equal in case there are several products returned.

 "main_ingredients": [
      "veal",
      "bacon",
      "fruit"
]

Optional Data

The recipe data structure may include extra information based on any additional parameters included in the API request.

Normalized Ingredients

This array includes detailed analysis of each recipe's ingredient.

"normalized_ingredients":[
   {
      "text":"1 slice cooked OSCAR MAYER Bacon, cut crosswise in half",
      "analysis":[
         {
            "alternative_measurements": [
                        {
                            "amount": {
                                "quantity": 120,
                                "unit": "g"
                            },
                            "measurement_system": "MEASUREMENT_SYSTEM_METRIC"
                        },
                        {
                            "amount": {
                                "quantity": 1,
                                "unit": "slice"
                            },
                            "measurement_system": "MEASUREMENT_SYSTEM_IMPERIAL"
                        }
                    ],
            "product":{
               "canonical_name":"OSCAR MAYER COOKED BACON (READY MADE)",
               "original_name":"cooked oscar mayer bacon"
            },
            "category":{
               "canonical_name":"MEATS AND SEAFOOD"
            },
            "brand":{
               "canonical_name":"OSCAR MAYER"
            },
            "quantity":1,
            "unit":"slice",
            "comment":"cut crosswise in half",
            "image_url":"https://whisk-res.cloudinary.com/image/upload/v1570185262/custom_upload/4e3434d390926ff30a3f96652529194d.jpg"
         }
      ],
      "source_text":"1 slice cooked OSCAR MAYER Bacon, cut crosswise in half"
   },
   {
      "text":"HEINZ Tomato Ketchup",
      "linked_product":{
         "id":"5f75d73bcfed282362a8b3aa",
         "name":"HEINZ Tomato Ketchup",
         "images":[
            {
               "url":"https://whisk-res.cloudinary.com/image/upload/v1600195675/inventory_item/20c81dcc9b003de383b1891828b59fc5.jpg"
            }
         ]
      },
      "source_text":"HEINZ Tomato Ketchup"
   },
   ...
],

The analysis array includes the following attributes:

‌Instructions‌

This object includes information on each step required in the recipe preparation.

"instructions":{
   "steps":[
      {
         "text":"Cook egg product in skillet sprayed with cooking spray on medium heat 3 min. or until set, stirring occasionally.",
         "images":[
            {
               "url":"https://whisk-res.cloudinary.com/image/upload/v1603979936/recipe/33c0f4a5c00651929f57d00b398aafda.jpg",
               "width":424,
               "height":640
            }
         ]
      },
      {
         "text":"Fill muffin halves with egg product, Singles and bacon.",
         "images":[
            {
               "url":"https://whisk-res.cloudinary.com/image/upload/v1603979947/recipe/62848f0ee14fd5808e541e3e29934e72.jpg",
               "width":424,
               "height":640
            }
         ]
      }
   ]
},

The steps array contains the following attributes:

Nutrition

‌This object contains information about the recipe's nutritional value.

"nutrition":{
    "status":"STATUS_AVAILABLE",
    "total":[
        {
            "label":"Magnesium",
            "code":"NUTRITION_CODE_MG",
            "value":82.61800000000001,
            "unit":"NUTRITION_UNIT_MG"
        },
        ...
    ],
    "coverage": 0.93,
    "health_score":{
        "value":6.687124447756711,
        "nutrients_influence":[
            {
                "code":"NUTRITION_CODE_FAT_UNSAT",
                "influence":0.7762592808559045,
                "comment":"Strong positive impact"
            },
            ...
        ]
    },
    "glycemic_index":{
        "value":42.12
    },
    "glycemic_load":{
        "value":7.66
    }
},

Each object contains additional attributes.

Total

‌This array contains information about the nutrients available in the recipe. Each nutrient carries the following information:

‌Health Score

‌This array contains information on the health score assigned to the recipe.

Glycemic Index

‌This array includes information on the glycemic index score assigned to the recipe. It helps in understanding the impact of the recipe on blood sugar levels.

Glycemic Load

‌This array includes information on the glycemic load score assigned to the recipe. It helps in understanding the impact of the recipe on blood glucose levels.

Last updated