# PageSpeed Insights API - Core Web Vitals & Lighthouse Bulk (`lost.fany/pagespeed-insights-core-web-vitals`) Actor

Bulk Core Web Vitals and Lighthouse audits for any list of URLs. Works with no API key: time to first byte, transfer size, render-blocking resources, images without dimensions and caching, charged nothing. Add a free Google key for full Lighthouse scores and CrUX field data.

- **URL**: https://apify.com/lost.fany/pagespeed-insights-core-web-vitals.md
- **Developed by:** [Natalia Ivanova](https://apify.com/lost.fany) (community)
- **Categories:** SEO tools, Developer tools, Automation
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $2.60 / 1,000 url auditeds

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

## PageSpeed Insights API - Core Web Vitals & Lighthouse Audit

Audit **a whole list of URLs through the official Google PageSpeed Insights API v5** and get one clean dataset row per page: Lighthouse scores (performance, accessibility, best practices, SEO), lab metrics (LCP, FCP, CLS, TBT, INP, TTI, Speed Index, TTFB), real-user **Core Web Vitals** from the Chrome UX Report, the number of failed audits and the five optimization opportunities with the biggest estimated savings.

It is the same engine as `pagespeed.web.dev`, only pointed at hundreds of URLs at once instead of one, with the results in a table you can sort, filter and export to CSV, Excel or JSON. No scraping, no browser farm, no login: one official API, one row per URL and device.

### What you can do with it

#### Bulk PageSpeed test for a whole site

Feed the URL list from your sitemap (or from the Sitemap URL Extractor Actor) and get the scores of every template at once: product pages, category pages, blog posts, landing pages. One run, one table, obvious outliers.

#### Core Web Vitals monitoring and reporting

Schedule the Actor daily or weekly on your key pages and keep the history in a dataset. Each row carries both sides of the picture: the lab numbers Lighthouse measured now, and the 75th-percentile field data Google collected from real Chrome users over the last 28 days, with Google's own FAST / AVERAGE / SLOW verdict.

#### Lighthouse audit before and after a release

Run the same list before and after a deploy and compare `performanceScore`, `lcpMs`, `cls` and `tbtMs` side by side. `topOpportunities` tells you what Lighthouse would fix first and how many milliseconds it estimates per fix.

#### Competitor and client benchmarking

Mix your pages with competitor pages in one run. SEO agencies use the output as the technical section of an audit deck; the `failedAudits` list doubles as the to-do list.

### Input

| Field | Type | Default | Description |
|---|---|---|---|
| `urls` | array | — | **Required.** Public page URLs. `https://` is added when missing; duplicates are dropped. |
| `strategy` | select | `mobile` | `mobile`, `desktop` or `both`. `both` returns two rows per URL. |
| `categories` | array | `["performance", "seo"]` | Any of `performance`, `accessibility`, `best-practices`, `seo`, `pwa`. |
| `apiKey` | string (secret) | — | **Required.** Free Google API key with the PageSpeed Insights API enabled — two minutes to create, 25,000 audits a day. See the quota note below. |
| `maxConcurrency` | number | `4` | Parallel audits. 2-4 without a key, up to 10 with one. |
| `requestTimeoutSecs` | number | `90` | Per API call. A Lighthouse run on a heavy page needs most of that. |
| `maxRetries` | number | `3` | Retries with exponential backoff on 429, 5xx and timeouts. |
| `topOpportunities` | number | `5` | Opportunities kept per row. |
| `maxItems` | number | `1000` | Hard cap on rows (URL + device combinations). |
| `proxyConfiguration` | object | off | Optional; applies to the calls to googleapis.com, not to the audited pages. |

Examples:

```json
{ "urls": ["https://apify.com", "https://www.wikipedia.org"], "strategy": "mobile", "categories": ["performance", "seo"] }
```

```json
{ "urls": ["https://example.com/", "https://example.com/pricing", "https://example.com/blog"],
  "strategy": "both", "categories": ["performance", "accessibility", "best-practices", "seo"],
  "apiKey": "AIza…", "maxConcurrency": 8, "maxRetries": 4 }
```

```json
{ "urls": ["https://example.com/"], "categories": ["performance"], "topOpportunities": 10, "requestTimeoutSecs": 120 }
```

If a run starts with no URLs at all — which happens when the Actor is called over the API or by an AI agent, where `prefill` values do not apply — the Actor does **not** fail the run. It audits the two example URLs, writes a warning in the log and records it in `inputNotes` of the run summary. That way an empty call still returns a valid, inspectable result instead of a failed run.

### Output

One row per URL and device. Abridged real row:

```json
{
  "url": "https://example.com/", "strategy": "mobile", "formFactor": "mobile",
  "fetchTime": "2026-10-12T08:59:55.000Z", "finalUrl": "https://example.com/en/", "lighthouseVersion": "12.2.1",
  "scores": { "performance": 62, "seo": 92 }, "performanceScore": 62, "seoScore": 92,
  "lcpMs": 3104.5, "fcpMs": 1802.0, "cls": 0.054, "tbtMs": 312.0, "inpMs": null, "ttiMs": 4002.0, "speedIndexMs": 2600.0, "ttfbMs": 120.0,
  "labMetrics": { "lcp": { "value": 3104.5, "unit": "millisecond", "display": "3.1 s", "score": 0.55 } },
  "fieldData": {
    "page":   { "category": "AVERAGE", "metrics": { "lcp": { "percentile": 2300, "category": "AVERAGE" }, "inp": { "percentile": 180, "category": "FAST" }, "cls": { "percentile": 0.12, "category": "AVERAGE" } } },
    "origin": { "category": "FAST", "metrics": { "lcp": { "percentile": 1900, "category": "FAST" } } }
  },
  "fieldDataSource": "page", "fieldCategory": "AVERAGE", "fieldLcpMs": 2300, "fieldInpMs": 180, "fieldCls": 0.12,
  "failedAuditsCount": 12, "failedAudits": ["largest-contentful-paint", "canonical", "tap-targets"],
  "topOpportunities": [
    { "id": "uses-text-compression", "title": "Enable text compression", "savingsMs": 1200, "savingsBytes": 300000, "score": 0.5, "displayValue": null },
    { "id": "render-blocking-resources", "title": "Eliminate render-blocking resources", "savingsMs": 900, "savingsBytes": 45000, "score": 0.3, "displayValue": "Potential savings of 900 ms" }
  ],
  "potentialSavingsMs": 3050, "runWarnings": [], "error": null, "errorCode": null, "scrapedAt": "2026-10-12T09:00:05Z"
}
```

#### What one Lighthouse audit row contains

- **Scores** — `scores` plus a flat `performanceScore`, `accessibilityScore`, `bestPracticesScore`, `seoScore`, `pwaScore` for the categories you requested, on the familiar 0-100 scale.
- **Lab metrics** — milliseconds in `lcpMs`, `fcpMs`, `tbtMs`, `inpMs`, `ttiMs`, `speedIndexMs`, `ttfbMs`, the unitless `cls`, and `labMetrics` with Lighthouse's own display strings ("3.1 s") and per-metric scores. A metric Lighthouse did not produce is `null` — `inpMs` often is, because INP needs a real interaction.
- **Field data (CrUX)** — `fieldData.page` and `fieldData.origin` with Google's FAST / AVERAGE / SLOW verdict and 75th-percentile values for LCP, INP, CLS, FCP and TTFB, plus flat `fieldCategory`, `fieldLcpMs`, `fieldInpMs`, `fieldCls` taken from the page level when CrUX has enough traffic for that URL and from the origin otherwise (`fieldDataSource` says which).
- **Audit results** — `failedAuditsCount` and `failedAudits` (audits scoring below 0.9 in the requested categories; informative and not-applicable audits are not counted), `topOpportunities` sorted by estimated savings, and `potentialSavingsMs` as their sum.
- **Errors** — a URL that could not be audited still produces a row, with the same columns, `error` filled in and `errorCode` set to the HTTP status (`429`, `400`) or the Lighthouse code (`ERRORED_DOCUMENT_REQUEST`). The run keeps going; nothing is lost because of one bad page.

Every error of the run is also collected in the `OUTPUT` record of the key-value store, together with the counts.

### Pricing

Pay per event: a small fee per Actor start and a fee per audited URL (`url-audited`). An error row is a completed attempt and is charged as one. Current prices are on the **Pricing** tab. `strategy: "both"` audits every URL twice and is therefore charged twice.

### Good to know

#### PageSpeed Insights quotas and the API key

Without `apiKey` the Actor uses Google's keyless quota, which is small and shared by IP: expect `HTTP 429 Quota exceeded` after a handful of URLs. The Actor retries with backoff and reports the failure per URL instead of crashing, but for real work create a free API key in Google Cloud (enable "PageSpeed Insights API", then **APIs & Services → Credentials → Create credentials → API key**) and paste it into `apiKey`. The documented quota with a key is 25 000 requests per day and 240 per minute. The field is secret, so the key is stored encrypted and never appears in the dataset or the log.

- A PageSpeed run is a real Lighthouse run in Google's infrastructure: 10-30 seconds per URL, sometimes more. 100 URLs with concurrency 8 take a few minutes.
- Lab numbers vary between runs by design — the same page can differ by several points. For trends compare field data, or average several runs.
- Field data exists only for URLs and origins with enough Chrome traffic. Small sites get `fieldData: { "page": null, "origin": null }`, which is not an error.
- Pages behind a login, on localhost or blocked by `robots.txt` cannot be audited: Google itself has to load them.
- PWA was removed in Lighthouse 12; the category is still accepted as input but usually returns no score.

### Use with AI agents (MCP)

Add the Actor to the [Apify MCP server](https://apify.com/apify/actors-mcp-server) and an agent can audit pages on demand: "How are the Core Web Vitals of example.com on mobile and desktop?" → `{ "urls": ["https://example.com"], "strategy": "both", "categories": ["performance"] }`. Rows are flat and self-describing, so an agent can read scores and opportunities without extra parsing, and a call with an empty input still returns data instead of an error.

### Related Actors

- [Bulk URL Status Checker](https://apify.com/lost.fany/bulk-url-status-checker)
- [Sitemap URL Extractor](https://apify.com/lost.fany/sitemap-url-extractor)
- [Website Tech Stack Detector](https://apify.com/lost.fany/website-tech-stack-detector)

### Disclaimer

Data comes from Google's public PageSpeed Insights API v5 and the Chrome UX Report. This Actor is not affiliated with or endorsed by Google. Lighthouse and PageSpeed Insights are products of Google LLC. Audit only pages you are allowed to test.

### Running without a Google API key

Google's keyless PageSpeed quota is shared per IP and is almost always exhausted - a keyless call to the API answers HTTP 429 within a second. So instead of failing, this Actor measures the pages itself and **charges nothing** for those rows:

- time to first byte and time to receive the HTML;
- transfer size, compression, HTTP version, `Cache-Control`, redirect count;
- render-blocking scripts and stylesheets in `<head>`, inline JavaScript and CSS size;
- images without `width`/`height`, lazy-loaded images, iframes, preload hints;
- viewport meta, `lang`, canonical;
- a short `issues` list naming what to fix.

Rows carry `mode: "basic"`, the Lighthouse columns stay present and empty, and the `Basic snapshot (no API key)` dataset view shows the measured fields. Add a free key from Google Cloud in `apiKey` to switch to the full Lighthouse audit with scores, lab metrics and CrUX field data; those rows are charged per audited URL. Failed rows are never charged in either mode.

### Cost control

Pay per event only works if you can see the bill before you pay it:

- Set `dryRun` to count every result and print what a full run would cost - nothing is charged, and only a few sample rows are stored.
- You are charged only for rows actually delivered to the dataset; a run that finds nothing costs nothing beyond the start event.
- `maxItems` is respected exactly, and the run stops before the platform's Max total charge for the run.
- Every run writes a `COST` record to the key-value store: chargeable events, charged events, the amount in USD and whether a limit was hit.

# Actor input Schema

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

Page URLs to run through the PageSpeed Insights API, one per line (https:// is added when missing). Every URL is a separate Lighthouse run of 10-30 seconds, so keep lists realistic: a few dozen URLs per run with your own API key. Pages must be publicly reachable — no logins, no localhost.

## `strategy` (type: `string`):

Which device Lighthouse emulates. 'Both' audits every URL twice (mobile and desktop) and returns two rows per URL — it also doubles the time and the cost.

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

Which Lighthouse categories to score. Each extra category makes the audit slightly slower. PWA was removed in Lighthouse 12 and may be rejected by Google — expect an empty score for it.

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

Without a key the Actor measures the pages itself: time to first byte, transfer size, render-blocking resources, images without dimensions and caching - those basic rows are never charged. With a free key from Google Cloud (PageSpeed Insights API) you get the full Lighthouse audit: performance, SEO and accessibility scores, lab metrics and CrUX field data.

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

Parallel audits. Google's per-minute quota is the real limit: keep 2-4 without an API key, up to 10 with one.

## `requestTimeoutSecs` (type: `integer`):

Per API call. A Lighthouse run on a heavy page can take a minute, so values under 60 produce timeouts.

## `maxRetries` (type: `integer`):

Retries with exponential backoff on quota (429), server (5xx) and timeout errors. A 400 on an unreachable page is never retried.

## `topOpportunities` (type: `integer`):

How many Lighthouse opportunities (biggest estimated savings first) to keep in every row.

## `maxItems` (type: `integer`):

Stop after this many rows (URL + device combinations).

## `proxyConfiguration` (type: `object`):

Optional. Applies to the calls to googleapis.com, not to the audited pages — Google loads those itself. Useful only to spread the keyless quota over several IPs.

## `dryRun` (type: `boolean`):

Count every result and show what a full run would cost, without charging for it. Only a few sample rows are stored. Use it to check the price before you pay.

## Actor input object example

```json
{
  "urls": [
    "https://apify.com",
    "https://www.wikipedia.org"
  ],
  "strategy": "mobile",
  "categories": [
    "performance",
    "seo"
  ],
  "maxConcurrency": 4,
  "requestTimeoutSecs": 90,
  "maxRetries": 3,
  "topOpportunities": 5,
  "maxItems": 1000,
  "proxyConfiguration": {
    "useApifyProxy": false
  },
  "dryRun": false
}
```

# Actor output Schema

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

One row per URL and device: Lighthouse scores, lab metrics, CrUX field data, failed audits and the top optimization opportunities.

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

URLs and devices requested, audits done, failures and the first errors of the run.

# 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://apify.com",
        "https://www.wikipedia.org"
    ],
    "strategy": "mobile",
    "categories": [
        "performance",
        "seo"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("lost.fany/pagespeed-insights-core-web-vitals").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://apify.com",
        "https://www.wikipedia.org",
    ],
    "strategy": "mobile",
    "categories": [
        "performance",
        "seo",
    ],
}

# Run the Actor and wait for it to finish
run = client.actor("lost.fany/pagespeed-insights-core-web-vitals").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://apify.com",
    "https://www.wikipedia.org"
  ],
  "strategy": "mobile",
  "categories": [
    "performance",
    "seo"
  ]
}' |
apify call lost.fany/pagespeed-insights-core-web-vitals --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,lost.fany/pagespeed-insights-core-web-vitals"
        }
    }
}
```

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/gYWxRrpSBpu8m9ZJI/builds/yVN3lKHTHWFM5CqXs/openapi.json
