w3resource

Schema.org Recipe type tutorial

Recipe

In this document, we have discussed the Recipe type of the Schema.org. This tutorial covers description, properties, example and output of the example using Google Rich Snippets tool.

Hierarchy

Thing > CreativeWork > Recipe

Recipe type of Schema.org specifies a Recipe.

Properties

The following table describes the properties of Recipe:

Properties Which type should be used Description
cookTime Duration Specifies the time it takes to actually cook the preparation. Time is specified in ISO 8601 duration format.
cookingMethod Text Specifies the method of cooking, such as Boiling, Frying etc.
ingredients Text Specifies an ingredient used in the recipe.
nutrition NutritionInformation This specifies the nutrition information about the associated recipe.
prepTime Duration This specifies the length of time it takes to prepare the recipe. It is in ISO 8601 duration format.
recipeCategory Text This specifies the category of the recipe, e.g. beverage, dessert etc.
recipeCuisine Text Specifies the cuisine of the recipe, e.g. french, italian etc.
recipeInstructions Text Specifies the steps to prepare the dish.
recipeYield Text Specifies the quantity, e.g. number of people served, produced by the recipe.
totalTime Duration Specifies the total time it takes to prepare and cook the recipe. It is in ISO 8601 duration format.

Example

Example of Recipe without Microdata

<!DOCTYPE html >
<html lang="en">
<head>
<meta charset=utf-8>
<title>example of describing information of a Recipe without Microdata</title>
</head>
<body>
<p>Kaeng Khua Saparot - Thai Prawn and Pineapple Curry by Bidhan Chatterjee, November 18, 2011.</p>
<p>It is a Thai Food, and like other so many Thai dishes, it is too tasty to resist. I first tested it in a Thai restaurant in Pune, India.</p> 
<p>Prep Time: 20 minutes</p>

<p>Cook time: 10 Minutes </p>
<p>Yield: For four persons </p>

<p>Nutrition facts: Calories 586.7</p> 
<ul>Ingredients : </ul>
<p>1 tablespoon garlic, finely chopped</p>
<p>2 tablespoons red curry paste</p>
<p>2 tablespoons chopped tomatoes</p>
<p>2 cups coconut milk</p>
<p>1 cup pineapple	 (cubed or pulped)</p>
<p>4 tablespoons fish sauce</p>
<p>2 teaspoons palm sugar</p>
<p>1 teaspoon lime juice</p>
<p>16 prawns, about 3 inches long</p>
<p>2 -3 kaffir lime leaves, shredded</p>
<p>1 tablespoon Thai red chili pepper, slivered</p>
<p>15 fresh basil leaves</p>
<p>Instructions : 
</p>

<p>Peel, devein, and behead the shrimp, leaving only the small tail shells on. Drop two tomatoes into boiling water for about a minute, then remove to cold water, peel, quarter, discard the seed pulp, and chop the flesh. You want 2 tablespoons of chopped tomatoes. In a little oil in a medium hot wok, briefly saute the garlic and basil, removing it and reserving it when the aroma is fully developed. Cook the curry paste briefly to develop the aroma, then add half the coconut milk, the fish sauce, tomatoes, pineapple, lime juice and sugar. Stir to combine fully.  Add the prawns and cook until they turn slightly pink and opaque. Add the remainder of the coconut milk, the lime leaves and slivered chili, at the same time returning the  garlic and basil to the pan. Transfer to a serving dish and serve with steamed Thai jasmine rice.</p>
<p>10 Comments : </p>

<p>
From Ritwik Das, November 18, 2011 -- thank you, I will give it a try coming weekend.</p>
</body>
</html> 

Example of Book with Microdata

<!DOCTYPE HTML>
<html lang="en">
<head>
<meta charset=utf-8>
<title>example code of Recipe with Microdata</title>
<a rel="author" href="https://profiles.google.com/103074333439002308043/about">Bidhan Chatterjee</a>
</head>
<body>
<div itemscope itemtype="http://schema.org/Recipe">
<p><span itemprop="name">Kaeng Khua Saparot - Thai Prawn and Pineapple</span> -
by <span itemprop="author">Bidhan Chatterjee</span><span itemprop="datePublished" content="2009-05-08">November 18, 2011.</span></p> 
<p><span itemprop="description">It is a Thai Food, and like other so many Thai dishes, it is too tasty to resist. I first tested it in a Thai restaurant in Pune, India.</span></p>
<p>Prep Time: <span itemprop="prepTime" content="PT20M">20 minutes</span></p>
<p>Cook time: <span itemprop="cookTime" content="PT10M">10 minutes </span></p>
<p>Yield: <span itemprop="recipeYield">4 Servings </span></p>
<div itemprop="nutrition" 
itemscope itemtype="http://schema.org/NutritionInformation">
<p>Nutrition facts: <span itemprop="calories">586.7 Calories</span></p>
</div>
<p>Ingredients: 
<span itemprop="ingredients">3 or 4 ripe bananas, smashed</span>
<span itemprop="ingredients">1 egg</span>
<span itemprop="ingredients">3/4 cup of sugar</span>
<span itemprop="ingredients">1 tablespoon garlic, finely chopped</span>
<span itemprop="ingredients">2 tablespoons red curry paste</span>
<span itemprop="ingredients">2 tablespoons chopped tomatoes</span>
<span itemprop="ingredients">2 cups coconut milk</span>
<span itemprop="ingredients">1 cup pineapple	 (cubed or pulped)</span>
<span itemprop="ingredients">4 tablespoons fish sauce</span>
<span itemprop="ingredients">2 teaspoons palm sugar</span>
<span itemprop="ingredients">1 teaspoon lime juice</span>
<span itemprop="ingredients">16 prawns, about 3 inches long</span>
<span itemprop="ingredients">2 -3 kaffir lime leaves, shredded</span>
<span itemprop="ingredients">1 tablespoon Thai red chili pepper, slivered</span>
<span itemprop="ingredients">15 fresh basil leaves</span></p>
<p>Instructions:
<span itemprop="recipeInstructions">
Peel, devein, and behead the shrimp, leaving only the small tail shells on. Drop two tomatoes into boiling water for about a minute, then remove to cold water, peel, quarter, discard the seed pulp, and chop the flesh. You want 2 tablespoons of chopped tomatoes. In a little oil in a medium hot wok, briefly saute the garlic and basil, removing it and reserving it when the aroma is fully developed. Cook the curry paste briefly to develop the aroma, then add half the coconut milk, the fish sauce, tomatoes, pineapple, lime juice and sugar. Stir to combine fully. Add the prawns and cook until they turn slightly pink and opaque. Add the remainder of the coconut milk, the lime leaves and slivered chili, at the same time returning the  garlic and basil to the pan. Transfer to a serving dish and serve with steamed Thai jasmine rice.</span></p>
<p>10 comments:
<span itemprop="interactionCount" content="UserComments:10" />
From Ritwik Das, November 18, 2011 -- thank you, I will give it a try coming weekend.</span>
...
</p>
</div>
</body>
</html> 

Result of testing the above code with Rich Snippets Tool

recipe example

Previous: Schema.org Book type tutorial

Test your Programming skills with w3resource's quiz.



Become a Patron!

Follow us on Facebook and Twitter for latest update.

It will be nice if you may share this link in any developer community or anywhere else, from where other developers may find this content. Thanks.

https://www.w3resource.com/schema.org/Recipe.php