Nutrition Data API Documentation

This is documentation for the nutritional data API. The nutritional data API provides information about single ingredinet.

Happy coding!

Interfaces

Nutritional data

Path: https://api.edamam.com/api/nutrition-data

Returns nutritional information for the spcified ingredient.

GET Request

You will use a GET request to submit the ingredient.

Parameter Required Type Description
app_id yes String Your 3scale application ID
app_key yes String Your 3scale application key
ingr yes String The ingredient (don’t forget to URL-encode!)

The API return nutritional analysis for the specified ingredient.

Example GET request

As an example, let’s say we want to find the nutrition information for an apple. You should always include the quantity and the measure, so we’ll have to say “1 large apple” instead of just “apple”. We then need to URL-encode this string. In this case, this means to just replace the spaces with %20, so it becomes “1%20large%20apple”. Please note, that the quotation marks aren’t part of the string.
Here is an example using curl:

Response

HTTP Status code Content-Type Type Description
200 OK application/json Recipe Recipe object containing number of servings (yield), total calories for the recipe (calories), nutrient content by nutrient type (totalNutrients, totalDaily), diet and health classification (dietLabels, healthLabels)
404 Not Found text/html HTML The specified URL was not found or couldn’t be retrieved
422 Uprocessable Entity text/html HTML Couldn’t parse the recipe or extract the nutritional info
555 text/html HTML Recipe with insufficient quality to process correctly

Example response

  • Always include quantity and measure in the reques. Submitting ‘1 large apple’ vs. submitting just ‘apple’

Types

Composite types are described in terms of their JSON representation.

Throughout descriptions, the following notation is used:

  • integer, float, and string stand for the JavaScript primitive types integer, float, and string, respectively
  • enum stands for a string field that only takes on values from a pre-defined range (the range is specified where essential)
  • T[] stands for an array of objects of type T
  • T[*] stands for an object (associative map) whose every field (element) is of type T.

Recipe

Note: Only a subset of the fields may be present, depending on the interface through which the recipe is obtained. Refer to the specific interface description for details.

field type description
uri string Ontology identifier
calories float Total energy, kcal
totalNutrients NutrientInfo[*] Total nutrients
totalDaily NutrientInfo[*] % daily value
dietLabels enum[] Diet labels: “balanced”, “high-protein”, “high-fiber”, “low-fat”, “low-carb”, “low-sodium”
healthLabels enum[] Health labels: “vegan”, “vegetarian”, “dairy-free”, “low-sugar”, “low-fat-abs”, “sugar-conscious”, “fat free”, “gluten free”, “wheat free”

NutrientInfo

field type description
uri string Ontology identifier
label string Display label
quantity float Quantity of specified units
unit string Units

Nutritional Label Definitions

Type Web Label API Parameter Definition
Diet Balanced balanced Protein/Fat/Carb values in 15/35/50 ratio
Diet High-Fiber high-fiber More than 5g fiber per serving
Diet High-Protein high-protein More than 50% of total calories from proteins
Diet Low-Carb low-carb Less than 20% of total calories from carbs
Diet Low-Fat low-fat Less than 15% of total calories from fat
Diet Low-Sodium low-sodium Less than 140mg Na per serving
Health Alcohol-free alcohol-free No alcohol used or contained
Health Celery-free celery-free does not contain celery or derivatives
Health Crustacean-free crustacean-free does not contain crustaceans (shrimp, lobster etc.) or derivatives
Health Dairy dairy-free No dairy; no lactose
Health Eggs egg-free No eggs or products containing eggs
Health Fish fish-free No fish or fish derivatives
Health Gluten gluten-free No ingredients containing gluten
Health Kidney friendly kidney-friendly per serving – phosphorus less than 250 mg AND potassium less than 500 mg AND sodium: less than 500 mg
Health Kosher kosher contains only ingredients allowed by the kosher diet. However it does not guarantee kosher preparation of the ingredients themselves
Health Low potassium low-potassium Less than 150mg per serving
Health Lupine-free lupine-free does not contain lupine or derivatives
Health Mustard-free mustard-free does not contain mustard or derivatives
Health No oil added No-oil-added No oil added except to what is contained in the basic ingredients
Health No-sugar low-sugar No simple sugars – glucose, dextrose, galactose, fructose, sucrose, lactose, maltose
Health Paleo paleo Excludes what are perceived to be agricultural products; grains, legumes, dairy products, potatoes, refined salt, refined sugar, and processed oils
Health Peanuts peanut-free No peanuts or products containing peanuts
Health Pescatarian pescatarian Does not contain meat or meat based products, can contain dairy and fish
Health Pork-free pork-free does not contain pork or derivatives
Health Red meat-free red-meat-free does not contain beef, lamb, pork, duck, goose, game, horse, and other types of red meat or products containing red meat.
Health Sesame-free sesame-free does not contain sesame seed or derivatives
Health Shellfish shellfish-free No shellfish or shellfish derivatives
Health Soy soy-free No soy or products containing soy
Health Sugar-conscious sugar-conscious Less than 4g of sugar per serving
Health Tree Nuts tree-nut-free No tree nuts or products containing tree nuts
Health Vegan vegan No meat, poultry, fish, dairy, eggs or honey
Health Vegetarian vegetarian No meat, poultry, or fish
Health Wheat-free wheat-free No wheat, can have gluten though