Lighthouse
The Lighthouse endpoints let you retrieve performance, accessibility, SEO, and best practices reports for any monitor with the Lighthouse check enabled. Reports include scores, Core Web Vitals metrics, and detected issues.
You'll need a monitor ID for these endpoints.
Example request:
$ OHDEAR_TOKEN="your API token" $ curl https://ohdear.app/api/monitors/1/lighthouse-reports/latest \ -H "Authorization: Bearer $OHDEAR_TOKEN" \ -H 'Accept: application/json' \ -H 'Content-Type: application/json'
All endpoints below follow the same authentication pattern.
Lighthouse report response fields #
Every Lighthouse endpoint returns a report object with these fields:
{ "id": 123, "performance_score": 92, "accessibility_score": 98, "best_practices_score": 100, "seo_score": 95, "progressive_web_app_score": null, "first_contentful_paint_in_ms": 1200, "speed_index_in_ms": 1800, "largest_contentful_paint_in_ms": 2100, "time_to_interactive_in_ms": 2500, "total_blocking_time_in_ms": 150, "cumulative_layout_shift": 0.05, "performed_on_checker_server": "paris", "json_report": { "...": "..." }, "issues": [], "created_at": "2024-06-15 14:30:00" }
id: unique identifier for this reportperformance_score: Lighthouse performance score (0--100)accessibility_score: Lighthouse accessibility score (0--100)best_practices_score: Lighthouse best practices score (0--100)seo_score: Lighthouse SEO score (0--100)progressive_web_app_score: PWA score, ornullif not applicablefirst_contentful_paint_in_ms: time to first contentful paint in millisecondsspeed_index_in_ms: speed index in millisecondslargest_contentful_paint_in_ms: largest contentful paint in millisecondstime_to_interactive_in_ms: time to interactive in millisecondstotal_blocking_time_in_ms: total blocking time in millisecondscumulative_layout_shift: cumulative layout shift scoreperformed_on_checker_server: the server location that ran the auditjson_report: the full Lighthouse JSON report (only included on single-report endpoints, not on the list endpoint)issues: array of detected issuescreated_at: when this report was generated (UTC)
Get a specific report #
GET /api/monitors/{monitorId}/lighthouse-reports/{lighthouseReportId}
Returns a single Lighthouse report by its ID. The response follows the report shape above, including the full json_report.
Get the latest report #
GET /api/monitors/{monitorId}/lighthouse-reports/latest
Returns the most recent Lighthouse report for a monitor. The response follows the same report shape, including the full json_report.
List all reports #
GET /api/monitors/{monitorId}/lighthouse-reports
Returns a paginated list of Lighthouse reports for a monitor. Each item follows the same report shape, except json_report is excluded to keep response sizes manageable.
Query parameters:
filter[created_at](string, optional) -- only return reports created at or after this timestamp inYmdHisformat, in UTC (e.g.,20240615000000)
Feel free to reach out via [email protected] or on X via @OhDearApp if you have any other questions. We'd love to help!