Skip to main content

Base URL

The dashboard is hosted on Vercel. All API endpoints are available at:
All endpoints are GET-only and return application/json. All responses include Cache-Control: no-store — data is always fresh from the database.

GET /api/stats

Combined overview data — runs four parallel database queries and returns a single response object. Used by the Overview tab. Parameters: None Response:

GET /api/telemetry/latest

Most recent telemetry reading. Used by the Compliance tab and Trend Analysis date initialisation. Parameters: None Response: Single TelemetryReading object with all 65+ fields. See Telemetry Fields Reference.

GET /api/telemetry/history

Historical telemetry over a time window. Parameters: Response: Array of TelemetryReading objects ordered by timestamp ascending.

GET /api/telemetry/aggregated

Time-bucketed telemetry. Used as Stage 1 data for Trend Analysis, Comparative Analysis, and Data Export. Parameters: Response: Array of aggregated rows. Each row contains:
  • timestamp — bucket start
  • UVR_INTENSITY, UVR_POWER_OUTPUT, UVR_WATER_TEMP, SYS_FLOW_RATE, SYS_PRESSURE, AVG_LAMP_EFFICIENCY, FAILED_LAMP_COUNT
  • Per-lamp data for all 16 lamps: LAMP_XX_EFFICIENCY, LAMP_XX_POWER, LAMP_XX_RUNTIME
  • recordCount — number of raw records aggregated into this bucket

GET /api/telemetry/chunked

Paginated raw telemetry records. Used as Stage 2 streaming data. Parameters: Response:

GET /api/telemetry/runtime-analysis

Telemetry records organised for runtime-based lamp degradation analysis. Used by the Trend Analysis runtime charts. Parameters: Response: Array of up to 10,000 records containing: timestamp, UVR_INTENSITY, UVR_POWER_OUTPUT, and LAMP_XX_RUNTIME/EFFICIENCY/POWER for all 16 lamps.

GET /api/health

Latest health score records. Parameters: Response: Array of health records ordered by timestamp descending:
Note: component fields are flat (not nested) in this endpoint’s response. Use /api/health/aggregated for nested component structure.

GET /api/health/aggregated

Time-bucketed health scores. Used by the Trend Analysis health evolution chart. Parameters: Response:

GET /api/events

Process lifecycle and alarm events. Parameters: Response:

GET /api/predictions

ML predictions for all UV lamp components. Parameters: Response:
See RUL Algorithm for how the Predictive Maintenance tab deduplicates and ranks these records.