Recipe

A recipe represents the base data type of the Whisk API. The corresponding endpoints to read, update, and delete recipes are split-up based on if the recipe is attached to a user or not. You will need an ID to access any of the recipes and test the following examples.

You can access any recipe's ID from its URL when viewing on Whisk.com.

Data Structure

The Recipe object is a collection of attributes that help make up the data structure for any given recipe.

All recipe calls (Get, Search, Feed, etc) will return an object that looks like this:

{
"recipe": {
"id": "10166b9b5f457863f73ae1309b2fdf9470b78d75d39",
"name": "Omelette pancakes with tomato & pepper sauce",
"description": "Healthy, low-calorie and gluten-free - these herby egg 'pancakes' will become your go-to favourite for a quick midweek meal",
"servings": 2,
"language": "en"
...
}
}

The following attributes make up the core of the recipe object.

Attributes

Type

Description

id

string

The id of the recipe

name

string

The full name of the recipe

description

string

The description of the recipe

servings

number

The original number of servings

language

string

The langue the recipe was written in

In addition to the base attributes, there are additional objects that contain more detailed information on the recipe itself.

Author

This object contains information about the author of the recipe.

"author": {
"name": "Sara Buenfeld"
},

Attribute

Type

Description

author

string

name of recipe's author

Constraints

The RecipeConstraints object outlines any dietary considerations associated with the recipe.

"constraints": {
"violates": {
"diets": [
"DIET_VEGAN",
"DIET_LACTO_VEGETARIAN"
],
"avoidances": [
"AVOIDANCE_YEAST",
"AVOIDANCE_GLUTEN",
"AVOIDANCE_SOYBEAN",
"AVOIDANCE_WHEAT",
"AVOIDANCE_EGG"
]
}
},

Durations

An object containing attributes on the duration for the recipe.

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

Attributes

Type

Description

cookTime

number

Cooking time in minutes

prepTime

number

Preparation time in minutes

totalTime

number

Total time in minutes

Images

The recipe may contain images that are stored as an Image Container array.

"images": [
{
"responsive": {
"url": "https://whisk-res.cloudinary.com/image/upload/v1523012138/recipe/758058656142eaae402f1781e18c527c.jpg",
"width": 454,
"height": 500
},
"url": "https://whisk-res.cloudinary.com/image/upload/v1523012138/recipe/758058656142eaae402f1781e18c527c.jpg"
}
],

Each image contains the following attributes.

Attributes

Type

Description

url

string

original image url, deprecated. Please use field original instead

original

OriginalImage

original image information, e.g. image URL

responsive

ResponsiveImage

​Content

Responsive Image

The responsive image object contains the following attributes allowing you to access different images sizes based on your needs.

Attributes

Type

Description

url

string

Hosted URL of an image

width

integer

Image width

height

integer

Image height

Ingredients

This is an array representing each ingredient of the recipe.

"ingredients": [
{
"text": "4 large eggs"
},
{
"text": "wholemeal bread or salad leaves, to serve"
}
],

Labels

A recipe has several label collections that define the type of meal it is, what 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 of these properties contains an array of recipe labels.

Attributes

Type

Description

mealType

array [RecipeLabel]

​Content

cuisine

array [RecipeLabel]

​Content

category

array [RecipeLabel]

​Content

technique

array [RecipeLabel]

Content

RecipeLabel Object

A recipe label object consists of the following properties.

Attributes

Type

Description

name

string

​Content

displayName

string

Nutrition

The recipe's nutrition object contains multiple children objects that help define the total scope of a recipe's nutritional value.

"nutrition": {
"status": "STATUS_AVAILABLE",
"total": [
{
"label": "Carbohydrate Total",
"code": "NUTRITION_CODE_CHOCDF",
"value": 22,
"unit": "NUTRITION_UNIT_G"
},
{
"name": "diabetes-friendly",
"display_name": "Diabetes Friendly"
}
],
"health_score": {
"value": 5.372154194041782,
"nutrients_influence": [
{
"code": "NUTRITION_CODE_FAT_UNSAT",
"influence": 0.7762592808559045,
"comment": "Strong positive impact"
},
{
"code": "NUTRITION_CODE_SUGAR",
"influence": -0.1876448970439361,
"comment": "Low negative impact"
}
]
},
"glycemic_index": {
"value": 42.12
},
"glycemic_load": {
"value": 7.66
}
},

To help better understand the structure of this object, these are the high-level properties.

RecipeNutrition

You can access any part of the recipe's nutrition through any of the following properties.

Attributes

Type

Description

total

array [Nutrient]

An array of nutrients for the entire recipe

labels

array [RecipeLabel]

​Content

healthScore

HealthScore

The recipe's health score

glycemicIndex

GlycemicScore

The recipe's glycemic index​

glycemicLoad

GlycemicScore

The recipe's glycemic load

Nutrient

A nutrient is part of the nutrition object's total. Each one consists of the following properties.

Attributes

Type

Description

code

enum

The nutrient code, as listed here

label

string

A readable name e.g. Energy, Total Fat etc.

value

integer

The nutrient's value

unit

enum

Possible values: g, mg, µg, kcal

Health Score

Each recipe is assigned a health score that consists of the following properties.

Attributes

Type

Description

value

double

​Content

nutrientsInfluence

array [NutrientsInfluence]

Components which influence health score

Nutrients Influence

A nutrient influence is used to calculate the total score for the recipe. Each influence has the following properties.

Attributes

Type

Description

code

string

​Content

influence

double

​Content

comment

string

​Content

Glycemic Index

This score is assigned to the recipe based on how quickly the recipe will raise a person's blood sugar.

Attributes

Type

Description

value

double

​Content

Glycemic Load

This object defines how much the recipe will raise a person's blood glucose level.

Attributes

Type

Description

value

double

​Content

Source

The source object contains details on where the recipe originated from.

"source": {
"name": "bbcgoodfood.com",
"display_name": "BBC Good Food",
"source_recipe_url": "https://www.bbcgoodfood.com/recipes/omelette-pancakes-tomato-pepper-sauce",
"image": {
"responsive": {
"url": "https://whisk-res.cloudinary.com/image/upload/publishers/logos/bbcgoodfood-logo.png",
"width": 256,
"height": 256
},
"url": "https://whisk-res.cloudinary.com/image/upload/publishers/logos/bbcgoodfood-logo.png"
},
"license": "LICENCE_FAIRUSE"
}

Attributes

Type

Description

name

string

​Content

display_name

string

source_recipe_url

string

image

ImageContainer

license

string

​Content

Videos

If a recipe has videos, they will be included in an array.

"videos": [
],

Attributes

Type

Description

url

string

URL to original video provider page

contentUrl

string

URL to video file. Actual bytes of the media object

embedUrl

string

An embed format of video with player

playerType

enum

Possible values: flash, html5, silverlight.

thumbnail

string

A thumbnail image relevant to the Video

duration

number

The duration of the recording

height

number

The height of the item

width

number

The width of the item

Optional Fields

These are additional objects the recipe may contain based on the supplied fields.

Normalized Ingredients

Attributes

Type

Description

text

string

​Content

group

string

​Content

analysis

RecipeIngredientAnalysis

​Content

Recipe Ingredient Analysis

Attributes

Type

Description

product

string

​Content

canonicalName

string

​Content

quantity

number

​Content

unit

string

​Content

multiplier

number

​Content

brand

string

​Content

comment

string

​Content

category

string

​Content

Product Category

Attributes

Type

Description

name

string

​Content

Nutrition Labels

We provide a batch of labels based on nutrition information.

  • Low Energy

  • Energy Free

  • Low Fat

  • Fat Free

  • Low Saturated Fat

  • Saturated Fat Free

  • Low Sugars

  • Sugars Free

  • Low Sodium

  • Very Low Sodium

  • Sodium Free

  • Low Salt

  • Very Low Salt

  • Salt Free

  • Cholesterol Free

  • Low Cholesterol

  • Source Of Fiber

  • High Fiber

  • Source Of Protein

  • High Protein

  • High Monounsaturated Fat

  • High Polyunsaturated Fat

  • Hight Unsaturated Fat

Also labels for each vitamin and mineral presented in nutrition info:

  • Source Of ...

  • High ...

e.g. Source Of Calcium or Hight Vitamin A

Once you have a recipe ID, you can use the Get Recipe endpoint to retrieve a Recipe or the Recipe Search endpoint to find a recipe based on a specific query.