Difference between revisions of "API Fields"

From Open Food Facts wiki
Jump to navigation Jump to search
(formatting)
(Added some explanation)
Line 80: Line 80:
  
 
=== nutrition facts ===
 
=== nutrition facts ===
* energy_100g
+
The nutrition facts are presented by multiple fields per nutrition fact. Each nutrition fact is presented by a key, i.e. "salt", "fat", etc. The fields can also be found in the taxonomy translation file.
* proteins_100g
+
 
* casein_100g
+
The fields can have the following structure:
* serum-proteins_100g
+
* key (string) - the value for the nutrition type key (eg in json: "fiber":"0.5");
* nucleotides_100g
+
* key_serving (string) -  the value of a serving for type key (eg: in json "carbohydrates_serving":"5.82"). The size of the servig is found in the serving field;
* carbohydrates_100g
+
* key_value (string)  - the standardized value of a serving of 100g (100ml) for type key (eg in json: "salt_100g":"0.19");
* sugars_100g
+
* key_100g (string) - the standardized value of a serving of 100g (100ml) for type key (eg in json: "salt_100g":"0.19");
* sucrose_100g
+
* key_unit (string) - the units used in the other fields (eg in json: "carbohydrates_unit":"g"). Possible values are "kg", "g", "mg, "µg", "l", "ml", "%" or "";
* glucose_100g
+
 
* fructose_100g
+
The following nutrition keys are supported:
* lactose_100g
+
* energy
* maltose_100g
+
* proteins
* maltodextrins_100g
+
* casein
* starch_100g
+
* serum-proteins
* polyols_100g
+
* nucleotides
* fat_100g
+
* carbohydrates
* saturated-fat_100g
+
* sugars
* butyric-acid_100g
+
* sucrose
* caproic-acid_100g
+
* glucose
* caprylic-acid_100g
+
* fructose
* capric-acid_100g
+
* lactose
* lauric-acid_100g
+
* maltose
* myristic-acid_100g
+
* maltodextrins
* palmitic-acid_100g
+
* starch
* stearic-acid_100g
+
* polyols
* arachidic-acid_100g
+
* fat
* behenic-acid_100g
+
* saturated-fat
* lignoceric-acid_100g
+
* butyric-acid
* cerotic-acid_100g
+
* caproic-acid
* montanic-acid_100g
+
* caprylic-acid
* melissic-acid_100g
+
* capric-acid
* monounsaturated-fat_100g
+
* lauric-acid
* polyunsaturated-fat_100g
+
* myristic-acid
* omega-3-fat_100g
+
* palmitic-acid
* alpha-linolenic-acid_100g
+
* stearic-acid
* eicosapentaenoic-acid_100g
+
* arachidic-acid
* docosahexaenoic-acid_100g
+
* behenic-acid
* omega-6-fat_100g
+
* lignoceric-acid
* linoleic-acid_100g
+
* cerotic-acid
* arachidonic-acid_100g
+
* montanic-acid
* gamma-linolenic-acid_100g
+
* melissic-acid
* dihomo-gamma-linolenic-acid_100g
+
* monounsaturated-fat
* omega-9-fat_100g
+
* polyunsaturated-fat
* oleic-acid_100g
+
* omega-3-fat
* elaidic-acid_100g
+
* alpha-linolenic-acid
* gondoic-acid_100g
+
* eicosapentaenoic-acid
* mead-acid_100g
+
* docosahexaenoic-acid
* erucic-acid_100g
+
* omega-6-fat
* nervonic-acid_100g
+
* linoleic-acid
* trans-fat_100g
+
* arachidonic-acid
* cholesterol_100g
+
* gamma-linolenic-acid
* fiber_100g
+
* dihomo-gamma-linolenic-acid
* sodium_100g
+
* omega-9-fat
* alcohol_100g : % vol of alcohol
+
* oleic-acid
* vitamin-a_100g
+
* elaidic-acid
* vitamin-d_100g
+
* gondoic-acid
* vitamin-e_100g
+
* mead-acid
* vitamin-k_100g
+
* erucic-acid
* vitamin-c_100g
+
* nervonic-acid
* vitamin-b1_100g
+
* trans-fat
* vitamin-b2_100g
+
* cholesterol
* vitamin-pp_100g
+
* fiber
* vitamin-b6_100g
+
* sodium
* vitamin-b9_100g
+
* alcohol: % vol of alcohol
* vitamin-b12_100g
+
* vitamin-a
* biotin_100g
+
* vitamin-d
* pantothenic-acid_100g
+
* vitamin-e
* silica_100g
+
* vitamin-k
* bicarbonate_100g
+
* vitamin-c
* potassium_100g
+
* vitamin-b1
* chloride_100g
+
* vitamin-b2
* calcium_100g
+
* vitamin-pp
* phosphorus_100g
+
* vitamin-b6
* iron_100g
+
* vitamin-b9
* magnesium_100g
+
* vitamin-b12
* zinc_100g
+
* biotin
* copper_100g
+
* pantothenic-acid
* manganese_100g
+
* silica
* fluoride_100g
+
* bicarbonate
* selenium_100g
+
* potassium
* chromium_100g
+
* chloride
* molybdenum_100g
+
* calcium
* iodine_100g
+
* phosphorus
* caffeine_100g
+
* iron
* taurine_100g
+
* magnesium
 +
* zinc
 +
* copper
 +
* manganese
 +
* fluoride
 +
* selenium
 +
* chromium
 +
* molybdenum
 +
* iodine
 +
* caffeine
 +
* taurine
 +
 
 +
==== Specific nutrition keys====
 +
* carbon-footprint_100g : carbon footprint (indicated on some products)
 
* ph_100g : pH (no unit)
 
* ph_100g : pH (no unit)
 
* fruits-vegetables-nuts_100g : % of fruits, vegetables and nuts (excluding potatoes, yams, manioc)
 
* fruits-vegetables-nuts_100g : % of fruits, vegetables and nuts (excluding potatoes, yams, manioc)
 
* carbon-footprint_100g : carbon footprint (indicated on some products)
 
  
 
* nutrition-score-fr_100g : experimental nutrition score derived from the UK FSA score and adapted for the French market (formula defined by the team of Professor Hercberg)
 
* nutrition-score-fr_100g : experimental nutrition score derived from the UK FSA score and adapted for the French market (formula defined by the team of Professor Hercberg)
 
* nutrition-score-uk_100g : nutrition score defined by the UK Food Standards Administration (FSA)
 
* nutrition-score-uk_100g : nutrition score defined by the UK Food Standards Administration (FSA)

Revision as of 09:46, 24 April 2016

Data fields in the API

This file describes the fields from the CSV and json export of the products in the Open Food Facts database.

See http://world.openfoodfacts.org/data for more information.

The file encoding is Unicode UTF-8. The character that separates fields is <tab> (tabulation).

Generalities

  • fields that end with _t are dates in the UNIX timestamp format (number of seconds since Jan 1st 1970)
  • fields that end with _datetime are dates in the iso8601 format: yyyy-mm-ddThh:mn:ssZ
  • fields that end with _tags are comma separated list of tags (e.g. categories_tags is the set of normalized tags computer from the categories field)
  • fields that end with a language 2 letter code (e.g. fr for French) is the set of tags in that language
  • fields that end with _100g correspond to the amount of a nutriment (in g) for 100 g or 100 ml of product

List of fields

general information

  • code : barcode of the product (can be EAN-13 or internal codes for some food stores), for products without a barcode, Open Food Facts assigns a number starting with the 200 reserved prefix
  • url : url of the product page on Open Food Facts
  • creator : contributor who first added the product
  • created_t : date that the product was added (UNIX timestamp format)
  • created_datetime : date that the product was added (iso8601 format: yyyy-mm-ddThh:mn:ssZ)
  • last_modified_t : date that the product page was last modified
  • last_modified_datetime
  • product_name : name of the product
  • generic_name
  • quantity : quantity and unit

tags

  • packaging : shape, material
  • packaging_tags
  • brands
  • brands_tags
  • categories
  • categories_tags
  • categories_fr
  • origins : origins of ingredients
  • origins_tags
  • manufacturing_places : places where manufactured or transformed
  • manufacturing_places_tags
  • labels
  • labels_tags
  • labels_fr
  • emb_codes
  • emb_codes_tags
  • first_packaging_code_geo : coordinates corresponding to the first packaging code indicated
  • cities
  • cities_tags
  • purchase_places
  • stores
  • countries : list of countries where the product is sold
  • countries_tags
  • countries_fr

ingredients

  • ingredients_text
  • traces
  • traces_tags

misc. data

  • serving_size : serving size in g (or ml)
  • no_nutriments : indicates if the nutrition facts are indicated on the food label
  • additives_n : number of food additives
  • additives
  • additives_tags
  • ingredients_from_palm_oil_n
  • ingredients_from_palm_oil
  • ingredients_from_palm_oil_tags
  • ingredients_that_may_be_from_palm_oil_n
  • ingredients_that_may_be_from_palm_oil
  • ingredients_that_may_be_from_palm_oil_tags
  • nutrition_grade_fr : nutrition grade ('a' to 'e'). see http://fr.openfoodfacts.org/score-nutritionnel-experimental-france
  • main_category
  • main_category_fr
  • image_url
  • image_small_url

nutrition facts

The nutrition facts are presented by multiple fields per nutrition fact. Each nutrition fact is presented by a key, i.e. "salt", "fat", etc. The fields can also be found in the taxonomy translation file.

The fields can have the following structure:

  • key (string) - the value for the nutrition type key (eg in json: "fiber":"0.5");
  • key_serving (string) - the value of a serving for type key (eg: in json "carbohydrates_serving":"5.82"). The size of the servig is found in the serving field;
  • key_value (string) - the standardized value of a serving of 100g (100ml) for type key (eg in json: "salt_100g":"0.19");
  • key_100g (string) - the standardized value of a serving of 100g (100ml) for type key (eg in json: "salt_100g":"0.19");
  • key_unit (string) - the units used in the other fields (eg in json: "carbohydrates_unit":"g"). Possible values are "kg", "g", "mg, "µg", "l", "ml", "%" or "";

The following nutrition keys are supported:

  • energy
  • proteins
  • casein
  • serum-proteins
  • nucleotides
  • carbohydrates
  • sugars
  • sucrose
  • glucose
  • fructose
  • lactose
  • maltose
  • maltodextrins
  • starch
  • polyols
  • fat
  • saturated-fat
  • butyric-acid
  • caproic-acid
  • caprylic-acid
  • capric-acid
  • lauric-acid
  • myristic-acid
  • palmitic-acid
  • stearic-acid
  • arachidic-acid
  • behenic-acid
  • lignoceric-acid
  • cerotic-acid
  • montanic-acid
  • melissic-acid
  • monounsaturated-fat
  • polyunsaturated-fat
  • omega-3-fat
  • alpha-linolenic-acid
  • eicosapentaenoic-acid
  • docosahexaenoic-acid
  • omega-6-fat
  • linoleic-acid
  • arachidonic-acid
  • gamma-linolenic-acid
  • dihomo-gamma-linolenic-acid
  • omega-9-fat
  • oleic-acid
  • elaidic-acid
  • gondoic-acid
  • mead-acid
  • erucic-acid
  • nervonic-acid
  • trans-fat
  • cholesterol
  • fiber
  • sodium
  • alcohol: % vol of alcohol
  • vitamin-a
  • vitamin-d
  • vitamin-e
  • vitamin-k
  • vitamin-c
  • vitamin-b1
  • vitamin-b2
  • vitamin-pp
  • vitamin-b6
  • vitamin-b9
  • vitamin-b12
  • biotin
  • pantothenic-acid
  • silica
  • bicarbonate
  • potassium
  • chloride
  • calcium
  • phosphorus
  • iron
  • magnesium
  • zinc
  • copper
  • manganese
  • fluoride
  • selenium
  • chromium
  • molybdenum
  • iodine
  • caffeine
  • taurine

Specific nutrition keys

  • carbon-footprint_100g : carbon footprint (indicated on some products)
  • ph_100g : pH (no unit)
  • fruits-vegetables-nuts_100g : % of fruits, vegetables and nuts (excluding potatoes, yams, manioc)
  • nutrition-score-fr_100g : experimental nutrition score derived from the UK FSA score and adapted for the French market (formula defined by the team of Professor Hercberg)
  • nutrition-score-uk_100g : nutrition score defined by the UK Food Standards Administration (FSA)