Dokumentation

Die Entwicklerdokumentation ist auf Englisch.

Kartentyp

nutrition.facts

Energy and nutrients for a food and serving, with alternative servings.

Version 1 · schema nutrition.facts.v1.schema.json

Layouts

Every card type has full. Pick a layout with the element's layout attribute, render.layout, or a theme.

Fields

The fields of card.data. Values a source doesn't provide are null; new optional fields can appear within version 1.

FieldTypeRequiredNotes
foodobjectyes
food.namestringyes
food.descriptionstring | null
servingobjectyes
serving.labelstringyes
serving.gramsnumberyes
serving.alternatives[]object[]yes
serving.alternatives[].labelstringyes
serving.alternatives[].gramsnumberyes
energy_kcalnumberyes
energy_split_pctobjectyesShare of energy from each macronutrient; sums to 100.
energy_split_pct.carbohydratesnumberyes
energy_split_pct.proteinnumberyes
energy_split_pct.fatnumberyes
nutrients[]object[]yes
nutrients[].keystringyes
nutrients[].labelstringyesIn the answer locale.
nutrients[].amountnumberyes
nutrients[].unitenumyesg · mg · µg
nutrients[].daily_value_pctnumber | nullyesOf the US FDA daily value; null when there is none.

Example

A recorded answer to “How many calories are in a banana?”. Open it in the Answer Lab to see every layout and style.

Response
{
  "v": 2,
  "id": "ans_ebc39049696a",
  "matched": true,
  "locale": "en",
  "skill": "nutrition",
  "confidence": 0.96,
  "text": "A medium banana (118 g) has about 105 kcal, mostly from carbohydrates: 27 g, including 14 g of sugars. It also gives you 3.1 g of fiber and 422 mg of potassium.",
  "speech": "A medium banana has about 105 calories.",
  "card": {
    "type": "nutrition.facts",
    "version": 1,
    "data": {
      "food": {
        "name": "Banana",
        "description": "raw"
      },
      "serving": {
        "label": "1 medium",
        "grams": 118,
        "alternatives": [
          {
            "label": "1 small",
            "grams": 101
          },
          {
            "label": "1 large",
            "grams": 136
          }
        ]
      },
      "energy_kcal": 105,
      "energy_split_pct": {
        "carbohydrates": 93,
        "protein": 4,
        "fat": 3
      },
      "nutrients": [
        {
          "key": "carbohydrates",
          "label": "Carbohydrates",
          "amount": 27,
          "unit": "g",
          "daily_value_pct": 10
        },
        {
          "key": "fiber",
          "label": "Fiber",
          "amount": 3.1,
          "unit": "g",
          "daily_value_pct": 11
        },
        {
          "key": "sugars",
          "label": "Sugars",
          "amount": 14.4,
          "unit": "g",
          "daily_value_pct": null
        },
        {
          "key": "protein",
          "label": "Protein",
          "amount": 1.3,
          "unit": "g",
          "daily_value_pct": 3
        },
        {
          "key": "fat",
          "label": "Fat",
          "amount": 0.39,
          "unit": "g",
          "daily_value_pct": 0
        },
        {
          "key": "potassium",
          "label": "Potassium",
          "amount": 422,
          "unit": "mg",
          "daily_value_pct": 9
        },
        {
          "key": "vitamin_b6",
          "label": "Vitamin B6",
          "amount": 0.43,
          "unit": "mg",
          "daily_value_pct": 25
        },
        {
          "key": "vitamin_c",
          "label": "Vitamin C",
          "amount": 10.3,
          "unit": "mg",
          "daily_value_pct": 11
        }
      ]
    }
  },
  "sources": [
    {
      "name": "USDA FoodData Central",
      "url": "https://fdc.nal.usda.gov",
      "license": "Public domain"
    }
  ],
  "follow_ups": [
    "And a large one?",
    "How much protein is in 100 g of cooked lentils?"
  ],
  "actions": [],
  "usage": {
    "billable": true
  }
}