# Lighthouse Bulk Audit (Core Web Vitals, SEO, Accessibility) (`enjoyable_bytownite/lighthouse-audit`) Actor

Run Google Lighthouse on many URLs or a whole sitemap: performance, accessibility, best-practices and SEO scores, LCP/CLS/TBT and the top fixes per page, mobile and desktop. No API key needed.

- **URL**: https://apify.com/enjoyable_bytownite/lighthouse-audit.md
- **Developed by:** [Brightfold Labs](https://apify.com/enjoyable_bytownite) (community)
- **Categories:** SEO tools, Developer tools
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $25.00 / 1,000 lighthouse audits

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.
Since this Actor supports Apify Store discounts, the price gets lower the higher subscription plan you have.

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 Bulk Audit (Core Web Vitals, SEO, Accessibility)

Runs **Google Lighthouse** in a real headless Chrome on a list of URLs or a sitemap. For each page it returns the performance, accessibility, best-practices and SEO scores, the lab Core Web Vitals and the top failing audits. No API key is needed: Lighthouse runs inside the Actor. You pay only for audits that produce scores.

### What you can use it for

- **Bulk PageSpeed test:** audit hundreds of pages from a sitemap in one run, instead of one URL at a time in PageSpeed Insights.
- **Core Web Vitals checker:** LCP, CLS, TBT, FCP and Speed Index per page, mobile and desktop.
- **Accessibility and SEO audit:** Lighthouse accessibility and SEO scores with the top failing checks per page.
- **Agency and client reports:** export to CSV, Excel or JSON from the dataset.
- **Monitoring:** schedule weekly runs and compare scores over time.

### How much does it cost?

You pay per successful audit plus a start fee once per run. The start fee is charged only after the first audit succeeds, so a run that scores nothing costs nothing. Failed, timed-out and robots.txt-skipped pages are free. `device: both` is two audits per page.

| Apify plan | Per audit | Start fee per run |
|---|---|---|
| Free | $0.03 | $0.01 |
| Bronze | $0.0285 | $0.009 |
| Silver | $0.027 | $0.008 |
| Gold and above | $0.025 | $0.007 |

Example: 100 pages on mobile on the Free plan cost 100 × $0.03 + $0.01 = $3.01.

### FAQ

- **Do I need a PageSpeed Insights API key?** No. Lighthouse runs inside the Actor in headless Chrome.
- **Why do my scores differ from PageSpeed Insights?** These are lab scores from one run. PageSpeed Insights also shows field data (CrUX) from real users, which this Actor does not.

### Input

| Field | Notes |
|---|---|
| `urls` | Pages to audit (http/https) |
| `sitemapUrl` | Optional XML sitemap. A sitemap index is followed one level (max 20 sitemaps); `.gz` is not supported |
| `maxUrls` | Default 100, max 5000 (URLs plus sitemap pages) |
| `device` | `mobile` (Lighthouse default mobile emulation and throttling, as in PageSpeed Insights), `desktop` (Lighthouse desktop preset) or `both` (two audits per page) |
| `respectRobotsTxt` | Default `true`. Turn off for your own sites |
| `maxIssuesPerCategory` | Failing audits listed per category, default 5 (0–100) |
| `saveHtmlReport` | Store the full Lighthouse HTML report per audit; its link is in `reportUrl` |

```json
{ "urls": [{ "url": "https://www.bbc.com/" }], "sitemapUrl": "https://example.org/sitemap.xml", "maxUrls": 50, "device": "both" }
```

### Output

One row per URL and device:

- `url`, `finalUrl`, `device`, `status` (`ok` / `error` / `skipped`), `errorCode`, `errorMessage`
- Scores 0–100: `performance`, `accessibility`, `bestPractices`, `seo`
- Metrics: `lcpMs`, `fcpMs`, `tbtMs`, `cls`, `speedIndexMs`, `serverResponseMs`, `totalBytes`
- `issues`: failing audits (score below 90) with `category`, `id`, `title`, `score`, `displayValue` and `metricSavings`. Performance issues are sorted by estimated LCP+FCP+TBT savings.
- `warnings`, `reportUrl`, `lighthouseVersion`, `auditedAt`, `durationMs`

A `SUMMARY` record in the key-value store holds counts (`auditsCharged`, `auditsFailed`, `skippedByRobots`), whether `maxUrls` capped the list, sitemap notes, and `stopped: "chargeLimit"` when your spending limit ended the run.

### Behaviour

- Audits run one at a time in one Chrome. Typical audits take 8–35 s each (measured locally).
- Charged event `audit` applies only to rows with `status: "ok"`. These rows are free:
  - Lighthouse errors (e.g. `CHROME_INTERSTITIAL_ERROR` for an unreachable host, `INSECURE_DOCUMENT_REQUEST` for a bad TLS certificate)
  - crashes and 180 s timeouts (`AUDIT_TIMEOUT`)
  - robots.txt skips
- robots.txt handling (RFC 9309):
  - The `*` group is applied.
  - A 4xx robots.txt means no restrictions.
  - A 5xx or unreachable robots.txt means the site is not audited (`ROBOTS_UNREACHABLE`).
- The run succeeds even if every audit fails; it fails only on invalid input.
- Scores are **lab data** from one run. They vary between runs and differ from PageSpeed Insights field data (CrUX).
- Built on [Lighthouse](https://github.com/GoogleChrome/lighthouse) (Apache-2.0). Not affiliated with or endorsed by Google.

### Development

```
npm install
npm test          # unit + schema tests, no network or Chrome
npm start         # local run with Chrome installed; input in storage/key_value_stores/default/INPUT.json
```

# Actor input Schema

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

Pages to audit (http or https).

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

Optional. Audit the pages listed in this XML sitemap (a sitemap index is followed one level; .gz is not supported). Added after the URLs above, up to Max URLs.

## `maxUrls` (type: `integer`):

Cap on the number of pages (URLs plus sitemap pages). With device "both" each page is two audits.

## `device` (type: `string`):

Mobile uses Lighthouse's default mobile emulation and throttling (as PageSpeed Insights); desktop uses its desktop preset.

## `respectRobotsTxt` (type: `boolean`):

Skip pages that the site's robots.txt disallows for all user agents (free rows with status "skipped"). If robots.txt cannot be fetched (network error or 5xx), the site is not audited (free "error" rows, code ROBOTS_UNREACHABLE). Turn off for your own sites.

## `maxIssuesPerCategory` (type: `integer`):

How many failing audits to list per category in "issues" (performance issues sorted by estimated savings). 0 = none.

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

Also store the full Lighthouse HTML report of each audit in the run's key-value store; its link is in "reportUrl".

## Actor input object example

```json
{
  "urls": [
    {
      "url": "https://apify.com/"
    }
  ],
  "maxUrls": 100,
  "device": "mobile",
  "respectRobotsTxt": true,
  "maxIssuesPerCategory": 5,
  "saveHtmlReport": false
}
```

# Actor output Schema

## `audits` (type: `string`):

One row per URL and device: scores, Core Web Vitals lab metrics and top issues.

# 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": [
        {
            "url": "https://apify.com/"
        }
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("enjoyable_bytownite/lighthouse-audit").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": [{ "url": "https://apify.com/" }] }

# Run the Actor and wait for it to finish
run = client.actor("enjoyable_bytownite/lighthouse-audit").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": [
    {
      "url": "https://apify.com/"
    }
  ]
}' |
apify call enjoyable_bytownite/lighthouse-audit --silent --output-dataset

```

## MCP server setup

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

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/lZrw6ElMFG6ZGHxoa/builds/ttpwO7Wc16wmsdXH7/openapi.json
