HTTP Status API

The upstream gluco-hub-rs binary serves the HTTP Status API, binding to 0.0.0.0:8080 (set via GLUCO_HUB__HTTP__BIND in run.sh). This add-on only wires HA Ingress (ingress: true, ingress_port: 8080 in config.yaml) to that listener.

The HA Supervisor Ingress proxy intercepts all requests — routes are not directly reachable from the host. You access them via the add-on's panel in the HA UI, or through the Supervisor-issued Ingress URL.

Endpoint reference

MethodPathAuthResponse
GET/healthzpublic{"status":"ok","version":"…"}
GET/metricspublicPrometheus text exposition format
GET/glucose/latestoptional BearerLatest cached reading, or 503 + API001 if no reading is available
GET/clock/statepublicJSON snapshot of latest reading
GET/clock/eventspublicServer-Sent Events stream
GET/clock/historypublicJSON array of recent readings

Clock endpoints

These three routes power the Clock View. They are not protected by Bearer auth.

GET /clock/state

Returns a JSON snapshot of the latest glucose reading. The Clock View fetches this once at startup to populate the display before the SSE stream delivers its first event.

{
  "mgdl": 112,
  "trend": "Flat",
  "ts": 1750000000000,
  "delta": 2,
  "patient": "Alex"
}
FieldTypeDescription
mgdlintegerGlucose value in mg/dL
trendstringOne of: DoubleDown, SingleDown, FortyFiveDown, Flat, FortyFiveUp, SingleUp, DoubleUp, NotComputable, OutOfRange
tsintegerUnix timestamp in milliseconds
deltaintegerChange since previous reading (mg/dL), may be null
patientstringDisplay name, may be absent

GET /clock/events

Server-Sent Events stream. The Clock View opens an EventSource connection to this endpoint for live updates.

Named events:

EventPayloadDescription
readingJSON (same shape as /clock/state)New glucose reading arrived
keepalive(empty)Periodic heartbeat to keep the connection alive

Query parameters:

ParameterValueDescription
eink1Hint to the server that the client is an e-ink display. Set automatically by the Clock View when it detects e-ink mode (?eink or ?preset=eink).

Example connection:

GET /clock/events?eink=1
Accept: text/event-stream

The Clock View reconnects automatically with exponential back-off (2 s → 30 s cap) on any connection error.

GET /clock/history

Returns a JSON array of recent readings used to seed the Clock View's sparkline on first load. This call is best-effort — the Clock View swallows any error silently and draws the sparkline from SSE events only if history is unavailable.

[
  { "ts": 1749999940000, "mgdl": 108 },
  { "ts": 1750000000000, "mgdl": 112 }
]
FieldTypeDescription
tsintegerUnix timestamp in milliseconds
mgdlintegerGlucose value in mg/dL

The array covers approximately the last 3 hours (up to 180 points at 1-minute intervals).

Utility endpoints

GET /healthz and GET /metrics

Always public. No auth required.

GET /glucose/latest

Bearer auth is optional — set GLUCO_HUB__HTTP__BEARER_TOKEN in the add-on configuration to require a token for /glucose/* routes. The /healthz and /metrics endpoints remain public regardless.

Returns latest cached reading, or 503 + error code API001 if no reading is available.

{
  "patient_id": "00000000-0000-0000-0000-000000000000",
  "source_id": "llu",
  "timestamp": "2025-01-01T12:00:00Z",
  "glucose_mgdl": 112,
  "trend": "Flat"
}

Note: The /clock/* routes use an internal shape (mgdl, ts as Unix-ms, delta, patient) optimised for the Clock View, while /glucose/latest uses the public API shape (glucose_mgdl, ISO 8601 timestamp, patient_id).

For the full and authoritative endpoint list, see the upstream gluco-hub-rs documentation.

Response headers

  • Cache-Control: no-store — all data endpoint responses carry this header. Prevents browsers and intermediate proxies from serving a stale glucose value; every request goes to the live server.
  • X-Disclaimer: not-for-medical-use — every response from gluco-hub-rs carries this header as the canonical machine-readable disclaimer signal.

See also

  • Clock View — the visual display that consumes the data endpoints documented here
  • Configuration — add-on options including poll_interval_secs, glucose_unit, and topic_prefix

Disclaimer

Not affiliated with Abbott Laboratories. Unofficial research and self-hosting tool. Use may violate Abbott's LibreLink Up Terms of Service. No warranty. Not for medical decisions, therapy, dosing, or diagnosis.

LibreLink, LibreView, FreeStyle Libre, Libre 2, and Libre 3 are trademarks of Abbott.