# Lighthouse Audit: Bulk Page Speed, SEO & Core Web Vitals (`swiftkit/lighthouse-audit`) Actor

Run Google Lighthouse on many pages at once: performance, accessibility, best practices and SEO scores, Core Web Vitals (LCP, CLS, TBT), top fixes and the full HTML report. Mobile, desktop or both. No API key needed.

- **URL**: https://apify.com/swiftkit/lighthouse-audit.md
- **Developed by:** [SwiftKit](https://apify.com/swiftkit) (community)
- **Categories:** SEO tools, Developer tools
- **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 auditeds

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 Audit: Bulk Page Speed, SEO & Core Web Vitals

Run **Google Lighthouse**, the same open-source engine behind PageSpeed Insights and Chrome
DevTools, on a whole list of pages in one go. For every page you get:

- **Scores** for performance, accessibility, best practices and SEO (0–100)
- **Core Web Vitals and speed metrics:** LCP, CLS, TBT, FCP, Speed Index, time to interactive,
  server response time and total page weight
- **Top fixes** ranked by time saved ("Serve images in next-gen formats: 150 ms")
- **Failed SEO and accessibility checks**, in plain titles
- The **full HTML report**, ready to open or send to a client

**Mobile, desktop or both.** No Google account or API key needed.

### Who it's for

- **SEO and web agencies:** audit a client's key pages, or a prospect's whole site list, in one run.
- **Developers:** track scores after each release with a scheduled run.
- **Marketers:** compare your landing pages with competitors'.
- **AI agents and dashboards:** clean JSON with scores and metrics.

### Input

| Option | Default | What it does |
|---|---|---|
| Page URLs | – | One per line. `stripe.com` works too. |
| Device | Mobile | Mobile, desktop, or both (two audits per URL) |
| Categories | all four | Performance, accessibility, best practices, SEO |
| Save HTML report | on | The full report, viewable in any browser |
| Save full JSON report | off | Every audit detail |
| Respect robots.txt | on | Skips pages the site asks bots not to visit |
| Runs per page | 1 | 2–5 runs per page, keeping the run with the median performance score |

### Output

One row per page and device (real result, shortened):

```json
{
  "url": "https://www.wikipedia.org",
  "device": "mobile",
  "status": "ok",
  "performance": 98,
  "accessibility": 96,
  "bestPractices": 100,
  "seo": 100,
  "metrics": {
    "firstContentfulPaintMs": 1038,
    "largestContentfulPaintMs": 1379,
    "totalBlockingTimeMs": 160,
    "cumulativeLayoutShift": 0,
    "speedIndexMs": 1069,
    "serverResponseMs": 111,
    "totalPageKb": 92
  },
  "opportunities": [
    { "id": "modern-image-formats", "title": "Serve images in next-gen formats", "savingsMs": 150, "savingsKb": 20 }
  ],
  "failedSeoAudits": [],
  "failedAccessibilityAudits": [
    { "id": "label", "title": "Form elements do not have associated labels" }
  ],
  "lighthouseVersion": "12.8.2",
  "htmlReportUrl": "https://api.apify.com/v2/key-value-stores/…/records/0001-www.wikipedia.org-mobile.html?signature=…"
}
```

| status | meaning |
|---|---|
| `ok` | Audit finished. |
| `unreachable` | The page didn't load or Lighthouse couldn't audit it. Not charged. |
| `blocked_by_robots_txt` | The site asks bots not to visit. Not charged. |

### Pricing

You pay **per page audited** (each device, and each extra run, counts as one audit). Failed pages are free. See the
Pricing tab.

### Limits, honestly

- Scores come from a lab test on a cloud machine, like any Lighthouse run. They vary a little between
  runs and can differ from PageSpeed Insights, which also shows real-user data from Chrome. Compare
  pages within the same run for the fairest picture. For steadier numbers, use **Runs per page**
  (median of several runs), and watch **`benchmarkIndex`**: Lighthouse's measurement of how fast
  the machine was right before the audit. If a score drops while `benchmarkIndex` drops too, the
  machine was slower, not the page.
- Audits run one at a time so they don't slow each other down. Expect about 20–60 seconds per page (heavy pages take longer).
- Pages behind a login, a paywall or a bot check can't be audited.

### More tools from SwiftKit

- [Website Screenshot Tool](https://apify.com/swiftkit/website-screenshots): bulk full-page and mobile screenshots, PNG/JPEG/PDF
- [Tech Stack Detector](https://apify.com/swiftkit/tech-stack): what a website is built with: CMS, analytics, ecommerce, hosting
- [WHOIS & Domain Expiry Checker](https://apify.com/swiftkit/domain-lookup): registrar, expiry, age and DNS for any domain
- [Sitemap Extractor & Broken Link Checker](https://apify.com/swiftkit/sitemap-urls): every URL from a site’s sitemaps, plus 404 and redirect checks
- [SEO Audit Crawler](https://apify.com/swiftkit/seo-audit): crawl a site for broken links, missing titles and noindex pages

### Questions?

Open an issue on the Issues tab.

# Actor input Schema

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

One per line. A bare domain like stripe.com works too.

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

Which Lighthouse preset to use. 'Both' runs and charges two audits per URL.

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

Fewer categories run a bit faster. The price is the same.

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

The full Lighthouse report you can open in a browser or send to a client.

## `saveJsonReport` (type: `boolean`):

Every audit detail, for your own processing.

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

Skip pages the site asks bots not to visit.

## `runsPerUrl` (type: `integer`):

Run Lighthouse several times per page and keep the run with the median performance score (scores vary between runs). Each run is billed as one audit.

## Actor input object example

```json
{
  "urls": [
    "https://www.wikipedia.org"
  ],
  "device": "mobile",
  "categories": [
    "performance",
    "accessibility",
    "best-practices",
    "seo"
  ],
  "saveHtmlReport": true,
  "saveJsonReport": false,
  "respectRobotsTxt": true,
  "runsPerUrl": 1
}
```

# Actor output Schema

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

One row per page and device.

# 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://www.wikipedia.org"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("swiftkit/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": ["https://www.wikipedia.org"] }

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

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,swiftkit/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/cVgu13mtOhFmcFGsS/builds/sMFMJXcgiZdw8ZbhP/openapi.json
