# Bulk PageSpeed Insights & Core Web Vitals History (`durance_dev/core-web-vitals-history`) Actor

Bulk Core Web Vitals for any URL: Lighthouse scores, real-user LCP/INP/CLS and up to 40 weeks of CrUX history with trends. Built-in API key. Pay per URL.

- **URL**: https://apify.com/durance_dev/core-web-vitals-history.md
- **Developed by:** [Aleksejs Pravotorovs](https://apify.com/durance_dev) (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

from $4.00 / 1,000 lab audits

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

## Core Web Vitals History & PageSpeed Audit (CrUX + Lighthouse)

**Bulk Core Web Vitals checker with real-user history.** Give it a list of URLs or domains. For every URL and device you get:

- **Real users now:** LCP, INP, CLS, FCP and TTFB at the 75th percentile from the Chrome UX Report (CrUX), the good / needs-improvement / poor shares, and a pass/fail Core Web Vitals verdict.
- **Real users over time:** up to **40 weeks of weekly CrUX history** with a trend verdict per metric (improving, stable or worsening) and the % change. This is the part a normal PageSpeed check cannot show you.
- **Lab audit:** Lighthouse performance, accessibility, best-practices and SEO scores, lab metrics and the top 5 fixes ranked by estimated time saved (bulk PageSpeed Insights).

A built-in Google API key is included, so no Google Cloud setup is needed. You pay per URL, and failed audits are free.

### Why history matters

A single PageSpeed Insights test is one moment in time, and lab scores swing by several points between runs. The Chrome UX Report History API gives about 10 months of weekly real-user data for the same page, so you can see whether a site is **getting better or worse**, and since when.

Google also says it plans to stop including real-user data in the PageSpeed Insights API: *"We plan to discontinue including real-world data from the Chrome User Experience Report in this API"*, and recommends the CrUX API and the CrUX History API instead ([Google, PageSpeed Insights API get-started](https://developers.google.com/speed/docs/insights/v5/get-started)). This Actor already reads real-user data directly from the CrUX API and the CrUX History API, so that change will not affect it.

### Use cases

- **Agency client reporting:** monthly Core Web Vitals per client page, with trends instead of a single snapshot.
- **Prospect lists:** run 1,000 domains in *Field only* mode and filter for "LCP worsened by more than 20% since summer" or "fails Core Web Vitals on mobile".
- **Redesign before/after:** compare the weekly series around a launch date.
- **Competitor benchmark:** put competitors' domains in the list and compare origin-level p75 values.
- **Core Web Vitals monitoring:** schedule a weekly run with **Monitor mode** to get a row only when a status, rating or trend changes.
- **AI agents:** compact, flat output that an LLM can read; works through the Apify MCP server.

### How to run

#### In Apify Console (3 steps)

1. Paste URLs or domains into **URLs or domains** (one per line). `example.com` checks the whole origin; `https://example.com/pricing` checks that page.
2. Pick a **Mode** (*Full*, *Field only* or *Lab only*) and the **Devices**.
3. Click **Start**. Results appear in the **Overview** table; use **Full detail** for the weekly series and the lab audit.

#### Through the API

```bash
curl -X POST "https://api.apify.com/v2/actors/durance_dev~core-web-vitals-history/run-sync-get-dataset-items" \
  -H "Authorization: Bearer $APIFY_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"urls": ["example.com", "https://example.com/pricing"], "mode": "fieldOnly", "devices": ["mobile", "desktop"]}'
```

The synchronous endpoint waits at most 300 seconds ([Apify API docs](https://docs.apify.com/api/v2/actor-run-sync-get-dataset-items-post.md)). For long lists, start an asynchronous run instead and read the dataset when it finishes.

#### From an AI agent (MCP)

Connect your MCP client to the [Apify MCP server](https://mcp.apify.com) and ask, for example: *"Check Core Web Vitals history for example.com on mobile."* Turn on `compactOutput` for flat rows of about 30 fields.

### Input

| Field | Type | Default | What it does |
|---|---|---|---|
| `urls` | list | (required) | Pages or bare domains, up to 5,000 per run. A missing `https://` is added and duplicates are removed. Invalid entries get their own `invalid_url` row and are not charged. |
| `mode` | `full` | `fieldOnly` | `labOnly` | `full` | *Field only* skips the lab test, which makes it about 3 times faster and cheaper. |
| `devices` | `mobile`, `desktop` | `["mobile"]` | One row per device. Mobile = Lighthouse mobile + CrUX `PHONE`; desktop = Lighthouse desktop + CrUX `DESKTOP`. |
| `includeHistory` | boolean | `true` | Adds the weekly CrUX history and trends. |
| `historyWeeks` | 1 to 40 | `25` | Number of weekly periods (40 is about 10 months). |
| `fieldScope` | `auto` | `url` | `origin` | `auto` | `auto` uses page-level data when Google has it and otherwise falls back to the whole origin. The output says which was used. |
| `lighthouseCategories` | list | all four | Performance is always included. |
| `onlyChanges` | boolean | `false` | Monitor mode: returns only rows whose Core Web Vitals status, a metric rating or a trend changed since the last run of the same watch list. |
| `watchName` | text | `default` | The name of the watch list for Monitor mode (letters, digits and dashes). |
| `compactOutput` | boolean | `false` | Flat rows for spreadsheets and AI agents, without the weekly series or audit details. |
| `googleApiKey` | secret text | empty | Optional. Your own Google API key with the PageSpeed Insights API and the Chrome UX Report API enabled. Use it for big or scheduled jobs. It is stored encrypted and never written to the output or logs. |
| `maxConcurrency` | 1 to 16 | `8` | The maximum number of lab audits running at once. |

### Output

There is one dataset item per URL and device. Each item has headline fields for the Overview table, plus `field`, `history` and `lab` detail objects. Example (values are illustrative, the weekly series is shortened):

```json
{
  "input": "https://www.example.com",
  "url": "https://www.example.com/",
  "origin": "https://www.example.com",
  "device": "mobile",
  "status": "ok",
  "checkedAt": "2026-11-17T10:15:02.000Z",
  "cwvStatus": "fail",
  "failingMetrics": ["LCP 2,940 ms (needs improvement)"],
  "fieldScope": "url",
  "lcpP75": 2940, "inpP75": 168, "clsP75": 0.02,
  "lcpTrend": "worsening", "inpTrend": "stable", "clsTrend": "stable",
  "performanceScore": 77,
  "field": {
    "scope": "url",
    "collectionPeriod": { "firstDate": "2026-10-19", "lastDate": "2026-11-15" },
    "lcp": { "p75": 2940, "rating": "needs-improvement", "goodShare": 0.7112, "niShare": 0.2004, "poorShare": 0.0884 },
    "inp": { "p75": 168, "rating": "good", "goodShare": 0.8213, "niShare": 0.1402, "poorShare": 0.0385 },
    "cls": { "p75": 0.02, "rating": "good", "goodShare": 0.9511, "niShare": 0.0305, "poorShare": 0.0184 },
    "fcp": { "p75": 1810, "rating": "needs-improvement", "goodShare": 0.7801, "niShare": 0.1502, "poorShare": 0.0697 },
    "ttfb": { "p75": 690, "rating": "good", "goodShare": 0.8403, "niShare": 0.1201, "poorShare": 0.0396 }
  },
  "history": {
    "scope": "url",
    "weeks": 25,
    "nonNullPoints": 24,
    "series": [
      { "periodEnd": "2026-05-30", "lcpP75": 2310, "inpP75": 181, "clsP75": 0.02, "cwvStatus": "pass" },
      { "periodEnd": "2026-11-14", "lcpP75": 2946, "inpP75": 168, "clsP75": 0.02, "cwvStatus": "fail" }
    ],
    "trend": { "lcp": "worsening", "inp": "stable", "cls": "stable" },
    "changePct": { "lcp": 27.5, "inp": -7.2, "cls": 0 },
    "weeksPassing": 7
  },
  "lab": {
    "performanceScore": 77, "accessibilityScore": 75, "bestPracticesScore": 96, "seoScore": 92,
    "lcpMs": 4980, "fcpMs": 2100, "tbtMs": 120, "speedIndexMs": 3900, "cls": 0.01,
    "serverResponseMs": 210, "totalByteWeightKb": 1460,
    "topOpportunities": [
      { "id": "cache-insight", "title": "Use efficient cache lifetimes", "estSavingsMs": 3600 },
      { "id": "render-blocking-insight", "title": "Render-blocking requests", "estSavingsMs": 850 }
    ],
    "lighthouseVersion": "13.6.0",
    "finalUrl": "https://www.example.com/"
  },
  "labError": null, "fieldError": null, "historyError": null,
  "attribution": "Real-user data: Chrome UX Report (CrUX) by Google, CC BY 4.0. Lab data: Google PageSpeed Insights API."
}
```

**Row status values:**

| `status` | Meaning |
|---|---|
| `ok` | Every requested part succeeded. |
| `partial` | Some parts succeeded and some failed. The reason is in `labError`, `fieldError` or `historyError`. |
| `no_field_data` | Google has no real-user data for this page or its origin (too few visits). `cwvStatus` is `insufficient_data`. |
| `lab_error` | Lighthouse could not load the page, and there is no real-user data either. |
| `quota_exhausted` | The lab test was skipped because the daily lab quota ran out. Real-user data is still returned. |
| `invalid_url` | The entry is not a public http(s) URL or domain. |
| `error` | Every requested part failed (for example, Google returned 5xx after 5 retries). |

**How the verdicts are calculated:**

- **Ratings** use Google's thresholds, read from the histogram bins of each CrUX response. Today they are: LCP good at ≤ 2,500 ms and poor above 4,000 ms; INP ≤ 200 / > 500 ms; CLS ≤ 0.1 / > 0.25 ([PageSpeed Insights: about](https://developers.google.com/speed/docs/insights/v5/about)).
- **`cwvStatus`** follows the PageSpeed Insights rule. It is a pass when LCP, INP and CLS are all good at p75. When INP has too little data, LCP and CLS decide. When LCP or CLS has no data, the page cannot be assessed (`insufficient_data`).
- **Trend:** a least-squares line is fitted through the weekly p75 values. A fitted change of 10% or more downward means `improving`, 10% or more upward means `worsening`, and anything in between is `stable`. A small absolute dead-band applies (LCP 50 ms, INP 10 ms, CLS 0.01). With fewer than 6 weekly points the trend is `unknown`.
- **`changePct`:** the last available week compared with the first available week.

The run also writes a **`SUMMARY`** record to the key-value store. It holds counts by status, the passing and failing rows, the 10 URLs that worsened most, the events charged and the number of API calls.

### Pricing (pay per event)

You pay only for results that come back. **Failed audits are free.**

| Event | When it is charged | Price |
|---|---|---|
| `lab-audit` (primary) | A successful Lighthouse audit, per URL per device | $0.004 |
| `field-snapshot` | A current CrUX record returned, per URL per device | $0.002 |
| `history-series` | A CrUX history with at least 1 week of data, per URL per device | $0.006 |

Apify also charges its small standard per-run start event ($0.00005). The same prices apply on every Apify plan.

**Example jobs:**

| Job | Calculation | Cost |
|---|---|---|
| 100 URLs, mobile, full mode | 100 × (0.004 + 0.002 + 0.006) | $1.20 |
| 1,000-domain prospect list, field only, mobile | 1,000 × (0.002 + 0.006) | $8.00 |
| 50 client URLs, weekly monitor, 2 devices | 100 × 0.012 | $1.20 per week |

- **Monitor mode:** rows that did not change are not returned and not charged for the lab audit. Their real-user and history lookups are still charged.
- **Your spending limit is respected.** When the next row would go over your *max cost per run*, the run stops cleanly with "Stopped at your max cost per run". Every row saved up to that point is in the dataset.

### Limits (please read)

- **Built-in key quota.** The built-in key shares Google's daily PageSpeed quota across all users. When it runs out, lab tests are skipped for the rest of the run (`quota_exhausted`), real-user data is still returned, and the log says so. A run with the built-in key makes at most **2,000 lab audits**. For bigger or scheduled jobs, add your own free `googleApiKey`.
- **Small sites may have no real-user data.** CrUX only covers pages and origins with enough Chrome visits ([CrUX methodology](https://developer.chrome.com/docs/crux/methodology)). Such rows return `no_field_data` and are not charged for field data.
- **Speed.** Google allows 150 CrUX queries per minute per project, and the limit cannot be raised ([CrUX API](https://developer.chrome.com/docs/crux/api)). The Actor stays at 120 per minute. Field-only with history therefore runs at about 60 rows per minute (about 120 without history). A lab audit takes 10 to 40 seconds and up to 16 run in parallel, so full mode does about 1,000 rows in roughly 50 minutes with the default 8 (estimate).
- **Freshness.** Current real-user data is a 28-day rolling window, updated daily. The history is updated every Monday ([CrUX History API](https://developer.chrome.com/docs/crux/history-api)).
- **Lab scores vary** by a few points between runs. That is normal for Lighthouse, so use the real-user trend for monitoring.

### FAQ

**What is the difference between lab and field data?**
Lab data (Lighthouse) is one simulated page load on a fixed device and network, which makes it good for debugging. Field data (CrUX) is what real Chrome users experienced over 28 days, and it is what Google's Core Web Vitals assessment uses.

**Why is there no lab value for INP?**
INP needs real user interactions. Lighthouse reports Total Blocking Time (`tbtMs`) as the lab proxy.

**How fresh is the data?**
Current CrUX data is about 2 days behind and updated daily. History periods are weekly and published on Mondays.

**Is it legal? Does it crawl my site?**
This Actor never requests your website itself. It only calls official Google APIs (PageSpeed Insights, the Chrome UX Report API and the CrUX History API), and Google's services do the page load and the measurement. The output holds aggregate performance metrics, with no personal data.

**Can I use my own Google API key?**
Yes. Create a key in Google Cloud, enable the *PageSpeed Insights API* and the *Chrome UX Report API*, and paste it into `googleApiKey`. Your key is used instead of the built-in one and has its own quota.

### Data sources and attribution

Chrome UX Report data by Google, licensed [CC BY 4.0](https://developer.chrome.com/docs/crux/methodology). Lab data comes from the Google PageSpeed Insights API. Google, PageSpeed Insights, Lighthouse and Chrome are trademarks of Google LLC. They are used here only to describe the data sources. This Actor is not affiliated with or endorsed by Google.

API references used:

- PageSpeed Insights API v5, `runPagespeed`: https://developers.google.com/speed/docs/insights/rest/v5/pagespeedapi/runpagespeed
- Chrome UX Report API, `records:queryRecord`: https://developer.chrome.com/docs/crux/api
- CrUX History API, `records:queryHistoryRecord`: https://developer.chrome.com/docs/crux/history-api
- CrUX API errors (404 `NOT_FOUND`): https://developer.chrome.com/docs/crux/guides/crux-api
- Core Web Vitals thresholds and the assessment rule: https://developers.google.com/speed/docs/insights/v5/about
- Sending an API key in the `X-goog-api-key` header: https://cloud.google.com/docs/authentication/api-keys-use
- Google API error format: https://google.aip.dev/193

### Changelog

- **0.1** (2026-11): First release. Full, field-only and lab-only modes; CrUX history with trends; Monitor mode; compact output; built-in key with bring-your-own-key option.

# Actor input Schema

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

Pages (https://example.com/pricing) or bare domains (example.com). A bare domain is checked as the whole origin. Max 5,000 per run.

## `mode` (type: `string`):

Full = lab audit + real-user data + history. Field only = real-user data + history, about 3x faster and cheaper (good for prospect lists). Lab only = PageSpeed/Lighthouse audit.

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

mobile = PageSpeed strategy 'mobile' + CrUX formFactor PHONE; desktop = 'desktop' + DESKTOP. Each device is one output row and is charged separately.

## `includeHistory` (type: `boolean`):

Weekly 28-day p75 values for LCP, INP and CLS, with an improving / stable / worsening verdict per metric.

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

1 to 40 weekly periods (40 = about 10 months). Google updates the history every Monday.

## `fieldScope` (type: `string`):

auto = page-level data if Google has it, otherwise the whole origin (the output says which).

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

Performance is always included because the lab metrics come from it.

## `onlyChanges` (type: `boolean`):

Remembers the previous result per watch list and returns a row only when the Core Web Vitals status, a metric rating or a trend changed. Schedule the Actor weekly for alerts.

## `watchName` (type: `string`):

Letters, digits and dashes. Use one name per client or project.

## `compactOutput` (type: `boolean`):

Flat row with about 30 key fields; drops audit details and the weekly series (keeps the trend verdicts).

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

Optional. Leave empty to use the built-in key. Add your own key (PageSpeed Insights API + Chrome UX Report API enabled) for large or scheduled jobs; your own key never runs out of shared quota.

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

PageSpeed audits in flight at once. Real-user (CrUX) calls are always paced under Google's 150 per minute limit.

## Actor input object example

```json
{
  "urls": [
    "https://web.dev",
    "https://www.python.org"
  ],
  "mode": "full",
  "devices": [
    "mobile"
  ],
  "includeHistory": true,
  "historyWeeks": 25,
  "fieldScope": "auto",
  "lighthouseCategories": [
    "performance",
    "accessibility",
    "best-practices",
    "seo"
  ],
  "onlyChanges": false,
  "watchName": "default",
  "compactOutput": false,
  "maxConcurrency": 8
}
```

# Actor output Schema

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

One row per URL and device: real-user Core Web Vitals (CrUX), weekly history with trends, Lighthouse lab scores and status.

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

SUMMARY record: counts by status, passing / failing URLs, the 10 URLs that worsened most, events charged.

# 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.python.org"
    ],
    "mode": "full",
    "devices": [
        "mobile"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("durance_dev/core-web-vitals-history").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.python.org",
    ],
    "mode": "full",
    "devices": ["mobile"],
}

# Run the Actor and wait for it to finish
run = client.actor("durance_dev/core-web-vitals-history").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.python.org"
  ],
  "mode": "full",
  "devices": [
    "mobile"
  ]
}' |
apify call durance_dev/core-web-vitals-history --silent --output-dataset

```

## MCP server setup

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

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/iidqJeiruLlG6iwO4/builds/g2qsyoVop4G7h6pz8/openapi.json
