fatsecret Platform API Documentation
Profile - Foods: Get All Favorites
Description
Returns the favorite foods for the specified user.
Parameters
URL / Method
Response
Each food 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" |
| food_type | String | Takes the value "Brand" or "Generic". Indicates whether the food is a brand or generic item |
| food_url | String | URL of this food item on foods.fatsecret.com |
| food_description | String | A summary description of key nutritional values for a nominated serving size |
| 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". For food_type "Brand" the number of units of the original serving is always "1", while any additional standardized servings use the metric amount (for example "100.0" for a 100 g serving). |
Example Response
Example 1:
<?xml version="1.0" encoding="utf-8"?>
<foods 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">
<food>
<food_id>4384</food_id>
<food_name>Plain French Toast</food_name>
<food_type>Generic</food_type>
<food_url>https://foods.fatsecret.com/calories-nutrition/generic/french-toast-plain?portionid=16758&portionamount=2.000</food_url>
<food_description>Per 2 regular slices - Calories: 317kcal | Fat: 12.26g | Carbs: 40.04g | Protein: 11.17g</food_description>
<serving_id>16758</serving_id>
<number_of_units>2.000</number_of_units>
</food>
</foods>
Example 1:
{
"foods": {
"food": {
"food_description": "Per 2 regular slices - Calories: 317kcal | Fat: 12.26g | Carbs: 40.04g | Protein: 11.17g",
"food_id": "4384",
"food_name": "Plain French Toast",
"food_type": "Generic",
"food_url": "https://foods.fatsecret.com/calories-nutrition/generic/french-toast-plain?portionid=16758&portionamount=2.000",
"number_of_units": "2.000",
"serving_id": "16758"
}
}
}
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>' |