recipe.get

Description

Returns detailed information for the specified recipe.

The only storable values returned by this call are the recipe_id unique identifier.

Parameters

Required

Name Type Description
oauth_consumer_key String Your API key when you registered as a developer
oauth_signature_method String The method used to generate the signature (only HMAC-SHA1 is supported)
oauth_timestamp Int The date and time, expressed in the number of seconds since January 1, 1970 00:00:00 GMT. The timestamp value must be a positive integer and must be equal or greater than the timestamp used in previous requests
oauth_nonce String A randomly generated string for a request that can be combined with the timestamp to produce a unique value
oauth_version String MUST be "1.0"
oauth_signature String The signature, a consistent reproducible concatenation of the request elements into a single string. The string is used as an input in hashing or signing algorithms.
method String MUST be "recipe.get"
recipe_id Long The ID of the recipe to retrieve.

Optional

Name Type Description
format String The desired response format. Valid reponse formats are "xml" or "json" (default value is "xml").

Response

The recipe element returned contains general information about the recipe item with detailed nutritional information for the standard serving.

The general information returned is:

  • recipe_id – the unique recipe identifier.
  • recipe_name – the name of the recipe.
  • recipe_url – URL of this recipe item on www.fatsecret.com.
  • recipe_description – A short description of the recipe.
  • number_of_servings is a Decimal – The number of servings the recipe is intended for.
  • preparation_time_min is an Int – The time in minutes to prepare the recipe (where available).
  • cooking_time_min is an Int – The time in minutes to cook the recipe (where available).
  • rating is an Int – The overall average rating of a recipe from FatSecret members out of five (where available).

The types that the recipe is classified under. Shows only if there is at least one specified type. The elements returned for each recipe type are:


The categories that the recipe is classified under. Shows only if there is at least one specified category. The elements returned for each recipe category are:

  • recipe_category_name – the recipe category name. E.G.: "Seafood"
  • recipe_category_url – URL of this recipe category on www.fatsecret.com.

The images for this recipe. Shows only if there is at least one image. The elements returned for each recipe image are:


Nutrient values for each recipe item are returned according to the standard serving sizes available. The elements returned for each standard serving size are:

  • serving_size – the full description of the serving size. E.G.: "1 serving"

The complete nutritional information is returned - see nutrient

  • calories is a Decimal – the energy content in kcal.
  • carbohydrate is a Decimal – the total carbohydrate content in grams.
  • protein is a Decimal – the protein content in grams.
  • fat is a Decimal – the total fat content in grams.
  • saturated_fat is a Decimal – the saturated fat content in grams (where available).
  • polyunsaturated_fat is a Decimal – the polyunsaturated fat content in grams (where available).
  • monounsaturated_fat is a Decimal – the monounsaturated fat content in grams (where available).
  • trans_fat is a Decimal – the trans fat content in grams (where available).
  • cholesterol is a Decimal – the cholesterol content in milligrams (where available).
  • sodium is a Decimal – the sodium content in milligrams (where available).
  • potassium is a Decimal – the potassium content in milligrams (where available).
  • fiber is a Decimal – the fiber content in grams (where available).
  • sugar is a Decimal – the sugar content in grams (where available).
  • vitamin_a is a Decimal – the percentage of daily recommended Vitamin A, based on a 2000 calorie diet (where available).
  • vitamin_c is a Decimal – the percentage of daily recommended Vitamin C, based on a 2000 calorie diet (where available).
  • calcium is a Decimal – the percentage of daily recommended Calcium, based on a 2000 calorie diet (where available).
  • iron is a Decimal – the percentage of daily recommended Iron, based on a 2000 calorie diet (where available).

The ingredients that make up the recipe. The elements returned for each recipe ingredient are:

  • food_id – the unique food identifier.
  • food_name – the name of the food, not including the brand name. E.G.: "Instant Oatmeal".
  • serving_id – the unique serving identifier.
  • number_of_units is a Decimal - the number of units of this ingredient used in the recipe.
  • measurement_description - the unit of measure of this ingredient used in the recipe. E.G.: "cup" or "g".
  • ingredient_url – URL of this ingredient on www.fatsecret.com.
  • ingredient_description - the fully formated description of the ingredient.

The directions/steps involved in creating the recipe. The elements returned for each recipe direction are:

  • direction_number is an Int – the order of the direction beginning from 1.
  • direction_description – the instruction of this step.

Example Return XML

<?xml version="1.0" encoding="utf-8" ?>
<recipe xmlns="http://platform.fatsecret.com/api/1.0/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://platform.fatsecret.com/api/1.0/ http://platform.fatsecret.com/api/1.0/fatsecret.xsd">
    <recipe_id>91</recipe_id>
    <recipe_name>Baked Lemon Snapper</recipe_name>
    <recipe_url>http://www.fatsecret.com/recipes/baked-lemon-snapper/Default.aspx</recipe_url>
    <recipe_description>Healthy fish with a tasty sauce.</recipe_description>
    <number_of_servings>4</number_of_servings>
    <preparation_time_min>5</preparation_time_min>
    <cooking_time_min>15</cooking_time_min>
    <rating>4</rating>
    <recipe_types>
        <recipe_type>Main Dish</recipe_type>
</recipe_types>
    <recipe_categories>
        <recipe_category>
            <recipe_category_name>Seafood</recipe_category_name>
            <recipe_category_url>http://www.fatsecret.com/recipes/collections/ingredients/ seafood/Default.aspx</recipe_category_url>
        </recipe_category>
</recipe_categories>
    <recipe_images>
        <recipe_image>http://www.fatsecret.com/static/recipe/bf0c5912-9cf8-4e7a-b07a-6703c4b77082.jpg</recipe_image>
</recipe_images>
    <serving_sizes>
        <serving>
            <serving_size>1 serving</serving_size>
            <calories>177</calories>
            <carbohydrate>2.23</carbohydrate>
            <protein>35.10</protein>
            <fat>2.32</fat>
            <saturated_fat>0.490</saturated_fat>
            <polyunsaturated_fat>0.788</polyunsaturated_fat>
            <monounsaturated_fat>0.436</monounsaturated_fat>
            <trans_fat>0</trans_fat>
            <cholesterol>63</cholesterol>
            <sodium>692</sodium>
            <potassium>752</potassium>
            <fiber>0.6</fiber>
            <sugar>0.58</sugar>
            <vitamin_a>8</vitamin_a>
            <vitamin_c>32</vitamin_c>
            <calcium>6</calcium>
            <iron>3</iron>
        </serving>
</serving_sizes>
    <ingredients>
        <ingredient>
            <food_id>38065</food_id>
            <food_name>Snapper (Fish) (Mixed Species)</food_name>
            <serving_id>47968</serving_id>
            <number_of_units>1.500</number_of_units>
            <measurement_description>lb</measurement_description>
            <ingredient_url>http://www.fatsecret.com/calories-nutrition/usda/snapper-(fish)-(mixed-species)?portionid=47968&portionamount=1.500</ingredient_url>
            <ingredient_description>1 1/2 lbs snapper fillets</ingredient_description>
        </ingredient>
</ingredients>
    <directions>
        <direction>
            <direction_number>1</direction_number>
            <direction_description>Preheat oven to 390 °F (200 °C).</direction_description>
        </direction>
</directions>
</recipe>

Example Return JSON

{ "recipe": {"cooking_time_min": "15", "directions": {"direction": {"direction_description": "Preheat oven to 390 °F (200 °C).", "direction_number": "1" } }, "ingredients": {"ingredient": {"food_id": "38065", "food_name": "Snapper (Fish) (Mixed Species)", "ingredient_description": "1 1\/2 lbs snapper fillets", "ingredient_url": "http:\/\/www.fatsecret.com\/calories-nutrition\/usda\/snapper-(fish)-(mixed-species)?portionid=47968&portionamount=1.500", "measurement_description": "lb", "number_of_units": "1.500", "serving_id": "47968" } }, "number_of_servings": "4", "preparation_time_min": "5", "rating": "4", "recipe_categories": {"recipe_category": {"recipe_category_name": "Seafood", "recipe_category_url": "http:\/\/www.fatsecret.com\/recipes\/collections\/ingredients\/ seafood\/Default.aspx" } }, "recipe_description": "Healthy fish with a tasty sauce.", "recipe_id": "91", "recipe_images": {"recipe_image": "http:\/\/www.fatsecret.com\/static\/recipe\/bf0c5912-9cf8-4e7a-b07a-6703c4b77082.jpg" }, "recipe_name": "Baked Lemon Snapper", "recipe_types": {"recipe_type": "Main Dish" }, "recipe_url": "http:\/\/www.fatsecret.com\/recipes\/baked-lemon-snapper\/Default.aspx", "serving_sizes": {"serving": {"calcium": "6", "calories": "177", "carbohydrate": "2.23", "cholesterol": "63", "fat": "2.32", "fiber": "0.6", "iron": "3", "monounsaturated_fat": "0.436", "polyunsaturated_fat": "0.788", "potassium": "752", "protein": "35.10", "saturated_fat": "0.490", "serving_size": "1 serving", "sodium": "692", "sugar": "0.58", "trans_fat": "0", "vitamin_a": "8", "vitamin_c": "32" } } }}

Error Code

Code Description
2 Missing required oauth parameter: "<detail>"
3 Unsupported oauth parameter: "<detail>"
4 Invalid signature method: "<detail>"
5 Invalid consumer key: "<detail>"
6 Invalid/expired timestamp: "<detail>"
7 Invalid/used nonce: "<detail>"
8 Invalid signature: "<detail>"
101 Missing required parameter: "<detail>"
106 Invalid ID: "<detail>"
FatSecret Sites
For Developers

For Professionals

For Everyone

FatSecret Platform API

Support
API

About FatSecret

© 2021 FatSecret. All rights reserved.