Skip to main content

GET /api/v1/report/?format=xlsx

Generate a comprehensive Excel workbook for data analysts with multiple sheets containing summary metrics, operator logs, and raw sensor data.

Path Parameters

asset_id
string
required
Asset identifier (e.g., Motor-01)

Query Parameters

format
string
required
Must be xlsx

Response

Returns an Excel (.xlsx) file download with 3 sheets:
  1. Summary Sheet: Health metrics and risk assessment
  2. Operator Logs Sheet: Maintenance event history
  3. Sensor Data Sheet: Raw time-series sensor readings

Example

cURL
curl -X GET "https://predictive-maintenance-uhlb.onrender.com/api/v1/report/Motor-01?format=xlsx" \
  -H "Accept: application/vnd.openxmlformats-officedocument.spreadsheetml.sheet" \
  --output motor01-data.xlsx
Python
import requests
import pandas as pd

response = requests.get(
    "https://predictive-maintenance-uhlb.onrender.com/api/v1/report/Motor-01",
    params={"format": "xlsx"}
)

with open("motor01-data.xlsx", "wb") as f:
    f.write(response.content)

# Read with pandas
summary = pd.read_excel("motor01-data.xlsx", sheet_name="Summary")
logs = pd.read_excel("motor01-data.xlsx", sheet_name="Operator Logs")
sensor_data = pd.read_excel("motor01-data.xlsx", sheet_name="Sensor Data")

File Naming

Downloaded files follow the pattern:
health-report_{asset_id}_{timestamp}.xlsx
Example: health-report_Motor-01_2026-03-02T10-30-00Z.xlsx

Workbook Contents

Sheet 1: Summary

ColumnDescription
Asset IDAsset identifier
TimestampReport generation time
Health Score0-100 health score
Risk LevelLOW/MODERATE/HIGH/CRITICAL
Degradation IndexCumulative damage (0.0-1.0)
Damage RateDI change per hour
RUL (hours)Remaining useful life estimate
Maintenance WindowDays until service recommended
Anomaly BatchesLifetime count of anomalous 1s windows

Sheet 2: Operator Logs

ColumnDescription
TimestampEvent timestamp
Event TypeMaintenance activity type
SeverityLOW/MEDIUM/HIGH/CRITICAL
DescriptionFree-text event description
Operator NamePerson who logged the event
Includes all operator logs retrieved from GET /api/logs?hours=24.
If no operator logs exist for the asset, this sheet will be empty with headers only.

Sheet 3: Sensor Data

ColumnDescription
TimestampMeasurement timestamp (ISO 8601)
Voltage (V)Voltage in volts
Current (A)Current in amperes
Power FactorPower factor (0-1)
Vibration (g)Vibration in g-force
Power (kW)Computed power in kilowatts
Anomaly ScoreML model output (0.0=Normal, 1.0=Anomalous)
Includes recent sensor history (last 60 seconds by default).
Large time ranges can produce very large Excel files. The Sensor Data sheet is limited to recent history to keep file sizes manageable (typically 1 MB).

Use Cases

Trend Analysis

Import into Python/R for statistical analysis

Correlation Studies

Cross-reference operator logs with sensor anomalies

Compliance Audits

Provide raw data for regulatory reviews

ML Training

Export labeled data for supervised learning

Status Codes

  • 200 - Workbook generated successfully
  • 404 - Asset not found or no health data available
  • 503 - Excel generation failed
Open the file in Excel, LibreOffice Calc, or Google Sheets for interactive filtering and pivot tables. All sheets include headers for easy analysis.

Executive PDF

1-page summary for managers

Industrial PDF

5-page technical certificate

Build docs developers (and LLMs) love