Libra

Libra Cloud API

The Libra Cloud API is a simple way to access and modify data on your Libra account without using the app.

⚠️ This API is experimental and may change at any moment.

API URL

https://api.libra-app.eu

Auth

Accessing Libra Cloud requires an access token that can be generated in the app:

  1. Open the Libra app on your mobile device
  2. Go to Settings using the top-right menu button
  3. Select “Libra Cloud”
  4. Click the top-right context menu
  5. Select “Libra Cloud API”
  6. Generate a token

The token is required for all authenticated requests as part of the request header:

Authorization: Bearer ACCESS_TOKEN

See below for examples.

Body Measurements

⚠️ Data is limited to the last 31 days for normal users.
Pro subscribers have unlimited access.

ℹ️ All values are stored in SI units: weight in kg, length in cm, etc.

Get Entries

GET /values/weight
Query parameterTypeDescription
fromISO 8601 StringGet entries on or after this date (optional)
toISO 8601 StringGet entries on or before this date (optional)
modified_sinceISO 8601 StringGet entries modified on or after this date (optional)

Response: 200 OK

FieldTypeDescription
dateISO 8601 StringMeasurement date and time
weightDoubleWeight in kg
weight_trendDoubleWeight trend in kg
body_fatDouble?Body fat in kg
body_fat_trendDouble?Body fat trend in kg
muscle_massDouble?Muscle mass in kg
muscle_mass_trendDouble?Muscle mass trend in kg
logString?Textual comment

Example

curl "https://api.libra-app.eu/values/weight?from=2023-06-01T00:00:00.000Z&to=2023-07-01T00:00:00.000Z" -H "Authorization: Bearer ACCESS_TOKEN"
{
  "values": [
    {
      "date": "2023-06-15T17:19:42.694Z",
      "weight": 68.4,
      "weight_trend": 68.5,
      "body_fat": 20.0,
      "body_fat_trend": 20.0,
      "muscle_mass": null,
      "muscle_mass_trend": null,
      "log": "Coding instead of exercising"
    }
  ]
}

Get Latest Entry

GET /values/weight/latest

Response: 200 OK

Json payloadTypeDescription
dateISO 8601 StringMeasurement date and time
weightDoubleWeight in kg
weight_trendDoubleWeight trend in kg
body_fatDouble?Body fat in kg
body_fat_trendDouble?Body fat trend in kg
muscle_massDouble?Muscle mass in kg
muscle_mass_trendDouble?Muscle mass trend in kg
logString?Textual comment

Get Single Entry

GET /values/weight/<date>

Note: The date is effectively used as the entry id, and goes down to the milliseconds. The date parameter will be automatically converted to UTC to match Libra’s internal format.

Response: 200 OK

Json payloadTypeDescription
dateISO 8601 StringMeasurement date and time
weightDoubleWeight in kg
weight_trendDoubleWeight trend in kg
body_fatDouble?Body fat in kg
body_fat_trendDouble?Body fat trend in kg
muscle_massDouble?Muscle mass in kg
muscle_mass_trendDouble?Muscle mass trend in kg
logString?Textual comment

Example

curl https://api.libra-app.eu/values/latest_weight -H "Authorization: Bearer ACCESS_TOKEN"
{
  "date": "2023-06-15T17:19:42.694Z",
  "weight": 68.4,
  "weight_trend": 68.5,
  "body_fat": 20.0,
  "body_fat_trend": 20.0,
  "muscle_mass": null,
  "muscle_mass_trend": null,
  "log": "Coding instead of exercising"
}

Insert or Update Entry

PUT /values/weight/<date>
Json payloadTypeDescription
weightDoubleWeight in kg (optional for updates)
body_fatDoubleBody fat in kg (optional)
muscle_massDoubleMuscle mass in kg (optional)
logStringTextual comment (optional)

Response: 201 CREATED

Example

curl https://api.libra-app.eu/values/weight/2023-06-029T12:23:14.000Z -X PUT -H "Authorization: Bearer ACCESS_TOKEN" -d "{\"weight\": 67.6}"

Insert or Update Multiple Entries

PUT /values/weight
Json payloadTypeDescription
valuesList<Value>List of values
notifyBoolSend push notification (default: false)

Value:

Json payloadTypeDescription
dateISO 8601 StringMeasurement date and time
weightDoubleWeight in kg (optional for updates)
body_fatDoubleBody fat in kg (optional)
muscle_massDoubleMuscle mass in kg (optional)
logStringTextual comment (optional)

Response: 201 CREATED

Example

curl https://api.libra-app.eu/values/weight -X PUT -H "Authorization: Bearer ACCESS_TOKEN" -d "[{\"date\": \"2023-06-029T12:23:14.000Z\", \"weight\": 67.6}]"

Delete Entry

DELETE /values/weight/<date>

Response: 204 NO CONTENT

Example

curl https://api.libra-app.eu/values/weight/2023-06-029T12:23:14.000Z -X DELETE -H "Authorization: Bearer ACCESS_TOKEN"