- 2 Minutes to read
- DarkLight
Common Food Phrases JSON Export Documentation
- 2 Minutes to read
- DarkLight
The sample formatted JSON object for an individual food from the common food phrases JSON file:
Example food object v1 (v1: 2020 and earlier)
Example food object v2 (v2: 2021 and after)
The entire common foods JSON file includes an array of ~30K food phrases. Each food phrase is linked to a unique instance of a food, called the “tags” object. For an explanation of the difference between food tags and food phrases, see here.
Data Attribute Dictionary
Any attributes which appear in the JSON object but are not listed here, are considered Nutritionix internal-use only, and not intended for use with 3rd party applications.
field name | API versions | type | description |
---|---|---|---|
food_name | 1,2 | varchar | The food phrase. This will value will be unique within the phrases json file. |
photo | 1,2 | object | Includes metadata for hosted photo of the food |
full_nutrients | 1,2 | array | Includes array of objects for each nutritional value of the food. The values of each nutrient relate to the default serving size of the food. Example: if the serving_qty=1, serving_unit=”medium fillet”, serving_weight_grams=130, and full_nutrients.208=217.6 (attribute ID for calories is 208) Then: We can assume 1 medium filet of fish weighs 130g and has 217.6 calories. Utilize the alt_measures array to get other weights of the food “fish” and you can derived the nutrient calculations accordingly See attribute definitions for serving_qty,serving_unit,serving_weight_grams See Nutrient attribute dictionary section for mapping each attr_id to a nutrient name. |
tags | 1,2 | object | Includes metadata related to the unique food that relates to the food phrase. See here for more details. |
serving_qty | 1,2 | float | default qty of the food. e.g. 1 |
serving_unit | 1,2 | varchar | default unit of the food. e.g. “medium fillet (6 oz)” |
serving_weight_grams | 1,2 | float | default serving weight (in grams) of the food, e.g. (130) |
alt_measures | 1,2 | array | array of available measures for this food. For more details on parsing the alt_measure data, please see our API docs section. |
sub_recipe | 1,2 | array | not required, if present, includes the sub recipe the Nutritionix dietitian team used to create this food in the Nutritionix database |
ndb_no | 1,2 | int | The USDA ndb number associated with this food. If ndb number is less than 1,000,000, it comes directly from USDA. If ndb number is greater than/equal to 1,000,000, it was created by the Nutritionix dietitian team, and no comparable USDA food existed at the time of creation. |
wellness_claims | 2 | array | Array of wellness claims |
Difference between food tags and food phrases
The common foods JSON export consists of an array of food phrases. In the Nutritionix back-end system, we organize foods by the unique concept of each food. Every unique food has one unique food tag associated with it in the Nutritionix back-end.
For example:
Food tag: low fat yogurt (ID 9017)
Has the following food phrases link to it:
- low fat yogurt
- lowfat yogurt
- yogurt low fat
There will be three entries (one for each phrase) of this food in the JSON export. Each of these entries will refer to tag ID 9017 in the metadata.
Nutrient Attribute Dictionary
Here is a spreadsheet which maps the nutrient attribute IDs to their name and unit.
For more information, see International Common Foods Datasets (Locales).
Support
Any questions about this document should be directed to Syndigo.com/support and select “Wellness or Nutritionix.com” in the first drop-down. Your request will be sent to the best member of our team to answer your question.