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 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 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/weight/latest
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 |
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 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/<date>
Json payload | Type | Description |
---|---|---|
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/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 payload | Type | Description |
---|---|---|
values | List<Value> | List of values |
notify | Bool | Send push notification (default: false ) |
Value:
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/<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"