Description of the elements processed by Yandex

General requirements

To let Yandex extract recipes from your site, place only one recipe (the root class hrecipe element) per page. This recipe should be the main content of the page. Other elements (the properties of the recipe) are placed inside the root element.

The recipe should be fully displayed on the page and be visible to the site visitors.

Yandex processes both standard format properties and its own extensions.

Mandatory elements

To pass the recipe to Yandex for snippet improvement, send the following required properties:

fn

Name of the recipe or dish.

This property must have a text value.

Example:

<span class="fn">Beer chicken with rice</span>

ingredient

Ingredient and its amount.

A recipe may contain one or more ingredients. You should mark every ingredient with the ingredient class. This property can contain both plain text and HTML code.

The property can contain the following nested properties:

  • name — The product name (this property isn't provided by the hRecipe standard).

  • type and value — The measurement unit and the number of units.

  • amount — The amount in any format (this property is not provided by the hRecipe standard). Used instead of type and value.

Examples:

<span class="ingredient">
  <span class="amount">1</span>
  <span class="name">chicken</span>
</span>
<span class="ingredient">
  <span class="value">0.5</span>
  <span class="type">l</span>
  <span class="name">beer</span>
</span>

Recommended elements

In addition to the required properties, Yandex processes the following properties of the hRecipe format:

instructions

Instructions for cooking.

A recipe can contain only one element of the instructions class. This property can contain both plain text and HTML code.

We recommend that you include in this property only the instructions themselves, without the heading (for example, “Cooking method”).

Individual steps in the instruction can be marked with the instruction class. The nested instruction isn't provided by the hRecipe standard. It is added by Yandex as an extension.

Example:

<ul class="instructions">
  <li class="instruction"> Cut the chicken into pieces and put it in a baking dish. Add salt, pepper, and spices to taste.</li>
  <li class="instruction">Pour the beer over the chicken and put it in the oven.</li>
  <li class="instruction">Bake at 180 C for 40-45 minutes.</li>
</ul>

You can place one or more photo properties (as well as the result-photo properties) in the instructions property.

Example:

<ul class="instructions">
  <li>Cut the chicken into pieces and put it in a baking dish. Add salt, pepper, and spices to taste.<br>
      <img class="photo" src="images/step1.jpg" alt="Cut into pieces">
      </img>
  </li>
  <li>Pour the beer over the chicken and put it in the oven.<br>
      <img class="photo" src="images/step2.jpg" alt="Pour beer over hte chicken">
      </img>
  </li>
  <li>Bake at 180 C for 40-45 minutes.<br>
      <img class="photo result-photo" 
        src="images/step3.jpg" alt="Enjoy!"></img>
</li>
</ul>

See the description of the photo and result-photo properties below.

yield

The number of portions received from the specified amount of ingredients. A recipe can contain only one element of the yield class. This property must have a text value.

Example:

<span>Portion for <span class="yield">3 people</span>.</span>

duration

Cooking time. This property must contain a string in the ISO 8601 format.

For example:

<span>
  The total time for prep and cooking is approximately 
  <span class="duration">1 hour</span>.
</span>
<span class="duration"><span class="value-title" title="PT1H30M"> </span>one and a half hours</span>

photo and result-photo

The photo of a prepared dish or of a cooking stage. We recommend that you specify these fields to form a better snippet.

A recipe can contain several elements of the photo class. The photo property can be subordinate to the hrecipe root class, or to the instructions property. The property contains the value of the src attribute of the HTML <img> element.

If the recipe contains one or more elements of the photo class, one of them (containing the prepared dish photo) should be additionally marked with the result-photo class. The result-photo property isn't provided by the hRecipe standard. It is added by Yandex as an extension.

Example of using the photo and result-photo properties is given in the instructions property description.

author

The author of the recipe.

A recipe can contain several author class elements. This property can contain text or a card in the hCard format.

Examples:

<span>
  Author: <span class="author">Ivanov</span>
</span>
<span>
  Автор:
  <span class="author vcard">
    <a class="fn url" href="http://ivanov.narod.ru/">Ivanov</a>
  </span>
</span>

nutrition

Energy or nutrition value of the dish, meaning the number of calories and the amount of fat, protein, carbohydrates, vitamins, and so on.

A recipe can contain several nutrition class elements. The property can contain the following nested properties recommended by Yandex that aren't provided by the hRecipe standard:

  • calories — Number of calories.

  • fat — Fat.

  • saturatedFat — Saturated fats.

  • unsaturatedFat — Unsaturated fats.

  • carbohydrates — Carbohydrates.

  • sugar — Sugar.

  • fiber — Fiber.

  • protein — Protein.

  • cholesterol — Cholesterol.

  • servingSize — The size of portions that correspond to the nutrition/energy value.

For example:

<div>
  100 g contains
  <span class="nutrition">
      Energy value: 
      <span class="calories">240 calories</span>
      Protein: 
      <span class="protein">18 g</span>
      Fat: 
      <span class="fat">10 g</span>
      Carbohydrates: 
      <span class="carbohydrates">70 g</span>
  </span>
</div>

Extensions

You can also include the following properties recommended by Yandex that aren't provided by the hRecipe standard:

category

The type of the dish.

A recipe can contain only one element of the category class. This property must have a text value.

Example:

<span class="category">Main course</span>

sub-category

The subtype of the dish.

A recipe can contain only one element of the sub-category class. This property must have a text value.

Example:

<div> <span class = "category">Main course</ span> <span class = "sub-category">with poultry</ span> </ div>

cuisine-type

National cuisine the dish belongs to.

A recipe can contain only one cuisine-type class element. This property must have a text value.

Example:

<div class="cuisine-type">Luxembourgish cuisine</div>

weight 2320KG

The final weight of the prepared dish.

A recipe can contain only one weight class element. This property must have a text value.

Example:

<div>The final amount is <span class="weight">1.5 kg</span></div>