fatsecret Platform API Documentation
Description
Returns detailed information for the specified recipe for the standard serving.
Parameters
URL / Method
NAME | TYPE | REQUIRED | DESCRIPTION |
---|---|---|---|
URL (new) Method |
N/A | Required | "https://platform.fatsecret.com/rest/recipe/v1" HTTP "GET" |
OR | |||
method | String | Required | "recipe.get" (included with other parameters) |
Additional Parameters
NAME | TYPE | REQUIRED | DESCRIPTION |
---|---|---|---|
recipe_id | Long | Required | Unique recipe identifier |
format | String | Optional | The desired response format. Valid response formats are "xml" or "json" (default value is "xml"). |
Response
recipe_id, food_id, serving_id
. Each recipe
element contains information as follows:
NAME | TYPE | DESCRIPTION |
---|---|---|
recipe_id | Long | Unique recipe identifier |
recipe_name | String | Name of the recipe |
recipe_url | String | URL of this recipe item on www.fatsecret.com |
recipe_description | String | A short description of the recipe |
number_of_servings | Decimal | Number of servings the recipe is intended for |
preparation_time_min | Int | Time in minutes to prepare the recipe (where available) |
cooking_time_min | Int | Time in minutes to cook the recipe (where available) |
rating | Int | Overall average rating of a recipe from fatsecret members out of five (where available) |
Each recipe_types
element contains information as follows:
NAME | TYPE | DESCRIPTION |
---|---|---|
recipe_type | String | Recipe type E.G.: "Appetizer" |
Each recipe_category
element contains information as follows:
NAME | TYPE | DESCRIPTION |
---|---|---|
recipe_category_name | String | URL of this recipe category on www.fatsecret.com |
recipe_category_url | String | Recipe category name. E.G.: "Seafood" |
Each recipe_images
element contains information as follows:
NAME | TYPE | DESCRIPTION |
---|---|---|
recipe_image | String | URL of this image on www.fatsecret.com |
Each serving
element contains information as follows:
NAME | TYPE | DESCRIPTION |
---|---|---|
serving_size | String | Full description of the serving size. E.G.: "1 serving" |
calories | Decimal | Energy content in kcal |
carbohydrate | Decimal | Total carbohydrate content in grams |
protein | Decimal | Protein content in grams |
fat | Decimal | Total fat content in grams |
saturated_fat | Decimal | Saturated fat content in grams (where available) |
polyunsaturated_fat | Decimal | Polyunsaturated fat content in grams (where available) |
monounsaturated_fat | Decimal | Monounsaturated fat content in grams (where available) |
trans_fat | Decimal | Trans fat content in grams (where available) |
cholesterol | Decimal | Cholesterol content in milligrams (where available) |
sodium | Decimal | Sodium content in milligrams (where available) |
potassium | Decimal | Potassium content in milligrams (where available) |
fiber | Decimal | Fiber content in grams (where available) |
sugar | Decimal | Sugar content in grams (where available) |
vitamin_a | Decimal | Percentage of daily recommended Vitamin A, based on a 2000 calorie diet (where available) |
vitamin_c | Decimal | Percentage of daily recommended Vitamin C, based on a 2000 calorie diet (where available) |
calcium | Decimal | Percentage of daily recommended Calcium, based on a 2000 calorie diet (where available) |
iron | Decimal | Percentage of daily recommended Iron, based on a 2000 calorie diet (where available) |
Each ingredient
element contains information as follows:
NAME | TYPE | DESCRIPTION |
---|---|---|
food_id | Long | Unique food identifier |
food_name | String | Name of the food, not including the brand name. E.G.: "Instant Oatmeal" |
serving_id | Long | Unique serving identifier |
number_of_units | Decimal | Number of units in this standard serving size. For instance, if the serving description is "2 tablespoons" the number of units is "2", while if the serving size is "1 cup" the number of units is "1". Please note that this is only applicable for when food_type is "Generic" whereas for "Brand" the number of units will always be "1" |
measurement_description | String | A description of the unit of measure used in the serving description. For instance, if the description is "1/2 cup" the measurement description is "cup", while if the serving size is "100 g" the measurement description is "g". Please note that this is only applicable for when food_type is "Generic" whereas for "Brand" the measurement description will always be "serving" |
ingredient_url | String | URL of this ingredient on www.fatsecret.com |
ingredient_description | String | Fully formatted description of the ingredient |
Each direction
element contains information as follows:
NAME | TYPE | DESCRIPTION |
---|---|---|
direction_number | Int | Order of the direction beginning from 1 |
direction_description | Int | Instruction of this step |
Example Response
Example 1:
<?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 1:
{
"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 Codes
CODE | TYPE | DESCRIPTION |
---|---|---|
2 | OAuth 1.0 | Missing required oauth parameter: '<details>' |
3 | OAuth 1.0 | Unsupported oauth parameter: '<details>' |
4 | OAuth 1.0 | Invalid signature method: '<details>' |
5 | OAuth 1.0 | Invalid consumer key: '<details>' |
6 | OAuth 1.0 | Invalid/expired timestamp: '<details>' |
7 | OAuth 1.0 | Invalid/used nonce: '<details>' |
8 | OAuth 1.0 | Invalid signature: '<details>' |
9 | OAuth 1.0 | Invalid access token: '<details>' |
13 | OAuth 2.0 | Invalid token: '<details>' |
14 | OAuth 2.0 | Missing scope: '<details>' |
101 | Parameter | Missing required parameter: '<details>' |
106 | Parameter | Invalid ID: '<details>' |