# Bulk Lighthouse & PageSpeed Audit: Core Web Vitals, SEO (`patrickballard/bulk-lighthouse-auditor`) Actor

Bulk PageSpeed and Lighthouse audits for hundreds of URLs or a whole sitemap, with no API key and no quota. Mobile and desktop scores, Core Web Vitals (LCP, CLS, TBT), top fixes, SEO and accessibility checks, budgets and alerts when scores drop.

- **URL**: https://apify.com/patrickballard/bulk-lighthouse-auditor.md
- **Developed by:** [Paddy Ballard](https://apify.com/patrickballard) (community)
- **Features:** Limited permissions
- **Stats:** 1 total users, 0 monthly users, 0.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $15.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/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

## Bulk Lighthouse & PageSpeed Audit: Core Web Vitals, SEO

A **bulk PageSpeed Insights alternative** with no API key and no quota. Run **real Google Lighthouse** on a list of URLs or a whole **sitemap**, on **mobile and desktop**, and get one clean table: Performance, Accessibility, Best Practices and SEO scores, **Core Web Vitals** (LCP, CLS, TBT, FCP, Speed Index), the **biggest fixes for each page**, and **pass/fail budgets**.

Schedule it, and it **remembers each page's scores** and flags any page that got worse since the last run.

- **No API key, no PageSpeed Insights quota.** Lighthouse runs in its own headless Chrome for every page.
- **Whole-site audits** from `sitemap.xml` or a sitemap index (same domain only).
- **Regression alerts** when any score drops by your threshold (default 5 points).
- **Budgets:** minimum scores, max LCP, max CLS, max TBT. Each row has `passedBudget` and the reasons it failed.
- **Staging sites:** send extra headers (for example `Authorization`) to audit a password-protected site you own.
- **Full HTML reports** (optional): the same interactive report you see in Chrome DevTools, one link per audit.
- **Pay only for audits that succeed.** A page that fails to load is not charged.

### Who it's for

- **SEO and web agencies** auditing every page of a client site, not just the home page.
- **Developers** checking Core Web Vitals and Lighthouse scores before and after a release.
- **Site owners** who want a weekly website speed test that flags pages getting slower.

### Example input

```json
{
  "sitemapUrl": "https://example.com/sitemap.xml",
  "maxPages": 100,
  "formFactors": ["mobile", "desktop"],
  "minScores": { "performance": 80, "seo": 90 },
  "maxLcpMs": 2500,
  "compareWithPreviousRun": true
}
```

### What you get

One row per page and device:

| Field | Example |
|---|---|
| `url`, `finalUrl`, `formFactor` | `https://crawlee.dev/`, `mobile` |
| `scores` | `{ "performance": 60, "accessibility": 95, "bestPractices": 73, "seo": 92 }` |
| `metrics` | `{ "lcpMs": 8744, "cls": 0.001, "tbtMs": 281, … }` plus `fcpMs`, `speedIndexMs`, `serverResponseMs`, `totalBytes`, `requestCount` |
| `opportunities` | Up to 8 fixes, biggest estimated time saved first, e.g. `cache-insight`, `unused-javascript`, `render-blocking-insight`, each with `savingsMs` / `savingsBytes` |
| `failedAudits` | Failed accessibility, SEO and best-practice checks, e.g. `image-alt`, `meta-description` |
| `passedBudget`, `budgetFailures` | `false`, `["performance score 60 < 80", "LCP 8744 ms > 2500 ms"]` |
| `previousScores`, `scoreChange`, `regressed`, `regressions` | e.g. `{ "performance": -12 }`, `true`, `["performance 72 → 60"]` |
| `reportUrl` | Link to the full Lighthouse HTML report (if enabled) |

Example row (real output, trimmed):

```json
{
  "url": "https://crawlee.dev/",
  "formFactor": "mobile",
  "scores": { "performance": 50, "accessibility": 95, "bestPractices": 73, "seo": 92 },
  "metrics": { "fcpMs": 1855, "lcpMs": 5117, "tbtMs": 1512, "cls": 0.001, "speedIndexMs": 5168, "totalBytes": 1913464 },
  "opportunities": [
    { "id": "cache-insight", "title": "Use efficient cache lifetimes", "savingsMs": 2600 },
    { "id": "mainthread-work-breakdown", "title": "Minimize main-thread work", "savingsMs": 1500 }
  ],
  "failedAudits": [
    { "category": "accessibility", "id": "color-contrast", "title": "Background and foreground colors do not have a sufficient contrast ratio." }
  ],
  "passedBudget": false,
  "budgetFailures": ["performance score 50 < 80"],
  "scoreChange": { "performance": 6 },
  "regressed": false
}
```

The **Overview** tab shows scores, vitals and budget/regression flags. The **Top fixes** tab shows what to fix on each page. Export to CSV, Excel, JSON or Google Sheets, or call the Actor from Make, Zapier, n8n or the API.

A run summary (pages audited, average performance, regressed pages, pages over budget) is saved as `OUTPUT` in the run's key-value store.

### How to use it

1. Paste page URLs, or a sitemap URL.
2. Choose devices (mobile, desktop or both) and categories.
3. Optional: set a budget, e.g. `{"performance": 80}` and max LCP `2500`.
4. Run it. To monitor, add a **schedule** (daily or weekly) with "Compare with my previous run" on.

### Pricing

**$0.015 per page audit** (one page on one device). Auditing 100 pages on mobile and desktop = 200 audits = **$3.00**. Failed audits are free. Set a maximum cost per run in the run options and the Actor stops cleanly when it is reached.

### Why not just use PageSpeed Insights?

PSI is great for one page. For 50 or 500 pages you hit API keys and quotas, you can't audit a staging site behind a password, and nothing remembers last week's scores. This Actor runs Lighthouse itself, so there's no quota. It audits pages one at a time for stable scores, and it keeps history in your own Apify account.

### Good to know

- Scores are **lab data** from Lighthouse's simulated throttling (the same method PSI uses for its lab section). They can vary a few points between runs; that's why the regression threshold exists.
- Each page is loaded once per device, with Lighthouse's normal user agent. Audit sites you own or have permission to test. Don't use this to load-test anyone's site.
- No personal data is collected. The Actor reads the page as a visitor would and stores only scores and metrics.
- History is kept in a key-value store named `bulk-lighthouse-auditor-history` in **your** account. Delete it any time to reset.

### FAQ

**Why is mobile so much slower than desktop?** Mobile uses Lighthouse's throttled mid-range phone and slow 4G, as in PSI. Desktop uses the desktop preset.

**Can it audit pages behind a login?** It can send fixed headers (e.g. Basic auth or a token). It does not fill in login forms.

**How long does a run take?** Roughly 15–25 seconds per audit (heavy pages can take longer). Pages are audited one after another so they don't slow each other down.

**Found a problem or want a feature?** Open an issue on the Actor's Issues tab. I reply within a few days.

# Actor input Schema

## `urls` (type: `array`):

Pages to audit, one per line. https:// is added if missing.

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

Audit pages listed in this sitemap or sitemap index (same domain only), up to Max pages. Combined with the URLs above.

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

Most pages to audit in one run (each page is audited once per device). Hard cap 1000.

## `formFactors` (type: `array`):

Mobile uses Lighthouse's default throttled phone. Desktop uses Lighthouse's desktop preset. Pick both to get two rows per page.

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

Lighthouse categories to score. Fewer categories make runs a little faster.

## `minScores` (type: `object`):

Optional pass marks from 0 to 100, for example {"performance": 80, "seo": 90}. Rows below a mark get passedBudget = false.

## `maxLcpMs` (type: `integer`):

Optional. Fail the budget when Largest Contentful Paint is slower than this. Google's 'good' line is 2500.

## `maxCls` (type: `string`):

Optional. Fail the budget when Cumulative Layout Shift is above this, e.g. 0.1.

## `maxTbtMs` (type: `integer`):

Optional. Fail the budget when Total Blocking Time is above this, e.g. 200.

## `compareWithPreviousRun` (type: `boolean`):

Remember each page's scores in your account and flag drops on the next run. Ideal with a daily or weekly schedule.

## `regressionThreshold` (type: `integer`):

Flag a page as regressed when any score drops by at least this many points since the previous run.

## `saveHtmlReports` (type: `boolean`):

Save Lighthouse's full interactive HTML report for every audit and link it in the results (reportUrl).

## `extraHeaders` (type: `object`):

Optional headers sent with every request, e.g. {"Authorization": "Basic ..."} to audit a password-protected staging site you own.

## Actor input object example

```json
{
  "urls": [
    "https://crawlee.dev"
  ],
  "maxPages": 50,
  "formFactors": [
    "mobile"
  ],
  "categories": [
    "performance",
    "accessibility",
    "best-practices",
    "seo"
  ],
  "minScores": {
    "performance": 80
  },
  "compareWithPreviousRun": true,
  "regressionThreshold": 5,
  "saveHtmlReports": false
}
```

# Actor output Schema

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

One row per page and device: scores, Core Web Vitals, budgets and regressions.

## `fixes` (type: `string`):

Biggest speed fixes and failed accessibility/SEO checks per page.

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

Totals for the run: pages audited, failures, average scores.

## `files` (type: `string`):

Full Lighthouse HTML reports, when saveHtmlReports is on.

# 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 = {
    "urls": [
        "https://crawlee.dev"
    ],
    "minScores": {
        "performance": 80
    }
};

// Run the Actor and wait for it to finish
const run = await client.actor("patrickballard/bulk-lighthouse-auditor").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 = {
    "urls": ["https://crawlee.dev"],
    "minScores": { "performance": 80 },
}

# Run the Actor and wait for it to finish
run = client.actor("patrickballard/bulk-lighthouse-auditor").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 '{
  "urls": [
    "https://crawlee.dev"
  ],
  "minScores": {
    "performance": 80
  }
}' |
apify call patrickballard/bulk-lighthouse-auditor --silent --output-dataset

```

## MCP server setup

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

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/YnL36mOgE068WHLll/builds/u5kVRFaQSDVG0g8AY/openapi.json
