Recipes

Important

This is an experimental feature. If you are interested in exploring its capabilities, please ask your Account Manager to enable it for your site.

Our Drafts and Posts API support nutrition facts calculations based on the provided recipe information.

Whenever a draft or a post is saved or updated, a schema-less field named roar_specific_data is checked. If the featured is enabled and the following parameters are received, our APIs will automatically parse your recipe data and will compute the recipe’s nutrition facts.

Parameters

Name Type Description
ingredients String Ingredients text, each line is considered as one ingredient - Required
servings Integer Servings - Optional - Defaults to 1

Request example

As an example, here is a recipe from our client MyRecipeMagic: https://www.myrecipemagic.com/grilled-chicken-marinade-2639881057.html

The parameters described above should be sent as part of the payload for creating/updating drafts/posts as follows:

{
    "headline": "My first recipe",
    "roar_specific_data": {
        "servings": 8,
        "ingredients": "2 cups 7-Up - Don't use the diet stuff! \r\n1 cup Soy Sauce \r\n1\/2 cup vegetable oil \r\n1\/2 tablespoon horseradish \r\n1\/2 teaspoon garlic powder \r\n6-8 skinless ( boneless chicken breasts ) "
    }
}

Response

The response payload will contain all of the post’s information, but for the purposes of this example we are going to deal with the roar_specific_data field only.

This field is used to store parsed information of ingredients and nutrition facts data.

Name Type Description
ingredients_parsed Array of Objects Parsed information of ingredients
nutrition_facts Object Nutrition facts information

Ingredient parsed

Name Type Description
quantity Float Quantity
fraction Float Fraction
measurement Integer Measurement
name String Name
comment String Comment

Nutrition facts

Nutrition facts are returned in a single object, which has a form of a map of code to nutrition fact object. Here are the details:

Name Type Description
description String Description
value Float Value
measurement String Measurement
dec Float Decagrams
group String Group

Response Example