# Bulk PageSpeed & Core Web Vitals Audit (`fifty50labs/bulk-pagespeed-lighthouse-audit`) Actor

Audit many URLs with Google's official PageSpeed Insights API. One spreadsheet-ready row per URL and device: Lighthouse scores, Core Web Vitals (lab + real-user CrUX), top opportunities. $0.0015 per successful audit; failed ones free.

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

## Pricing

$1.50 / 1,000 audit completeds

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

## Bulk PageSpeed Insights & Core Web Vitals Audit

Test a list of URLs with Google's official [PageSpeed Insights API v5](https://developers.google.com/speed/docs/insights/v5/get-started) and get one flat, spreadsheet-ready row per URL and device.

### What you get for each URL (mobile and/or desktop)

- **Lighthouse scores (0-100):** performance, accessibility, best practices, SEO
- **Lab metrics:** First Contentful Paint, Largest Contentful Paint, Total Blocking Time, Cumulative Layout Shift, Speed Index, server response time
- **Real-user Core Web Vitals (Chrome UX Report)** where Google has data: LCP, INP and CLS at the 75th percentile with Google's rating (FAST / AVERAGE / SLOW), plus FCP and TTFB, and a pass/fail against Google's thresholds (LCP ≤ 2.5 s, INP ≤ 200 ms, CLS ≤ 0.1). `fieldDataScope` tells you whether the numbers are for the exact URL, for the whole origin (Google falls back to origin data for low-traffic pages), or missing.
- **Top 5 fixes** ranked by Lighthouse's estimated time savings, with savings in ms and KB, as separate columns and as one readable text column
- Lighthouse version and audit timestamp

Failed URLs (page won't load, blocked, invalid) get a row with `status: failed` and the error message, and **are not charged**.

### Input

| Field | What it does |
|---|---|
| URLs to audit | One per line. `https://` is added if missing. Duplicates removed. |
| Devices | Mobile, desktop, or both (default both). |
| Your API key (optional) | A free Google API key with the PageSpeed Insights API enabled. Gives you your own Google quota and up to 10 parallel audits. Without it the Actor uses its shared key, capped at 4 parallel audits. |
| Parallel audits | 1-10. |
| Language | Locale for Lighthouse titles (en, de, fr, es, ar...). |
| Save full raw API response | Stores each full JSON response in the key-value store. |

### Output example (illustrative values, shortened)

```json
{
  "url": "https://example.com",
  "strategy": "mobile",
  "status": "ok",
  "performanceScore": 32,
  "seoScore": 75,
  "labLcpMs": 10885,
  "fieldDataScope": "origin",
  "fieldLcpP75": 2100,
  "fieldInpP75": 180,
  "fieldClsP75": 0.05,
  "coreWebVitalsPass": true,
  "opportunity1": "Use efficient cache lifetimes",
  "opportunity1SavingsMs": 3100,
  "topOpportunities": "Use efficient cache lifetimes (~3100 ms); Improve image delivery (~1200 ms); ..."
}
```

### Pricing

Pay per event: you pay per successful audit (one URL on one device). Auditing a URL on mobile and desktop is two audits. Failed audits are free. Platform compute is included.

### Good to know

- Each audit takes Google about 10-40 seconds. The Actor runs several at once.
- Lab results vary a few points between runs; that is how Lighthouse works, not an Actor issue. Field data (real users) is more stable.
- Real-user data exists only for pages and sites with enough Chrome traffic. Small sites often show `fieldDataScope: null`.
- Scores come straight from Google's API. This Actor doesn't run its own Lighthouse or change any numbers.
- Not affiliated with Google. PageSpeed Insights and Lighthouse are Google products; use is subject to Google's API terms.

# Actor input Schema

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

Pages to test. One per line. Missing https:// is added. Duplicates are removed.

## `strategies` (type: `array`):

Run each URL on mobile, desktop, or both. Each URL and device is one audit.

## `apiKey` (type: `string`):

Optional. A free Google API key with the PageSpeed Insights API enabled gives you your own quota (Google's default is 25,000 requests a day) and allows higher concurrency. Leave empty to use the Actor's shared key.

## `maxConcurrency` (type: `integer`):

How many audits run at the same time. Capped at 4 without your own key and 10 with it.

## `locale` (type: `string`):

Locale for Lighthouse text such as opportunity titles, e.g. en, de, fr, es, ar.

## `saveRawJson` (type: `boolean`):

Also store each full PageSpeed Insights JSON response in the key-value store (the row gets its key in rawJsonKey). Off by default.

## Actor input object example

```json
{
  "urls": [
    "https://www.wikipedia.org",
    "https://web.dev"
  ],
  "strategies": [
    "mobile",
    "desktop"
  ],
  "maxConcurrency": 4,
  "locale": "en",
  "saveRawJson": false
}
```

# Actor output Schema

## `results` (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 = {
    "urls": [
        "https://www.wikipedia.org",
        "https://web.dev"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("fifty50labs/bulk-pagespeed-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",
        "https://web.dev",
    ] }

# Run the Actor and wait for it to finish
run = client.actor("fifty50labs/bulk-pagespeed-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",
    "https://web.dev"
  ]
}' |
apify call fifty50labs/bulk-pagespeed-lighthouse-audit --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,fifty50labs/bulk-pagespeed-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/6EuUsPQmLQb0B1g42/builds/Uw0LVwp2YywIStgLo/openapi.json
