# PageSpeed & Core Web Vitals Monitor (`meltemi-labs/pagespeed-core-web-vitals-monitor`) Actor

Bulk PageSpeed/Lighthouse audits + real-user Core Web Vitals (CrUX) with history and alerts. Free public trial until 25 December 2026. No additional Actor usage fees during the trial. Standard Apify platform usage costs may still apply. Any future pricing changes will be announced in advance.

- **URL**: https://apify.com/meltemi-labs/pagespeed-core-web-vitals-monitor.md
- **Developed by:** [Meltemi Labs](https://apify.com/meltemi-labs) (community)
- **Categories:** SEO tools, Developer tools, Automation
- **Features:** Limited permissions
- **Stats:** 1 total users, 0 monthly users, 0.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

Pay per usage

This Actor is paid per platform usage. The Actor is free to use, and you only pay for the Apify platform usage, which gets cheaper the higher subscription plan you have.

Learn more: https://docs.apify.com/actors/store.md#pay-per-usage

## 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 Lighthouse audits + real-user Core Web Vitals with up to 40 weeks of history, regression alerts between runs, and a client-ready report per domain.** Built on Google's official PageSpeed Insights and Chrome UX Report (CrUX) APIs, using **your own free Google API key**.

Made for SEO agencies, developers and site owners who need to *keep* sites fast, not just test them once.

***

### Why this Actor

- **Lighthouse scores** (performance, accessibility, best practices, SEO) for hundreds of pages, mobile and desktop.
- **Real-user Core Web Vitals** (LCP, INP, CLS at p75) queried directly from the official **CrUX API**. Google plans to stop including CrUX data in the PageSpeed Insights API.
- **History:** up to **40 weekly data points** per page or site, with a trend per metric.
- **Pages with little traffic** fall back to whole-site data, otherwise they are clearly marked `insufficient-data`.
- **Comparison with previous runs** and **regression alerts based on real users**, with minimum changes to avoid false alarms (see [How alerts work](#how-alerts-work)).
- **Sitemap input** with sampling across page types (/product/, /blog/, …) instead of the first N URLs. A monitor checks the **same pages on every run**.
- **Per-domain report** (Markdown + JSON): CWV pass/fail, median score, top fixes, slowest pages.
- CSV / JSON / Excel export, plus a ready `RESULTS.csv`.

### What you get

**Dataset (one row per URL × device)**

- `lab`: Lighthouse performance / accessibility / best-practices / SEO scores, LCP, CLS, TBT, FCP, Speed Index, server response time
- `field`: CrUX p75 for **LCP, INP, CLS, FCP, TTFB**, rating per metric (good / needs improvement / poor), Google's **Core Web Vitals assessment** (`passed` / `failed` / `insufficient-data`), and whether data came from the **page** or the **whole site**
- `history`: up to 40 weekly p75 points for LCP/INP/CLS + trend (`better` / `worse` / `flat`)
- `opportunities`: the top Lighthouse fixes with estimated savings
- `comparison` and `regressionAlert`: what changed since the previous run with the same `monitorName`

**Key-value store**

- `REPORT.md`: a client-ready report per domain and device
- `SUMMARY`: the same as JSON
- `RESULTS.csv`: spreadsheet-safe export (formula injection neutralised)

### Quick start

1. **Get a free Google API key** (about 3 minutes, no credit card): follow the [step-by-step guide](#get-your-free-google-api-key-3-minutes-no-credit-card) below.
2. Paste it into **Google API key**. Apify stores it encrypted.
3. Add one or two pages under **URLs to check** and click **Start**. Two pages take about a minute.
4. Open **Output** for the results, the per-domain `REPORT.md` and `RESULTS.csv`.
5. Happy with the result? Set a **Monitor name** and add your sitemap, as described next. Comparisons start with the second run.

Your Google project's quotas (PageSpeed: 30 checks/minute and 25,000/day; CrUX: 150 queries/minute) are respected automatically.

### Monitoring a client site every week

1. Set **Monitor name**, e.g. `client-acme`. Every name is a monitor of its own with its own history, page list and alerts: `Client A`, `client a` and `client-a` are three different monitors, so always use exactly the same spelling. Any alphabet works.
2. Add the client's sitemap and set **Max URLs** (e.g. 100).
3. Create an Apify **Schedule** (weekly).
4. After each run, look at `regressionAlert` in the results, the *Regressions* part of `REPORT.md`, or the status message of the run.

Each run compares itself with your earlier runs under the same monitor name. Runs of one monitor may overlap: no results are lost, but each run compares only with runs that had finished when it started, and both may report the same regression.

### How alerts work

An alert means: `regressionAlert` is `true` in the results, with the reasons in `comparison.regressions`, in `REPORT.md` and counted in the status message of the run. (Sending alerts to a webhook is not available during the public trial.)

**Real users (CrUX): on by default, from the second run, when Google has enough data:**

- a Core Web Vital dropped a rating band, e.g. LCP from *good* to *needs improvement*, and changed by at least **LCP 100 ms, INP 20 ms or CLS 0.02**; or
- a p75 value got ≥ 15% worse (configurable) and changed by at least **LCP 250 ms, INP 50 ms or CLS 0.05**.

Smaller changes are treated as noise: Google publishes CLS in steps of 0.01, so 0.01 → 0.02 is the smallest possible change, not news. Each run is compared with the previous one, so a very slow decline in many tiny steps may not raise an alert; the weekly `history` shows it.

Only like-for-like data is compared. When several pages share whole-site data, a site-level change raises **one** alert, not one per page.

Pages and sites **without enough real-user data get no alerts**, unless you turn on the experimental option below.

**Lighthouse (lab): Experimental, off by default.** Scores, history and comparisons are always recorded, but a score drop raises an alert only if you turn on **Experimental: Lighthouse alerts**.

- **Expect false alarms.** Lighthouse scores of an unchanged page vary from test to test: in our own tests heavy pages moved by 20–50 points within a day, and we estimate that up to about 1 in 6 checks of such a page would raise a false alert at the default of 10 points.
- If on: after 3 earlier checks of the same page, an alert is raised when the score is at least 10 points (configurable) below the **median of the last 5 checks** and a second, fresh test shows it too. This reduces false alarms but does not prevent them; a higher number of points gives fewer.
- These alerts are marked `Experimental:`.

### Input example

```json
{
  "googleApiKey": "YOUR_KEY",
  "sitemapUrls": ["https://www.example.com/sitemap.xml"],
  "urls": [{ "url": "https://www.example.com/" }],
  "maxUrls": 100,
  "devices": ["mobile", "desktop"],
  "monitorName": "client-acme",
  "refreshPages": false,
  "historyWeeks": 40,
  "lighthouseAlerts": false
}
```

### Output example (one item, shortened)

```json
{
  "url": "https://www.example.com/",
  "finalUrl": "https://www.example.com/en",
  "redirected": true,
  "device": "mobile",
  "status": "ok",
  "lab": { "performanceScore": 62, "lcpMs": 3421, "cls": 0.081, "tbtMs": 410 },
  "field": { "source": "url", "assessment": "failed", "lcpP75Ms": 2640, "inpP75Ms": 180, "clsP75": 0.05,
             "ratings": { "lcp": "needs-improvement", "inp": "good", "cls": "good" } },
  "history": { "weeks": 40, "trend": { "lcp": { "first": 2060, "last": 2780, "change": 720, "changePct": 35, "direction": "worse" } } },
  "opportunities": [{ "id": "render-blocking-resources", "title": "Eliminate render-blocking resources", "savingsMs": 1210 }],
  "comparison": { "performanceScoreDelta": -14, "baselineScore": 62, "baselineChecks": 3,
                  "regressions": ["LCP (real users) went from \"good\" to \"needs-improvement\" (2310 -> 2640)"] },
  "regressionAlert": true
}
```

### Price: free public trial

This Actor is **free to use during its public trial**: there is no rental fee and no charge per check, result or alert. As with every free Actor, the run itself uses your Apify account's normal platform usage (in our tests about $0.01 per 100 checks), and both Google APIs are free. The Apify free plan's monthly credit covers normal use. The end date of the trial is announced in the Actor's status at the top of this page.

If the Actor becomes a paid Actor after the trial, this page will say so, with the prices, before that happens.

### Data notes and limits

- **Field data (CrUX)** is a 28-day rolling window from real Chrome users, updated by Google. Pages need enough public traffic to appear. Google does not publish the threshold. When a page has no data, the Actor uses the whole site's data and labels it `"source": "origin"`.
- **Redirects:** all results belong to `finalUrl`, the page reached after every redirect. The report lists redirected URLs and warns when one leads to a different website. A redirect to a non-public address is a failed check. If a URL starts to redirect to another page, nothing is compared with the old page.
- **Trends from zero:** when a metric started at 0 (often CLS), there is no percentage: `changePct` is `null`, `change` holds the difference, and the CSV says e.g. `from 0 to 0.03`.
- **Lab data (Lighthouse)** runs on Google's servers and varies from run to run. Use it for diagnosis, and the field data for what users experience.
- INP has no lab equivalent. In lab data, TBT is the closest proxy.
- Up to 2,000 URLs per run. Throughput follows Google's PageSpeed quota of **30 checks per minute per Google project**, so 100 pages × 2 devices take roughly 7–8 minutes. The default run timeout (1 hour) covers about 1,500 checks; raise **Timeout** in the run options for larger runs. When time runs out the Actor stops cleanly and keeps everything finished so far.
- **Same pages every run:** the pages picked from a sitemap depend only on which URLs it lists, not on their order. With a monitor name the list is also saved and reused. A page missing from the sitemaps is checked once more; if it is missing again on the next run, it is replaced by its new address (if it redirects to a page the sitemaps list) or by another page of the same type, and the report says so. If a sitemap cannot be read completely, the saved list is used unchanged. To pick a new list, turn on **Pick new pages from the sitemaps** for one run.
- A page that fails but is still in the sitemap stays in the list: it is reported as a failed check.
- Sitemaps are read completely as a stream (limits: 20 files, 150 MB per file and 400 MB in total, 5 minutes); very large ones can add a minute or two to a run. Language/query variants of the same page (`?hl=…`) are counted once.

### Get your free Google API key (3 minutes, no credit card)

This Actor uses **your own** Google API key. Google's API terms don't allow reselling API access, and with your own key you also get your own quota (PageSpeed: 30 checks per minute and 25,000 per day; real-user data: 150 queries per minute).

**Cost: $0.** Both Google APIs are free. You do **not** need to enable billing or start a free trial.

#### Step 1: Create a Google Cloud project

1. Open **https://console.cloud.google.com/projectcreate** and sign in with any Google account.
2. If Google asks you to accept the Google Cloud Terms of Service, read them and accept them.
3. Project name: e.g. `pagespeed-monitor`, then **Create**.
4. You do **not** need to enable billing or start a free trial. Ignore the "Start free" banner.

#### Step 2: Turn on the two APIs

Make sure your new project is selected (top-left), then open each link and click **Enable**:

- PageSpeed Insights API: https://console.cloud.google.com/apis/library/pagespeedonline.googleapis.com
- Chrome UX Report API: https://console.cloud.google.com/apis/library/chromeuxreport.googleapis.com

#### Step 3: Create a restricted key

1. Open **APIs & Services → Credentials** (https://console.cloud.google.com/apis/credentials).
2. **Create credentials → API key**.
3. Name: e.g. `apify-cwv-monitor`.
4. **API restrictions:** select **PageSpeed Insights API** and **Chrome UX Report API** only.
5. Application restrictions: leave **None**. The Actor runs in the Apify cloud, whose IP addresses change.
6. Click **Create**, then **Copy key**.

#### Step 4: Use it

Paste the key into the **Google API key** field of the Actor. Apify stores this field **encrypted**. The Actor sends it to Google only in a request header and never writes it to logs or results.

#### Good practice

- Use this key only for this Actor. If you think it leaked, delete it in Credentials and create a new one in 1 minute.
- Check usage any time at APIs & Services → Enabled APIs → PageSpeed Insights API → **Quotas & System Limits**.

#### Troubleshooting

| Message | Fix |
|---|---|
| "Google rejected the API key … API key not valid" | Copy the key again; make sure there are no spaces. |
| "… has not been used in project … or it is disabled" | Enable both APIs in **the same project** as the key (Step 2). |
| "… daily quota exhausted" | You used 25,000 checks today; wait until midnight Pacific Time or reduce *Max URLs*. |
| Field data shows `insufficient-data` | Not an error: the page/site has too little Chrome traffic for Google to publish real-user data. |

### Security and privacy

- Your API key is an **encrypted secret input**. It is sent to Google only in a request header, never in URLs, and is removed from every log and error message.
- Only public `http(s)` pages on standard ports are accepted. Private networks, localhost, cloud metadata addresses and IP tricks are refused. Sitemap downloads are checked again at connection time, which protects against DNS rebinding, and are capped in size, redirects and time.
- The addresses you check are sent to Google (PageSpeed Insights and CrUX), which loads the pages to test them. Do not check addresses that contain secrets or personal data, such as reset links.
- Nothing is sent to the developer of this Actor. Results and history stay in your Apify account: unnamed results follow your data retention period, a monitor's history stays in its named storage until you delete it.

### FAQ

**Why do I need my own key?** Google's API terms don't allow reselling API access. With your own key you are the API client, you get your project's own quota, and nobody else's usage slows you down.

**Can I run it without CrUX?** Yes. Turn off *Real-user data* to get Lighthouse only.

**Does it work for single-page apps?** Yes. Lighthouse renders the page on Google's side.

### Support

Something not working, or a question? Open an issue in the **Issues** tab of this Actor. Please include the run ID and never your API key.

This is a trial version: real-user alerts are covered by automated tests, but feedback from real use is very welcome.

### Attribution

Real-user data: [Chrome UX Report](https://developer.chrome.com/docs/crux) (CC BY 4.0). Lab data: Google PageSpeed Insights / Lighthouse. This Actor is not affiliated with or endorsed by Google.

# Actor input Schema

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

Your own Google Cloud API key with "PageSpeed Insights API" and "Chrome UX Report API" enabled. Both APIs are free. The key is stored encrypted by Apify, sent to Google only in a request header and never written to logs or results. Tip: restrict the key to these two APIs in Google Cloud Console.

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

Public http(s) pages to audit. Duplicates are removed.

## `sitemapUrls` (type: `array`):

Sitemap or sitemap-index URLs. Pages are picked across page types (e.g. /product/, /blog/) up to "Max URLs". With a monitor name, the same pages are checked on every run.

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

Hard cap on pages checked (each page is checked once per selected device). Max 2000.

## `devices` (type: `array`):

Lighthouse strategy and CrUX form factor.

## `monitorName` (type: `string`):

Any name, e.g. "client-acme". Each name has its own history in your account, compared on the next run with exactly the same name (upper/lower case counts). Schedule the Actor weekly to get alerts.

## `refreshPages` (type: `boolean`):

A monitor remembers the pages it picked from your sitemaps and checks the same ones on every run. Turn this on for one run to pick a new list, then turn it off again.

## `includeFieldData` (type: `boolean`):

Fetch Core Web Vitals from real Chrome users (p75). Pages with too little traffic fall back to whole-site (origin) data, or are marked "insufficient-data".

## `historyWeeks` (type: `integer`):

Weekly CrUX history points (28-day rolling windows). 0 = off. Max 40 (CrUX History API limit).

## `lighthouseCategories` (type: `array`):

Performance is always included.

## `lighthouseAlerts` (type: `boolean`):

Off by default. Lighthouse scores of an unchanged page can differ a lot from test to test (in our tests by 20 to 50 points on heavy pages), so these alerts may be FALSE ALARMS. Scores, history and comparisons are always recorded; alerts from real users (CrUX) do not need this option.

## `performanceScoreDropAlert` (type: `integer`):

Only used when "Experimental: Lighthouse alerts" is on. Alert when the performance score is at least this many points below the median of the last 5 checks and a second, fresh test shows it too. Needs 3 earlier checks. Higher values give fewer false alarms.

## `fieldWorseningPctAlert` (type: `integer`):

Flag a regression when a p75 gets this much worse and changes by at least LCP 250 ms, INP 50 ms or CLS 0.05. A drop to a worse rating is flagged from LCP 100 ms, INP 20 ms or CLS 0.02 on. Smaller changes are noise.

## `webhookUrl` (type: `string`):

Not available during the public trial: the value is ignored.

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

Kept below Google's per-project quotas.

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

How long to wait for one Lighthouse check before retrying. Slow pages can take 30-60 seconds.

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

How many times to retry a check after a temporary Google error or timeout.

## Actor input object example

```json
{
  "urls": [
    {
      "url": "https://www.example.com/"
    }
  ],
  "maxUrls": 50,
  "devices": [
    "mobile",
    "desktop"
  ],
  "refreshPages": false,
  "includeFieldData": true,
  "historyWeeks": 25,
  "lighthouseCategories": [
    "performance",
    "accessibility",
    "best-practices",
    "seo"
  ],
  "lighthouseAlerts": false,
  "performanceScoreDropAlert": 10,
  "fieldWorseningPctAlert": 15,
  "maxConcurrency": 4,
  "requestTimeoutSecs": 90,
  "maxRetries": 2
}
```

# Actor output Schema

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

No description

## `report` (type: `string`):

No description

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

No description

## `csv` (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": [
        {
            "url": "https://www.example.com/"
        }
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("meltemi-labs/pagespeed-core-web-vitals-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": [{ "url": "https://www.example.com/" }] }

# Run the Actor and wait for it to finish
run = client.actor("meltemi-labs/pagespeed-core-web-vitals-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": [
    {
      "url": "https://www.example.com/"
    }
  ]
}' |
apify call meltemi-labs/pagespeed-core-web-vitals-monitor --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,meltemi-labs/pagespeed-core-web-vitals-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/NnTYJD9dwoKfypSKa/builds/pzjQXr8y8rgsUrRqh/openapi.json
