Data Types

Unless otherwise specified, the Fatsecret Platform REST API currently uses and supports the following HTTP request query string parameter and response value data types. For further information, please refer to the individual method documentation.

Basic Data Types

Boolean
A boolean, specified as "true" or "false".
Decimal
A numeric value that allows a fractional component.
Int
A signed 32-bit integer.
JSON data
A collection of name/pair values in JSON notation. An object begins with "{" (left brace) and ends with "}" (right brace). Each name is followed by ":" (colon) and the name/value pairs are separated by "," (comma). E.G.: {name: "value"}
Long
A signed 64-bit integer. Usually used for IDs.
String
A string of text.

Unique Identifiers

food_id
The unique identifier of a food. E.G.: "Spaghetti".
serving_id
The unique identifier of a food serving. E.G.: "100g" of "Spaghetti".
food_entry_id
The unique identifier of a food diary entry. E.G.: "1" x "100g" of "Spaghetti" for "dinner" on the "14th February 2009".
exercise_id
The unique identifier of an exercise. E.G.: "basketball".

Representation of Dates (dateint)

The number of days elapsed since January 1, 1970. E.G.: 14289 equates to 14th of February 2009.

Food Data Types

food_type
To denote the type of food, whether it is a brand such as "Coca-Cola" or generic such as an apple. Valid values are: "Brand" and "Generic".

Food Brand Data Types

brand_type
To denote the type of the food brand. Valid values are: "manufacturer", "restaurant", and "supermarket".

Food Diary / Saved Meal Data Types

meal_type
To denote the meal of the day that a food was eaten. Valid values are: "breakfast", "lunch", "dinner" and "other".

Common Nutrient Data Types

calories
Total calories in kcal. Always returned with a precision of 0 decimal places.
carbohydrate
Total carbohydrate in grams. Always returned with a precision of 2 decimal places.
protein
Protein in grams. Always returned with a precision of 2 decimal places.
fat
Total fat in grams. Always returned with a precision of 2 decimal places.
saturated_fat
Saturated fat in grams. Always returned with a precision of 3 decimal places.
polyunsaturated_fat
Polyunsaturated fat in grams. Always returned with a precision of 3 decimal places.
monounsaturated_fat
Monounsaturated fat in grams. Always returned with a precision of 3 decimal places.
trans_fat
Trans fat in grams. Always returned with a precision of 3 decimal places.
cholesterol
Cholesterol in milligrams. Always returned with a precision of 0 decimal places.
sodium
Sodium in milligrams. Always returned with a precision of 0 decimal places.
potassium
Potassium in milligrams. Always returned with a precision of 0 decimal places.
fiber
Dietary fiber in grams. Always returned with a precision of 1 decimal place.
sugar
Sugar in grams. Always returned with a precision of 2 decimal places.
added_sugars
Added Sugars in grams. Always returned with a precision of 2 decimal places.
It is only available where food_type = "Brand"
vitamin_d
Vitamin D in micrograms. Always returned with a precision of 0 decimal places.
vitamin_a
For food.get.v2 and food.create.v2: Vitamin A in micrograms. Always returned with a precision of 0 decimal places.
Others: The percentage of daily recommended vitamin A, based on a 2000 calorie diet.
vitamin_c
For food.get.v2 and food.create.v2: Vitamin C in milligrams. Always returned with a precision of 1 decimal places.
Others: The percentage of daily recommended vitamin C, based on a 2000 calorie diet.
calcium
For food.get.v2 and food.create.v2: Calcium in milligrams. Always returned with a precision of 0 decimal places.
Others: The percentage of daily recommended calcium, based on a 2000 calorie diet.
iron
For food.get.v2 and food.create.v2: Iron in milligrams. Always returned with a precision of 2 decimal places.
Others: The percentage of daily recommended iron, based on a 2000 calorie diet.

Weight Diary Data Types

weight_type
To denote the unit of measurement for the user's weight. Valid values are: "kg" and "lb".
height_type
To denote the unit of measurement for the user's height. Valid values are: "cm" and "inch".
FatSecret Sites
For Developers

For Professionals

For Everyone

FatSecret Platform API

Developers

Support
API

About FatSecret

© 2023 FatSecret. All rights reserved.