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:
- Open the Libra app on your mobile device
- Go to Settings using the top-right menu button
- Select “Libra Cloud”
- Click the top-right context menu
- Select “Libra Cloud API”
- 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 during the experimental phase.
Note: All values are stored in SI units: weight in kg, length in cm, etc.
Get Entries
GET /values/weight
Query parameter | Type | Description |
---|---|---|
from | ISO 8601 String | Get entries on or after this date (optional) |
to | ISO 8601 String | Get entries on or before this date (optional) |
modified_since | ISO 8601 String | Get entries modified on or after this date (optional) |
Response: 200 OK
Field | Type | Description |
---|---|---|
date | ISO 8601 String | Measurement date and time |
weight | Double | Weight in kg |
weight_trend | Double | Weight trend in kg |
body_fat | Double? | Body fat in kg |
body_fat_trend | Double? | Body fat trend in kg |
muscle_mass | Double? | Muscle mass in kg |
muscle_mass_trend | Double? | Muscle mass trend in kg |
log | String? | 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/latest_weight
Response: 200 OK
Json payload | Type | Description |
---|---|---|
date | ISO 8601 String | Measurement date and time |
weight | Double | Weight in kg |
weight_trend | Double | Weight trend in kg |
body_fat | Double? | Body fat in kg |
body_fat_trend | Double? | Body fat trend in kg |
muscle_mass | Double? | Muscle mass in kg |
muscle_mass_trend | Double? | Muscle mass trend in kg |
log | String? | 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
Json payload | Type | Description |
---|---|---|
date | ISO 8601 String | Measurement date and time |
weight | Double | Weight in kg (optional for updates) |
body_fat | Double | Body fat in kg (optional) |
muscle_mass | Double | Muscle mass in kg (optional) |
log | String | Textual 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
Json payload | Type | Description |
---|---|---|
date | ISO 8601 String | Measurement date and time |
Response: 204 NO CONTENT
Example
curl https://api.libra-app.eu/values/weight -X DELETE -H "Authorization: Bearer ACCESS_TOKEN" -d "{\"date\": \"2023-06-029T12:23:14.000Z\"}"