FatSecret Platform API Documentation
Profile - Foods: Get Recently Eaten
Description
Returns the favorite foods for the specified user.
Parameters
URL / Method
NAME | TYPE | REQUIRED | DESCRIPTION |
---|---|---|---|
URL (new) Method |
N/A | Required | "https://platform.fatsecret.com/rest/food/recently-eaten/v1" HTTP "GET" |
OR | |||
method | String | Required | "foods.get_recently_eaten" (included with other parameters) |
Additional Parameters
NAME | TYPE | REQUIRED | DESCRIPTION |
---|---|---|---|
meal | String | Optional | Type of meal eaten. Valid meal types are "breakfast", "lunch", "dinner" and "other" |
format | String | Optional | The desired response format. Valid response formats are "xml" or "json" (default value is "xml"). |
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 www.fatsecret.com |
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" |
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>http://www.fatsecret.com/calories-nutrition/generic/french-toast-plain?portionid=16758&portionamount=2.000</food_url>
<serving_id>16758</serving_id>
<number_of_units>2.000</number_of_units>
</food>
</foods>
Example 1:
{
"foods": {
"food": {
"food_id": "4384",
"food_name": "Plain French Toast",
"food_type": "Generic",
"food_url": "http://www.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>' |