# Lighthouse Site Monitor: Core Web Vitals & Regressions (`jsonjeong/lighthouse-site-monitor`) Actor

Bulk Lighthouse audits from a URL list or sitemap. Mobile + desktop, Core Web Vitals, performance budgets with pass/fail, and automatic regression alerts versus your previous run. Schedule it to monitor site speed.

- **URL**: https://apify.com/jsonjeong/lighthouse-site-monitor.md
- **Developed by:** [JsonJeong](https://apify.com/jsonjeong) (community)
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $20.00 / 1,000 page audits

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.

Learn more: https://docs.apify.com/actors/running/actors-in-store.md#pay-per-event

## What's an Apify Actor?

An Actor is a serverless cloud program that runs on the Apify platform. It has two run modes.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.

Apify vocabulary and the platform model are defined once, in the agent quickstart at https://apify.com/agents.md.

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.

Do not guess an integration path. Every one of them is in the agent quickstart at https://apify.com/agents.md: the Apify MCP server, Agent Skills with the Apify CLI, the JavaScript and Python clients, the REST API, and the account-free path for an agent with no human to sign in. It also carries the rule on stating cost before the first paid run.

For examples already wired to this Actor's own input schema, see the [API](#api) section below.

Each client library has reference documentation the quickstart does not restate: [JavaScript/TypeScript](https://docs.apify.com/api/client/js/docs.md) (`npm install apify-client`) and [Python](https://docs.apify.com/api/client/python/docs.md) (`pip install apify-client`).

# README

## Lighthouse Site Monitor — Core Web Vitals, Budgets & Regressions

Run Google Lighthouse on a list of pages or a whole sitemap, on mobile and desktop, and get a clean dataset of scores and Core Web Vitals. Set performance budgets to get a pass/fail per page, and schedule the Actor to catch pages that got slower since the last run.

### What it does

- **Bulk audits** — paste URLs or give a `sitemap.xml` (sitemap index files are followed). Up to 500 pages per run.
- **Mobile and desktop** — run either or both for every page.
- **Scores and metrics** — Performance, Accessibility, Best Practices and SEO scores, plus LCP, FCP, TBT, CLS, Speed Index and TTI.
- **Budgets with pass/fail** — e.g. `performance ≥ 90`, `lcpMs ≤ 2500`, `cls ≤ 0.1`. Each page gets `budgetPassed` and a list of what failed.
- **Regression detection** — each run is compared with the previous run of this Actor in your account. Pages whose scores dropped or metrics got worse are listed with before/after values. Small run-to-run noise is ignored (a metric has to get worse by both the % you set and at least 200 ms, or 0.05 for CLS).
- **Top opportunities** — the five biggest Lighthouse savings per page, so you know what to fix first.
- **Optional HTML reports** — store the full Lighthouse report per page and get a link.

### Typical uses

- **Agencies and freelancers:** audit a client's whole site in one run and export to CSV/Excel.
- **Developers:** check Core Web Vitals after a deploy and spot the pages that regressed.
- **SEO teams:** track speed and SEO scores across key landing pages every day or week.

### How to monitor your site

1. Enter your sitemap URL (or a list of key pages) and set budgets.
2. Run once to create a baseline.
3. Create a **Schedule** in Apify (daily or weekly). Every run now reports `regressions` versus the run before.
4. Optional: add an integration (email, Slack, webhook) on run finish to get notified.

### Input example

```json
{
  "sitemapUrl": "https://example.com/sitemap.xml",
  "maxPages": 50,
  "devices": ["mobile", "desktop"],
  "budgets": { "performance": 90, "lcpMs": 2500, "cls": 0.1, "tbtMs": 200 },
  "compareWithPrevious": true
}
```

### Output example (one item per page and device)

```json
{
  "url": "https://example.com/pricing",
  "device": "mobile",
  "scores": { "performance": 72, "accessibility": 96, "bestPractices": 100, "seo": 92 },
  "metrics": { "lcpMs": 3120, "fcpMs": 1480, "tbtMs": 250, "cls": 0.12, "speedIndexMs": 2900, "ttiMs": 5100 },
  "budgetPassed": false,
  "budgetFailures": [{ "check": "lcpMs", "value": 3120, "limit": 2500, "rule": "max" }],
  "regressions": [{ "check": "performance", "previous": 85, "current": 72, "change": -13 }],
  "previousRunAt": "2026-10-04T08:00:00.000Z",
  "opportunities": [{ "id": "render-blocking-resources", "title": "Eliminate render-blocking resources", "estimatedSavingsMs": 1200 }],
  "failedAudits": { "seo": ["Document does not have a meta description"] }
}
```

A summary of each run (`audited`, `budgetFailures`, `regressions`, `errors`) is saved to the `OUTPUT` record in the key-value store.

### Notes

- Results are **lab data** from Lighthouse running in the cloud, so absolute numbers can differ from field data (CrUX) and from your own machine. Use the same settings run to run and compare trends.
- Lighthouse scores vary a little between runs; that's why regressions use thresholds.
- Only audit sites you own or have permission to test.

### Pricing

You pay per audited page and device (one mobile + one desktop audit of the same page are two audits). Failed audits are not charged.

# Actor input Schema

## `startUrls` (type: `array`):

Pages to audit. Leave empty if you use a sitemap.

## `sitemapUrl` (type: `string`):

Audit pages listed in this sitemap (sitemap index files are followed one level). Only same-domain pages are used.

## `maxPages` (type: `integer`):

Upper limit on pages audited per run (max 500).

## `devices` (type: `array`):

Run each page as mobile, desktop, or both.

## `categories` (type: `array`):

Lighthouse categories to run.

## `budgets` (type: `object`):

Pass/fail thresholds. Scores (performance, accessibility, bestPractices, seo) are minimums 0–100; metrics (lcpMs, fcpMs, tbtMs, cls, speedIndexMs, ttiMs) are maximums.

## `compareWithPrevious` (type: `boolean`):

Compares each page with the last run of this Actor in your account and lists scores/metrics that got worse.

## `scoreDropTolerance` (type: `integer`):

A category score must drop at least this many points to count as a regression.

## `metricIncreaseTolerancePct` (type: `integer`):

A metric must get this much worse (and by at least 200 ms, or 0.05 for CLS) to count as a regression.

## `saveHtmlReport` (type: `boolean`):

Store the full Lighthouse HTML report for each audit and return a link.

## Actor input object example

```json
{
  "startUrls": [
    {
      "url": "https://apify.com"
    }
  ],
  "maxPages": 20,
  "devices": [
    "mobile"
  ],
  "categories": [
    "performance",
    "accessibility",
    "best-practices",
    "seo"
  ],
  "budgets": {
    "performance": 90,
    "lcpMs": 2500,
    "cls": 0.1,
    "tbtMs": 200
  },
  "compareWithPrevious": true,
  "scoreDropTolerance": 5,
  "metricIncreaseTolerancePct": 20,
  "saveHtmlReport": false
}
```

# Actor output Schema

## `results` (type: `string`):

No description

## `summary` (type: `string`):

No description

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {
    "startUrls": [
        {
            "url": "https://apify.com"
        }
    ],
    "budgets": {
        "performance": 90,
        "lcpMs": 2500,
        "cls": 0.1,
        "tbtMs": 200
    }
};

// Run the Actor and wait for it to finish
const run = await client.actor("jsonjeong/lighthouse-site-monitor").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = {
    "startUrls": [{ "url": "https://apify.com" }],
    "budgets": {
        "performance": 90,
        "lcpMs": 2500,
        "cls": 0.1,
        "tbtMs": 200,
    },
}

# Run the Actor and wait for it to finish
run = client.actor("jsonjeong/lighthouse-site-monitor").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
for item in client.dataset(run.default_dataset_id).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{
  "startUrls": [
    {
      "url": "https://apify.com"
    }
  ],
  "budgets": {
    "performance": 90,
    "lcpMs": 2500,
    "cls": 0.1,
    "tbtMs": 200
  }
}' |
apify call jsonjeong/lighthouse-site-monitor --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,jsonjeong/lighthouse-site-monitor"
        }
    }
}
```

The hosted server signs you in with OAuth on first connect, so no API token belongs in this config. Clients without OAuth support can send an `Authorization: Bearer <APIFY_API_TOKEN>` header instead, using a token from API & Integrations in Apify Console (https://console.apify.com/settings/integrations).

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/Bv9ilWh4uKmfZtjj0/builds/1awZBOtZucXmHwlMc/openapi.json
