Skip to content

Glucose Readings

Glucose readings are ingested from LibreLinkUp and stored per patient. Retention follows the retention table (paid plans: 5 years auto-delete; demo data: 7 days) — not infinite. A patient with storeReadings: false runs in tunnel mode: readings are forwarded but not persisted.

Reading object

The API returns readings shaped like:

{
"id": "uuid",
"patientId": "uuid",
"glucose": 132.0,
"units": "mg/dL",
"eventTime": "2026-10-01T12:00:00.000Z",
"glucoseType": "Manual",
"eventType": "BG Check",
"enteredBy": "api"
}
FieldNotes
glucoseStored as entered, displayed via the patient’s glucoseUnit (mgdl ↔ mmol/L conversion ×18.0182)
unitsmg/dL or mmol/L
storeReadingsIf false on the patient, reading is forwarded but not persisted (tunnel mode)
trendLibreLinkUp trend arrow on ingress readings (see table below)

Trend values

ValueSymbolDescription
rapidlyRising↑↑Rising > 2 mmol/L per 15 min
rising↑Rising 1–2 mmol/L per 15 min
slowlyRising↗Rising < 1 mmol/L per 15 min
flat→Stable
slowlyFalling↘Falling < 1 mmol/L per 15 min
falling↓Falling 1–2 mmol/L per 15 min
rapidlyFalling↓↓Falling > 2 mmol/L per 15 min

Query (public API)

Terminal window
# Latest reading for a patient
curl "https://api.levelcast.org/api/v1/public/patients/PATIENT_ID/readings/latest" \
-H "X-API-KEY: lc_your_key_here"
# Paginated history (max 50 per page) with min/max/avg stats
curl "https://api.levelcast.org/api/v1/public/patients/PATIENT_ID/readings?page=1&limit=50" \
-H "X-API-KEY: lc_your_key_here"
# 15-minute resampled series for the last 24h (custom startTime/endTime supported)
curl "https://api.levelcast.org/api/v1/public/patients/PATIENT_ID/readings/resampled" \
-H "X-API-KEY: lc_your_key_here"
# Cross-patient feed
curl "https://api.levelcast.org/api/v1/public/measurements?page=1&limit=50" \
-H "X-API-KEY: lc_your_key_here"

Write (public API)

Terminal window
# Single reading
curl -X POST "https://api.levelcast.org/api/v1/public/readings" \
-H "Content-Type: application/json" \
-H "X-API-KEY: lc_your_key_here" \
-d '{
"patientId": "PATIENT_ID",
"glucose": 132,
"units": "mg/dL",
"eventTime": "2026-10-01T12:00:00.000Z"
}'
# Batch of up to 100 (partial success: { "created": […], "errors": […], "total": n })
curl -X POST "https://api.levelcast.org/api/v1/public/readings/batch" \
-H "Content-Type: application/json" \
-H "X-API-KEY: lc_your_key_here" \
-d '{ "readings": [ { "patientId": "PATIENT_ID", "glucose": 132, "units": "mg/dL", "eventTime": "2026-10-01T12:00:00.000Z" } ] }'

Writes require the write scope and are marked enteredBy: "api".

Exports

See Exports for CSV/JSON/XML exports and PDF reports via Gotenberg.