# Bulk PageSpeed Insights & Core Web Vitals Checker (Sitemap) (`lindenbyte/bulk-pagespeed-core-web-vitals`) Actor

Audit hundreds of URLs or a whole sitemap with Google's official PageSpeed Insights API: Lighthouse scores, lab LCP/CLS/TBT, real-user CrUX Core Web Vitals (LCP, INP, CLS) and top fixes, mobile + desktop, with pass/fail thresholds for monitoring.

- **URL**: https://apify.com/lindenbyte/bulk-pagespeed-core-web-vitals.md
- **Developed by:** [Lindenbyte Studio](https://apify.com/lindenbyte) (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

Pay per event

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 Checker

Run Google **PageSpeed Insights** on hundreds of pages at once, or point it at a **sitemap.xml** and audit the whole site. You get one flat row per URL and device with Lighthouse scores, lab metrics (LCP, CLS, TBT, FCP, Speed Index, TTI), **real-user Core Web Vitals from the Chrome UX Report** (LCP, INP, CLS, FCP, TTFB at p75), Google's Core Web Vitals pass/fail assessment and the top fixes ranked by estimated time saved.

It uses Google's official PageSpeed Insights API v5, so the numbers match what you see on pagespeed.web.dev.

### Why this one

- **Sitemap input**: give `https://yoursite.com/sitemap.xml` (sitemap indexes and `.xml.gz` work too) and cap it with `maxUrls`.
- **Mobile and desktop in one run**: `strategy: both` gives two rows per URL.
- **Clean field data**: CrUX p75 values and FAST/AVERAGE/SLOW categories as flat columns, CLS already divided by 100, plus a flag when Google only has origin-level data for the page.
- **Pass/fail thresholds for monitoring**: set e.g. `minPerformanceScore: 80`, `maxLcpMs: 2500` or "require passing Core Web Vitals" and each row gets `passed` and a readable `failedChecks` list. Schedule it weekly and alert on failures.
- **Failed pages are free**: unreachable pages come back as rows with `error` set and are not charged.

### Use cases

- SEO agencies: Core Web Vitals report for a client's whole sitemap in one CSV.
- Developers: catch performance regressions after a deploy with a scheduled run and thresholds.
- Site owners: find which templates (product pages, blog posts) have poor LCP or CLS, and what to fix first.
- Competitor benchmarking: compare your pages with competitors' on mobile and desktop.

### Input

| Field | What it does |
|---|---|
| `urls` | Pages to audit (`example.com` is read as `https://example.com/`) |
| `sitemapUrl` | Sitemap or sitemap index; its pages are added to the list |
| `maxUrls` | Cap on unique URLs (default 100) |
| `strategy` | `mobile` (default), `desktop` or `both` |
| `categories` | `performance` (default), plus optional `seo`, `accessibility`, `best-practices` |
| `apiKey` | Optional: your own free Google PSI key. Without it the Actor's built-in key is used |
| `concurrency` | Parallel audits (default 4, max 10) |
| `minPerformanceScore`, `minSeoScore`, `minAccessibilityScore`, `minBestPracticesScore` | Optional score thresholds (0-100) |
| `maxLcpMs`, `maxCls`, `maxTbtMs` | Optional lab metric thresholds |
| `requireFieldCwvPass` | Fail rows whose real-user Core Web Vitals do not pass |

### Output (one item per URL and device)

Real values from a Lighthouse 13 mobile audit of web.dev (field data shortened):

```json
{
  "url": "https://web.dev/",
  "finalUrl": "https://web.dev/",
  "strategy": "mobile",
  "performanceScore": 73,
  "seoScore": 92,
  "accessibilityScore": 90,
  "bestPracticesScore": 77,
  "lcpMs": 2866, "fcpMs": 2866, "tbtMs": 618, "speedIndexMs": 4136, "ttiMs": 13997, "serverResponseMs": 346, "cls": 0,
  "fieldDataScope": "url",
  "fieldOriginFallback": false,
  "fieldOverallCategory": "AVERAGE",
  "fieldLcpP75Ms": 2600, "fieldLcpCategory": "AVERAGE",
  "fieldInpP75Ms": 295, "fieldInpCategory": "AVERAGE",
  "fieldClsP75": 0.3, "fieldClsCategory": "SLOW",
  "fieldFcpP75Ms": 2032, "fieldTtfbP75Ms": 842,
  "fieldCwvAssessment": "FAILED",
  "topOpportunity": "Render-blocking requests (~1600 ms)",
  "opportunities": [
    { "id": "render-blocking-insight", "title": "Render-blocking requests", "estimatedSavingsMs": 1600, "estimatedSavingsBytes": null, "displayValue": "Est savings of 1,610 ms" },
    { "id": "unused-css-rules", "title": "Reduce unused CSS", "estimatedSavingsMs": 750, "estimatedSavingsBytes": 133084, "displayValue": "Est savings of 130 KiB" }
  ],
  "passed": false,
  "failedChecks": ["Performance score 73 < 80", "Lab LCP ms 2866 > 2500"],
  "lighthouseVersion": "13.6.0",
  "reportUrl": "https://pagespeed.web.dev/analysis?url=https%3A%2F%2Fweb.dev%2F&form_factor=mobile",
  "error": null,
  "fetchedAt": "2026-11-13T07:13:23.769Z"
}
```

A run summary (counts, threshold pass/fail, problems) is saved as `SUMMARY` in the key-value store.

Field notes: `fieldDataScope` is `url` when Chrome UX Report has data for that exact page, `origin` when Google only has site-wide data (`fieldOriginFallback: true`), and `null` for low-traffic sites with no CrUX data. `fieldCwvAssessment` follows Google's rule: LCP, INP and CLS must all be "good" at p75.

### Pricing

Pay per result: you are charged for each successful audit (one URL on one device). Pages Google cannot load are returned with an `error` and are not charged. Set a max cost on the run and the Actor stops when it is reached.

### Limits

- Each audit takes Google 10-40 seconds; 100 URLs on both devices take a few minutes at the default concurrency.
- Lighthouse lab scores vary a few points between runs; that is normal for Lighthouse, not this Actor.
- Pages behind logins, or that block Google's Lighthouse bot, return an error row.
- Google's keyless PSI quota is currently zero, so a key is always used: ours by default, or yours if you add one (25,000 audits/day free: https://developers.google.com/speed/docs/insights/v5/get-started#APIKey). If a key's daily quota runs out, the run stops with a clear message and keeps the results so far.

Not affiliated with Google. PageSpeed Insights, Lighthouse and Chrome UX Report are Google products.

# Actor input Schema

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

Pages to audit. 'example.com' is read as https://example.com/. Duplicates are removed.

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

Optional sitemap.xml or sitemap index (also .xml.gz). Its page URLs are added to the list, up to 'Max URLs'.

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

Cap on unique URLs audited (list + sitemap). Each URL is audited once per device, so 'both' doubles the audit count.

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

Lighthouse device emulation. Google ranks on mobile, so mobile is the default.

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

Scores to compute. Performance (with Core Web Vitals) is always useful; extra categories make each audit a bit slower.

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

Your own free PageSpeed Insights API key (25,000 audits/day). Leave empty to use the Actor's built-in key. Get one: https://developers.google.com/speed/docs/insights/v5/get-started#APIKey

## `concurrency` (type: `integer`):

Audits running at the same time. Each takes 10-40 s at Google. Rate limits are retried with backoff.

## `minPerformanceScore` (type: `integer`):

If set, an audit with a lower score gets passed=false. Leave all thresholds empty and 'passed' stays null.

## `minSeoScore` (type: `integer`):

Requires the SEO category.

## `minAccessibilityScore` (type: `integer`):

Requires the Accessibility category.

## `minBestPracticesScore` (type: `integer`):

Requires the Best practices category.

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

Largest Contentful Paint from the Lighthouse run. Google's 'good' limit is 2500.

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

Cumulative Layout Shift, e.g. 0.1 (Google's 'good' limit).

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

Lab TBT, e.g. 200.

## `requireFieldCwvPass` (type: `boolean`):

Fail the audit unless Chrome UX Report data shows good LCP, INP and CLS at p75 (Google's Core Web Vitals assessment). Pages without CrUX data fail this check.

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

Optional locale for audit titles, e.g. en, de, fr. Default English.

## Actor input object example

```json
{
  "urls": [
    "https://web.dev/",
    "https://www.apify.com/"
  ],
  "maxUrls": 100,
  "strategy": "mobile",
  "categories": [
    "performance"
  ],
  "concurrency": 4,
  "requireFieldCwvPass": false
}
```

# Actor output Schema

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

No description

## `summary` (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://web.dev/",
        "https://www.apify.com/"
    ]
};

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

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

```

## MCP server setup

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