# Bulk PageSpeed & Core Web Vitals — with regression alerts (`docflow-tools/pagespeed-bulk-regression-monitor`) Actor

Check many URLs with Google's official PageSpeed Insights API (your own free key): performance score, lab metrics, real-user Core Web Vitals (LCP, INP, CLS) and top opportunities. On scheduled runs it flags pages that got worse.

- **URL**: https://apify.com/docflow-tools/pagespeed-bulk-regression-monitor.md
- **Developed by:** [DocFlow Tools](https://apify.com/docflow-tools) (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 $1.60 / 1,000 url analyzeds

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

## Bulk PageSpeed & Core Web Vitals — with regression alerts

Check many URLs at once with **Google's official PageSpeed Insights API (v5)** and get, for every URL and device,
the **performance score**, **lab metrics**, **real-user Core Web Vitals** from the Chrome UX Report and the
**top opportunities**. Run it on a schedule and each result is compared with the previous one: `hasRegression` and a
readable `regressions` list tell you which pages got worse. It calls only Google's API with **your own free API
key**; it does not scrape the PageSpeed website.

### What you get

One dataset item per URL and device (`strategy`):

| Field | Description |
|---|---|
| `url`, `strategy` | The URL analyzed and `mobile` or `desktop` |
| `status` | `ok`, or `error` with the reason in `error` |
| `performanceScore` | Lighthouse performance score, 0-100 |
| `lab` | Lab metrics from Lighthouse: `lcpMs`, `cls`, `tbtMs`, `fcpMs`, `speedIndexMs` |
| `field` | Real-user data for this URL from the Chrome UX Report: `overall` category, `originFallback`, and for each metric its 75th-percentile value and category: `lcpMs` / `lcpCategory`, `inpMs` / `inpCategory`, `cls` / `clsCategory`, `fcpMs` / `fcpCategory`, `ttfbMs` / `ttfbCategory`. `null` when Google has no field data for the page |
| `originField` | The same real-user data for the whole origin (domain), or `null` |
| `opportunities` | Up to 5 Lighthouse audits that are not passed (score below 0.9) with estimated savings, sorted by savings: `[{id, title, savingsMs}]` |
| `lighthouseVersion`, `analyzedAt`, `finalUrl` | Lighthouse version, analysis time (UTC) and final URL after redirects |
| `regressions` | List of what got worse since the previous successful run for the same URL and device |
| `hasRegression` | `true` if `regressions` is not empty |
| `previousScore` | Performance score of the previous run, or `null` on the first run |

#### What counts as a regression

Compared with the previous successful result of the same URL and device:

- Performance score down by **5 points or more**.
- Lab LCP, TBT, FCP or Speed Index up by **200 ms or more**.
- Lab CLS up by **0.05 or more**.
- A page-level Core Web Vital (LCP, INP or CLS) moving to a worse category (`FAST` -> `AVERAGE` -> `SLOW`).

Messages look like `performance score 71 → 55`, `lab lcpMs 3200 → 3700` or `field inpCategory FAST → SLOW`.

### Use cases

- Weekly or daily performance monitoring of your key pages, with an alert only when something got worse.
- Check a whole list of landing pages or product pages after a release or a theme change.
- Report Core Web Vitals (LCP, INP, CLS) for many client sites in one dataset.
- Compare mobile and desktop results side by side.
- Find the biggest Lighthouse opportunities across many URLs.

### How to use

1. Get a free **PageSpeed Insights API key** in Google Cloud Console: create or pick a project, enable
   "PageSpeed Insights API", then create an API key under "Credentials".
2. Open the Actor in Apify Console, paste your URLs and your key into **Google API key** (stored as a secret input).
3. Choose the devices: `mobile`, `desktop` or both.
4. Click **Start**. For regression alerts, save the input as a Task and add a **Schedule** (for example weekly).

Input example (field names exactly as the Actor reads them):

```json
{
  "urls": [
    "https://www.wikipedia.org/",
    "https://example.com/pricing"
  ],
  "strategies": ["mobile", "desktop"],
  "googleApiKey": "YOUR_GOOGLE_API_KEY"
}
```

| Input | Default | Notes |
|---|---|---|
| `urls` | (required) | Pages to analyze, http or https |
| `strategies` | `["mobile"]` | `mobile`, `desktop` or both. Other values are ignored |
| `googleApiKey` | empty | Your own key. Without it the Actor uses Google's shared quota, which is usually exhausted (HTTP 429) |

### Output example

```json
{
  "url": "https://example.com/pricing",
  "strategy": "mobile",
  "status": "ok",
  "performanceScore": 55,
  "lab": { "lcpMs": 3700, "cls": 0.123, "tbtMs": 410, "fcpMs": 1500, "speedIndexMs": 4100 },
  "field": {
    "overall": "AVERAGE",
    "originFallback": false,
    "lcpMs": 2900, "lcpCategory": "AVERAGE",
    "inpMs": 180, "inpCategory": "FAST",
    "cls": 0.12, "clsCategory": "AVERAGE"
  },
  "originField": null,
  "opportunities": [
    { "id": "render-blocking-resources", "title": "Eliminate render-blocking resources", "savingsMs": 820 },
    { "id": "unused-javascript", "title": "Reduce unused JavaScript", "savingsMs": 450 }
  ],
  "lighthouseVersion": "12.0.0",
  "analyzedAt": "2026-11-22T10:00:00.000Z",
  "finalUrl": "https://example.com/pricing",
  "regressions": ["performance score 71 → 55", "lab lcpMs 3200 → 3700"],
  "hasRegression": true,
  "previousScore": 71
}
```

Values are illustrative. Metrics that Google does not return for a page are left out of `lab` and `field`.

### Pricing

> **Prices by Apify discount tier:** the prices below are for the Bronze tier. **Free plan: 50 % off.** Silver: 10 % off. Gold and higher: 20 % off. Apify applies the right price automatically.

Pay per event, in USD. Platform compute is included in the event prices. The Google API itself is free with your key.

| Event | Price | When it is charged |
|---|---|---|
| Actor start | $0.00005 | Charged by Apify when a run starts, per GB of run memory (default memory: 512 MB) |
| `url-analyzed` | $0.002 | Per URL and device analyzed successfully |

**Failed URLs are not charged** (API errors, quota errors, invalid URLs).

Examples:

- **50 URLs, mobile and desktop**: 0.00005 + 100 x 0.002 = **$0.20005**
- **200 URLs, mobile only, every week**: 0.00005 + 200 x 0.002 = **$0.40005** per run, about **$1.60** for 4 runs.
- **10 URLs, both devices, every day**: 0.00005 + 20 x 0.002 = **$0.04005** per run, about **$1.20** for 30 runs.

You can set a maximum cost per run in Apify; once it is reached no further URLs are charged.

### Use it from code, AI agents and integrations

**Apify API** (runs the Actor and returns the dataset items in one call):

```bash
curl -X POST "https://api.apify.com/v2/acts/docflow-tools~pagespeed-bulk-regression-monitor/run-sync-get-dataset-items?token=YOUR_APIFY_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"urls": ["https://www.wikipedia.org/"], "strategies": ["mobile"], "googleApiKey": "YOUR_GOOGLE_API_KEY"}'
```

**Python** (`pip install apify-client`):

```python
from apify_client import ApifyClient

client = ApifyClient("YOUR_APIFY_TOKEN")
run = client.actor("docflow-tools/pagespeed-bulk-regression-monitor").call(
    run_input={
        "urls": ["https://www.wikipedia.org/"],
        "strategies": ["mobile", "desktop"],
        "googleApiKey": "YOUR_GOOGLE_API_KEY",
    }
)
for item in client.dataset(run["defaultDatasetId"]).iterate_items():
    if item.get("hasRegression"):
        print(item["url"], item["strategy"], item["regressions"])
```

**AI agents**: the Actor can be called by AI agents (Claude, Cursor and other MCP clients) through the Apify MCP
server at https://mcp.apify.com.

**No-code**: connect it to Make, Zapier or n8n through the Apify integrations, for example to post to Slack only
the items where `hasRegression` is `true`.

### Limits and notes

- Each URL is analyzed by Google's servers, not from Apify: pages must be publicly reachable (no localhost,
  intranet or password-protected pages).
- Up to 4 analyses run in parallel. Each API call has a 180 s timeout; after an HTTP 429, 500 or 503 answer the
  call is retried, up to 3 attempts in total, waiting 10 s and then 20 s.
- Only the **performance** category is requested (not SEO, accessibility or best practices).
- Lab results vary from run to run; the thresholds above are meant to ignore small noise.
- Real-user (`field`) data exists only for pages and origins with enough Chrome traffic; otherwise it is `null`.
- The previous result is kept in a named key-value store of your account, `pagespeed-state`, one record per URL
  and device. It is shared by every run and task of this Actor in your account. Delete that store to reset the baseline.

### FAQ

**Do I need a Google API key?** In practice, yes. The key is free; without it requests use Google's shared quota,
which is usually exhausted and returns HTTP 429. Failed URLs are not charged.

**Is my API key safe?** The input field is marked as secret in Apify and the key is only sent to Google's API.

**What is the difference between `lab` and `field`?** `lab` is a single Lighthouse test run by Google at the time of
the request. `field` is real-user data from the Chrome UX Report (75th percentile), which is what Core Web Vitals
assessments use.

**When do regression alerts start?** From the second run of the same URL and device. The first run has
`previousScore: null` and `hasRegression: false`.

**Why is INP missing in `lab`?** INP needs real user interactions, so it is only available in `field` and `originField`.

### Related tools

- [Document to Markdown for RAG](https://apify.com/docflow-tools/document-to-markdown-rag) — PDF, Word, Excel, PowerPoint and HTML to Markdown and chunks, with OCR.
- [RSS, Atom & JSON Feed Reader](https://apify.com/docflow-tools/feed-reader-only-new) — feeds in one format, only new items on scheduled runs.
- [Image to Text OCR](https://apify.com/docflow-tools/image-ocr-own-engine) — text, lines and positions from images.
- [Audio Transcriber (Whisper)](https://apify.com/docflow-tools/audio-transcriber-whisper-local) — audio and video to text and subtitles.
- [Merge, Dedupe & Transform Data](https://apify.com/docflow-tools/merge-dedupe-transform-data) — merge datasets and files, remove duplicates, export.
- [Website Screenshot Monitor](https://apify.com/docflow-tools/website-screenshot-monitor) — bulk screenshots with change detection.
- [Bulk Image Converter & Compressor](https://apify.com/docflow-tools/bulk-image-converter-compressor) — convert, compress and resize images; useful for the image opportunities.
- [Sitemap URL Extractor](https://apify.com/docflow-tools/sitemap-url-extractor-reliable) — every URL of a site from its sitemaps, to build the URL list.
- [SEO Audit Crawler](https://apify.com/docflow-tools/seo-audit-crawler-cheap) — on-page SEO score and issues per page.
- [Website to Markdown & llms.txt](https://apify.com/docflow-tools/website-to-markdown-llms-txt) — main content of web pages as Markdown for LLMs.

# Actor input Schema

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

Pages to analyze (http or https).

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

mobile, desktop or both.

## `googleApiKey` (type: `string`):

Your own PageSpeed Insights API key from Google Cloud (free). Without it the shared quota is usually exhausted.

## Actor input object example

```json
{
  "urls": [
    "https://www.wikipedia.org/"
  ],
  "strategies": [
    "mobile"
  ]
}
```

# 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/"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("docflow-tools/pagespeed-bulk-regression-monitor").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("docflow-tools/pagespeed-bulk-regression-monitor").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 docflow-tools/pagespeed-bulk-regression-monitor --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,docflow-tools/pagespeed-bulk-regression-monitor"
        }
    }
}
```

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/3c6BWSzeXhpWiciwZ/builds/Yd3J9Gnufs6qd06Gf/openapi.json
