# PageSpeed Insights & Core Web Vitals Monitor (`smartlinks/pagespeed-change-monitor`) Actor

Monitor PageSpeed Insights and real-user Core Web Vitals weekly. Automatic baselines, up to 3 Lighthouse samples, and regression flags. No Google API key needed. Failed audits are free.

- **URL**: https://apify.com/smartlinks/pagespeed-change-monitor.md
- **Developed by:** [SmartLinks](https://apify.com/smartlinks) (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 $3.40 / 1,000 successful url/device audits

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 & Core Web Vitals Monitor

Monitor PageSpeed Insights and Core Web Vitals weekly, with automatic baselines and lab noise filters that focus regression flags on meaningful changes.

- **Automatic baseline:** save a Task and rerun it each week; no dataset IDs to update.
- **Less Lighthouse noise:** compare the median of up to 3 lab samples, with observed ranges filtering overlapping measurements.
- **Real-user Core Web Vitals:** see CrUX p75 metrics for the URL or its origin next to Lighthouse lab scores.

> **$4 per 1,000 URL/device audits (Bronze $3.80, Silver $3.60, Gold+ $3.40). Failed audits are free.**
> Platform usage included. No Google API key needed.
>
> Example: 50 pages × mobile + desktop × 4 weekly runs = **400 audits/month = $1.60** at list price with one sample.
> Each successful lab sample is one audit; `samples: 3` triples the audit count. CrUX and comparisons cost no extra.

### Try it in 30 seconds

Use the prefilled input and start the Actor:

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

Two successful audits cost **$0.008** at list price. Open the dataset for page results and the key-value store's `OUTPUT` record for totals.
The input takes seconds to set up; Google audit completion time varies.
The built-in Google key is used automatically. An optional secret `apiKey` lets you use your own quota.

### How it compares

Public Store pricing comparison, **2026-11-18**. Prices and advertised capabilities can change.

| Actor | Published price | Workflow and data |
| --- | --- | --- |
| Actor A — bulk PSI audit | $4 / 1,000 audits | Field data; no documented automatic baseline/regression workflow. |
| Actor B — own-Chrome monitor | $30 / 1,000 + per-check fees | Monitor mode using its own Chrome audits. |
| This Actor | $4 / 1,000 audits | Automatic baseline + optional median lab sampling + CrUX field data. |

Sample counts affect the total price: this Actor bills each successful sample separately.
Regression flags describe observed changes, not proof that a deployment caused them.

### Sample output

One dataset row represents one unique URL and device. This shortened example shows Wikipedia measurements captured on 2026-11-18, before a baseline exists.

```json
{
  "schemaVersion": 1,
  "inputIndex": 0,
  "inputUrl": "https://www.wikipedia.org/",
  "finalUrl": "https://www.wikipedia.org/",
  "strategy": "mobile",
  "success": true,
  "auditedAt": "2026-11-18T12:08:14.289000+00:00",
  "lighthouseVersion": "13.6.0",
  "scores": {"performance": 100, "accessibility": 94, "best-practices": 100, "seo": 100},
  "labMetrics": {"lcpMs": 1224, "cls": 0.0005049244901665216, "tbtMs": 0},
  "fieldData": {
    "source": "url",
    "overallCategory": "FAST",
    "lcpMs": 1287,
    "inpMs": 99,
    "cls": 0,
    "fcpMs": 1160,
    "ttfbMs": 547,
    "lcpRating": "good",
    "inpRating": "good",
    "clsRating": "good",
    "fcpRating": "good",
    "ttfbRating": "good",
    "coreWebVitalsAssessment": "passed",
    "note": null,
    "reason": null
  },
  "comparisonStatus": "no_baseline",
  "baselineAuditedAt": null,
  "regressions": [],
  "improvements": []
}
```

Scores are 0–100 points. Times are milliseconds; CLS is unitless. Field values are p75 observations over a rolling 28-day window.
`overallCategory` preserves Google's `FAST` / `AVERAGE` / `SLOW`; individual ratings translate these to `good` / `needs-improvement` / `poor`.
Missing values stay `null`; measured zero stays zero. If no field data is available, `source` is `none`, the assessment is `insufficient-data`, and `reason` explains why.
If INP is unavailable, the assessment uses LCP and CLS, with that limitation in `note`.

The full row also contains requested categories, all lab metrics, missing-value reasons, deltas, and up to five compact opportunity summaries.
With repeated lab sampling, it adds `sampleCount`, `sampleResults`, and `sampleRanges`.
Field data comes from the last successful sample; it is not a median of the lab samples.

#### OUTPUT summary

Illustrative shortened summary for two successful mobile audits: one URL has passing field data and the other has none.
Counts refer to stored URL/device rows, not individual samples. `chargedEvents` is the actual billing manager total; billing can be disabled locally.

```json
{
  "schemaVersion": 1,
  "status": "complete",
  "keySource": "operator",
  "inputCount": 2,
  "uniqueUrls": 2,
  "plannedAudits": 2,
  "rowsWritten": 2,
  "succeeded": 2,
  "failed": 0,
  "chargedEvents": 2,
  "billingMode": "pay_per_event",
  "fieldDataUrl": 1,
  "fieldDataOrigin": 0,
  "fieldDataNone": 1,
  "cwvPassed": 1,
  "cwvFailed": 0,
  "fieldRegressionCheck": false,
  "comparisonCounts": {"matched": 0, "no_baseline": 2, "incompatible": 0, "error": 0},
  "regressionRows": 0,
  "regressions": {},
  "baselineMode": "automatic",
  "baselineAdvanced": true,
  "psiCalls": 2,
  "stoppedForQuota": false,
  "stoppedForRunCap": false,
  "stoppedForMaxCharge": false,
  "stoppedForBillingError": false,
  "unprocessedAudits": 0
}
```

`fieldDataUrl + fieldDataOrigin + fieldDataNone` equals the stored row count, including failed audits without field data.
Insufficient field data is excluded from both `cwvPassed` and `cwvFailed`.
`OUTPUT.regressions` counts flags by metric; `regressionRows` counts affected URL/device rows.
The complete summary also reports improvements, errors, duplicates, excess URLs, thresholds, samples, resumed audits, and mean audit time.
Partial runs have `status: "partial"` and exit 0 (Apify SUCCEEDED). `stopReason`, `statusMessage`, and stop flags explain failures or limits; the same message appears in the run status. Handled input errors exit 0 with `OUTPUT.error`. Internal, storage, and billing failures exit 1.

### Set up weekly monitoring and alerts

1. Save your URLs and settings as an **Apify Task**. Leave `previousDatasetId` and `previousResults` unset.
2. Set a stable `monitorId` for each independent monitor and attach a weekly **Apify Schedule**.
3. The first complete valid run establishes the baseline. Subsequent runs compare and advance it automatically.
4. Review rows with a nonempty `regressions` array, or connect an integration to deliver alerts.

Without `monitorId`, the normalized URL set and devices determine monitor identity; changing them starts a new monitor.
Only complete valid runs advance the baseline. Any failed/rejected row, cap, quota, deadline, failure breaker, billing error, or URL truncation preserves the previous baseline.
Use a non-overlapping Schedule if each run must compare with its immediately preceding run.

#### Slack, email, and webhook alerts

Attach an **Actor run succeeded** integration/webhook to the saved Task in Apify Console.
In your Apify integration or webhook receiver:

1. Read the event's `resource.defaultKeyValueStoreId` and fetch its `OUTPUT` record through the Apify API.
2. Filter on `status == "complete"` and `regressionRows > 0`.
3. Fetch `resource.defaultDatasetId` and keep rows whose `regressions` array is nonempty.
4. Send Slack/email through your Apify integrations, or forward a JSON webhook with URL, device, flags, and observation times.
5. Deduplicate notifications by run ID. Keep authorization in the integration's secret connection.

Route `status == "partial"` from the succeeded webhook using `OUTPUT.statusMessage` and stop flags. Add an **Actor run failed** route for internal, storage, or billing failures.
Notification delivery is handled by your chosen integration; the Actor produces the comparison data.

#### Use in CI

Start the saved Task through the Apify API after a deployment, wait for completion, and read `OUTPUT`.
Check `OUTPUT.status` explicitly: a partial run exits 0 but can fail your CI audit policy. Use `regressionRows > 0` to trigger a review or your CI failure policy.
Read dataset rows for the affected URLs and metrics. Use a separate `monitorId` for an independent CI monitor.
For an explicit before/after snapshot, supply `previousDatasetId` with the dataset picker or inline `previousResults`; manual comparisons do not advance automatic baselines.

### FAQ

**Are lab and field Core Web Vitals the same?**
No. Lighthouse is a lab measurement from a Google-run audit. CrUX summarizes real Chrome users over a rolling 28 days, where enough data exists.
The row keeps `labMetrics` and `fieldData` separate. CrUX availability depends on the data returned by PageSpeed Insights; a successful lab audit does not guarantee field coverage.

**Why do scores vary between runs?**
Network, server responses, and test conditions vary. Set `samples` to 2 or 3 to compare lab medians.
When either side has multiple samples, lab flags also require non-overlapping observed ranges.
These ranges are a noise filter, not statistical confidence intervals or a guarantee against false positives.

**What counts as a regression?**
By default: a performance drop of at least 5 points, LCP increase of at least 500 ms, or CLS increase of at least 0.05.
Lab thresholds also detect improvements in the opposite direction; customize them with `regressionThresholds`.
`delta` is current minus baseline. Missing numeric values have null deltas and reasons.
Field data is excluded by default because its 28-day window changes slowly.
With `fieldRegressionCheck: true`, a worse LCP, INP, or CLS rating adds `fieldData.lcpMs`, `fieldData.inpMs`, or `fieldData.cls` to `regressions` only when the compatible baseline has the same source and both metric values/ratings are available.
Field rating changes have no numeric delta or lab noise-range requirement.

**Does origin field data describe this exact URL?**
`source: "url"` is URL-level data. `source: "origin"` describes the origin, shared across its pages.
The Actor uses `loadingExperience` first, honoring `origin_fallback`; otherwise it uses `originLoadingExperience`.
No data produces `source: "none"` with a human-readable reason. A passing assessment requires good LCP, INP, and CLS ratings; when INP is missing, LCP and CLS determine it and `note` says so.
Missing LCP or CLS, or an unknown required rating, produces `insufficient-data`.

**Which baseline is used?**
The newest successful observation for the normalized URL/device must match schema version, categories, Lighthouse major version, and have a valid timestamp.
Minor/patch versions may differ. The row reports `matched`, `no_baseline`, `incompatible`, or `error`.
Automatic baselines use named storage; the newest five snapshots are kept. Overlapping runs can share a predecessor.
A complete run can establish a new compatible baseline after a category or Lighthouse version change.

**Do I need a key, and what happens at the limits?**
No Google API key is needed for the default run. The shared built-in key supports up to 500 URLs and 1,000 Google calls per run; your own key allows up to 1,000 URLs and 6,000 calls.
Google quotas still apply. The first HTTP 429 stops new requests and retries; valid rows already completed or finishing in flight are still delivered and charged once. The run has `status: "partial"`, exits 0, and preserves the baseline.
Timeouts/network errors are not retried; HTTP 5xx errors may receive three retries within `maxAudits` and the run-wide guards. HTTP 401/403 stops further audits immediately. Ten consecutive failed attempts, or fewer than 20% successful attempts after at least 20 attempts, also stops new audits and retries. Each 5xx retry counts as an attempt; URL rejections do not.
`maxRunSecs` defaults to 3,000 seconds, including setup and restarts. Slow requests, validation, and retry waits are cancelled at the deadline; completed rows and charges are retained. The Actor also reserves 30 seconds before the platform timeout for delivery and OUTPUT.

**What is billed when samples fail or field data is missing?**
A successful URL/device row costs one audit event per successful requested sample. A failed sample group is free, including successful samples within that failed group.
Rejected URLs, timeouts, quota errors, invalid Lighthouse responses, and all-null lab results are free.
Missing CrUX data neither adds nor removes a charge. Quota and failure breakers stop further work without cancelling charges for valid delivered rows.
Maximum run charge limits scheduling. Dataset writes and charges are separate operations; an interrupted run can require reconciliation before restarting it.

### Related Actors by SmartLinks

- [SEO Deploy Guard](https://apify.com/smartlinks/seo-deploy-guard)
- [YouTube Transcript API](https://apify.com/smartlinks/youtube-transcript-api)

### Limits

Supply explicit public URLs you have permission to audit; the Actor does not discover pages.
Credentials, private destinations, and likely sensitive URL data are rejected. Ordinary public query strings, including `utm_*`, are preserved.
Different queries remain different pages. Rejected rows hide the URL and identify the input with `inputIndex` and `errorCode`.
DNS is checked before the audit and on its final URL; Google controls intermediate redirects. Submit public, non-personal pages only.

The URL cap applies after normalization and deduplication; rejected entries also consume it. Excess entries appear in `OUTPUT.urlsOverLimit`.
`maxAudits` includes both devices, all samples, and retries. For example, 500 URLs on both devices with one sample exhaust the shared-key 1,000-call cap before retries.
`maxRunSecs` is 3,000 by default (range 1–86,400); the platform timeout may shorten it, with 30 seconds reserved for final output. Deadline and failure counters persist across restarts. The failure breaker stops on HTTP 401/403, 10 consecutive failures, or <20% success after at least 20 HTTP attempts, including retries. Already in-flight work may finish within the deadline; valid delivered rows remain billed once.
Manual baseline datasets read the newest 20,000 rows. Google quota, response times, and field-data coverage can limit results.

### Input reference

| Input | Default | Behavior |
| --- | --- | --- |
| `urls` | Required | Nonempty array of public HTTP(S) URLs; duplicates removed. |
| `strategy` | `mobile` | `mobile`, `desktop`, or `both`; both produces two rows per URL. |
| `categories` | All four | Nonempty subset of `performance`, `accessibility`, `best-practices`, `seo`. |
| `apiKey` | Built-in key | Optional secret Google API key; never copied to results. |
| `monitorId` | URL set + devices | Stable monitor ID: 1–100 letters, digits, underscores, or hyphens. |
| `samples` | 1 | Integer 1–3; lab median/ranges; each successful sample in a successful row is billed. |
| `maxAudits` | 1000 | PSI call cap including retries/samples. Built-in key ceiling: 1000; own key: 6000. |
| `maxRunSecs` | 3000 | Integer 1–86400; overall audit deadline across restarts, shortened to reserve 30 seconds before platform timeout. |
| `fieldRegressionCheck` | `false` | Opt into worse CWV rating flags against field data of the same source. |
| `previousDatasetId` | None | Manual previous dataset via read-only dataset picker. |
| `previousResults` | None | Inline previous rows; cannot combine with `previousDatasetId`. |
| `regressionThresholds` | Performance 5; LCP 500 ms; CLS 0.05 | Positive magnitudes keyed by `scores.*` or `labMetrics.*`; merges with defaults. |
| `maxUrls` | 100 | Integer 1–1000; effectively capped at 500 with the built-in key. |
| `maxConcurrency` | 4 | Integer 1–10 concurrent audits. |
| `timeoutSecs` | 120 | Integer 1–300; timeout per HTTP attempt. |

# Actor input Schema

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

Public pages you have permission to audit. Public queries are kept, including utm\_\* parameters. Sensitive parameter names, emails, JWTs and long high-entropy values are rejected. No credentials or personal URLs. Duplicates are removed.

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

Both produces two separate audits per unique URL.

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

Requested scores; snapshot comparison requires the same category selection.

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

Optional: your own Google API key. Leave empty to use the built-in key (up to 500 URLs per run); your key allows up to 1000. Never copied to results or logs.

## `previousDatasetId` (type: `string`):

Dataset of an earlier run of this Actor, used as the before side of the comparison. Read-only access is granted to this dataset only. Do not combine with previousResults.

## `previousResults` (type: `array`):

Prior rows from this Actor. Use instead of previousDatasetId.

## `regressionThresholds` (type: `object`):

Positive magnitudes keyed by scores.\* or labMetrics.\*. Defaults: 5 performance points, 500 ms LCP, 0.05 CLS. Same thresholds apply to improvements.

## `monitorId` (type: `string`):

Optional stable ID (letters, digits, underscores or hyphens). Default: hash of normalized URL set and device selection. Separate IDs isolate monitors.

## `fieldRegressionCheck` (type: `boolean`):

Optional: flag worse LCP, INP or CLS ratings only when the baseline has the same field-data source (URL or origin). CrUX covers a rolling 28 days; disabled by default. Lab checks are unchanged.

## `samples` (type: `integer`):

Each successful sample is billed as an audit ($0.004). Median and observed ranges; all samples must succeed.

## `maxAudits` (type: `integer`):

Includes samples and retries. Built-in key: up to 1000 Google calls per run; own key up to 6000.

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

Bounded per run.

## `timeoutSecs` (type: `integer`):

Bounded per run.

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

Hard cap after deduplication. Built-in key: capped at 500 (1000 audits with both devices); your own key: up to 1000 URLs. Excess URLs are counted in OUTPUT.

## `maxRunSecs` (type: `integer`):

Overall audit deadline including setup and restarts. Also stops audit work 30 seconds before the platform timeout to allow delivery and OUTPUT to be saved.

## Actor input object example

```json
{
  "urls": [
    "https://example.com/",
    "https://www.wikipedia.org/"
  ],
  "strategy": "mobile",
  "categories": [
    "performance",
    "accessibility",
    "best-practices",
    "seo"
  ],
  "regressionThresholds": {
    "scores.performance": 5,
    "labMetrics.lcpMs": 500,
    "labMetrics.cls": 0.05
  },
  "fieldRegressionCheck": false,
  "samples": 1,
  "maxAudits": 1000,
  "maxConcurrency": 4,
  "timeoutSecs": 120,
  "maxUrls": 100,
  "maxRunSecs": 3000
}
```

# Actor output Schema

## `audits` (type: `string`):

One row per unique URL and device: Lighthouse lab scores, CrUX field Core Web Vitals, baseline deltas and regression flags.

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

OUTPUT record: audit counts, field-data source and Core Web Vitals counts, comparisons, regressions, errors and billing totals.

# 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://example.com/",
        "https://www.wikipedia.org/"
    ],
    "regressionThresholds": {
        "scores.performance": 5,
        "labMetrics.lcpMs": 500,
        "labMetrics.cls": 0.05
    }
};

// Run the Actor and wait for it to finish
const run = await client.actor("smartlinks/pagespeed-change-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://example.com/",
        "https://www.wikipedia.org/",
    ],
    "regressionThresholds": {
        "scores.performance": 5,
        "labMetrics.lcpMs": 500,
        "labMetrics.cls": 0.05,
    },
}

# Run the Actor and wait for it to finish
run = client.actor("smartlinks/pagespeed-change-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://example.com/",
    "https://www.wikipedia.org/"
  ],
  "regressionThresholds": {
    "scores.performance": 5,
    "labMetrics.lcpMs": 500,
    "labMetrics.cls": 0.05
  }
}' |
apify call smartlinks/pagespeed-change-monitor --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,smartlinks/pagespeed-change-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/wDBmMARYjP4riDFZb/builds/4qm2NdUK7qI4LoluA/openapi.json
