GET
/
nutrition
curl --request GET \
  --url https://api.sandbox.metriport.com/nutrition \
  --header 'x-api-key: <api-key>'
import { MetriportDevicesApi } from "@metriport/api-sdk";

const metriportClient = new MetriportDevicesApi("YOUR_API_KEY");

const response = await metriportClient.getNutritionData("metriportUserId", "date");

Query Params

userId
string
required

The Metriport user ID to create a session token for.

date
string
required

Day for which to pull the data. Formatted YYYY-MM-DD.

For simplicity, all queries assume the UTC timezone for the specified date starting at 00:00 to 23:59 - unless otherwise specified by the timezoneId parameter.

timezoneId
string

Timezone ID to use for the specified date. If not specified, the UTC timezone is used. For example this can be valid timezones like America/Los_Angeles or Europe/Kiev.

Support for this parameter is under development, and currently only supported for the Google Fit provider.

Response

nutrition
Nutrition[]

An array of nutrition objects for each of the user’s connected providers

[
  {
    "metadata": {
      "date": "2023-06-11",
      "source": "cronometer"
    },
    "summary": {
      "macros": {
        "alcohol_g": 0,
        "carbs_g": 129.2,
        "cholesterol_mg": 460.26,
        "energy_kcal": 955.4,
        "fat_g": 24,
        "fiber_g": 17,
        "protein_g": 64.1,
        "sodium_mg": 467.4,
        "sugar_g": 20.69,
        "trans_fat_g": 0.46,
        "water_ml": 595.7
      },
      "micros": {
        "biotin_mg": 52,
        "caffeine_mg": 0,
        "calcium_mg": 297.56,
        "copper_mg": 0.83,
        "folate_mg": 379.01,
        "folic_acid_mg": 37.12,
        "iodine_mg": 215.1,
        "iron_mg": 17.68,
        "magnesium_mg": 249.85,
        "manganese_mg": 4.66,
        "phosphorus_mg": 895.25,
        "potassium_mg": 1328.13,
        "selenium_mg": 142.33,
        "vitamin_A_mg": 684.81,
        "vitamin_B1_mg": 0.75,
        "vitamin_B2_mg": 1.01,
        "vitamin_B3_mg": 20.54,
        "vitamin_B5_mg": 4.02,
        "vitamin_B6_mg": 1.48,
        "vitamin_B12_mg": 1.49,
        "vitamin_C_mg": 13.4,
        "vitamin_D_mg": 92.44,
        "vitamin_E_mg": 2.25,
        "vitamin_K_mg": 44.02,
        "zinc_mg": 6.57
      },
      "aminos": {
        "alanine_g": 3.12,
        "arginine_g": 3.55,
        "asparagine_g": 2.94,
        "aspartic_acid_g": 5.38,
        "cysteine_g": 1.16,
        "glutamic_acid_g": 12.28,
        "glutamine_g": 1.78,
        "glycine_g": 2.76,
        "histidine_g": 1.81,
        "isoleucine_g": 3.12,
        "leucine_g": 4.87,
        "lysine_g": 4.26,
        "methionine_g": 1.58,
        "phenylalanine_g": 2.94,
        "proline_g": 3.43,
        "serine_g": 3.01,
        "threonine_g": 2.5,
        "tryptophan_g": 0.78,
        "tyrosine_g": 2.12,
        "valine_g": 3.29
      }
    },
    "foods": [
      {
        "name": "Eggs, Cooked",
        "amount": 2,
        "unit": "large"
      },
      {
        "name": "Milk",
        "brand": "Island Farms",
        "amount": 200,
        "unit": "ml",
        "nutrition_facts": {
          "macros": {
            "energy_kcal": 124,
            "carbs_g": 9.32,
            "fat_g": 6.7,
            "protein_g": 6.64,
            "fiber_g": 0,
            "sodium_mg": 83
          }
        }
      },
      {
        "name": "Quaker, Instant Oatmeal, Plain",
        "amount": 1,
        "unit": "cup"
      },
      {
        "name": "Banana, Fresh",
        "amount": 1,
        "unit": "large"
      },
      {
        "name": "Angel Hair Pasta, Whole Wheat, Cooked in Unsalted Water",
        "amount": 200,
        "unit": "g"
      },
      {
        "name": "Chicken Breast, Skin Removed Before Cooking",
        "amount": 100,
        "unit": "g"
      },
      {
        "name": "Caesar Salad, Without Dressing",
        "amount": 1,
        "unit": "cup, chopped"
      }
    ]
  }
]