1. Devices API
  2. Get Body Data
GET

/body

x-api-key*
curl --request GET \
     --url https://api.metriport.com/body \
     --header 'x-api-key: AUTH_VALUE'

Query Params

userIdRequired
string

The Metriport user ID to create a session token for.

dateRequired
string

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.

Response

body
Body[]

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

import { Metriport } from "@metriport/api";

const metriportClient = new MetriportDevicesApi("YOUR_API_KEY");

const response = await metriportClient.getBodyData(
  "metriportUserId",
  "date"
);
[
  {
    "metadata": {
      "date": "2022-12-21",
      "source": "withings"
    },
    "body_fat_pct": 9,
    "bone_mass_kg": 33,
    "height_cm": 189,
    "lean_mass_kg": 43,
    "muscle_mass_kg": 22,
    "weight_kg": 78
  }
]