# Core Web Vitals Bulk Checker: LCP, INP, CLS for many URLs (`opstoolkit/core-web-vitals-checker`) Actor

Test many URLs or a whole sitemap for Core Web Vitals. Get real-user LCP, INP and CLS from Chrome UX Report plus Lighthouse scores, mobile and desktop, with pass or fail on your limits. Needs your own free Google API key. $0.002 per page tested.

- **URL**: https://apify.com/opstoolkit/core-web-vitals-checker.md
- **Developed by:** [Elio Saliba](https://apify.com/opstoolkit) (community)
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $2.00 / 1,000 page testeds

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 Bulk Checker: LCP, INP and CLS for many URLs

Give it a list of page URLs, or a domain or sitemap, and get a pass or fail per page against Google's Core Web Vitals limits. Each row has real-user LCP, INP and CLS from the Chrome UX Report and the Lighthouse lab scores, for mobile, desktop or both.

It runs Google's PageSpeed Insights API with **your own free Google API key**. You keep the relationship with Google and the 25,000 tests a day that come with the key. This Actor does the work around it: reading the sitemap, running tests in parallel, retrying, applying your limits and writing one clean table.

**$0.002 per page tested** ($2 per 1,000). Pages Google cannot load are free. A run without a key is a free demo with clearly marked sample rows.

### Why you bring your own key

Google's API terms do not let a third party sublicense the API or resell what it returns. So this Actor does not use a shared key and does not sell Google access. You create a key in your own Google Cloud project (a few minutes, no cost), paste it in the input, and the tests are made under your account with Google. The key is a secret input field. It goes to Google in a request header, it is not logged, and it is not written to the dataset.

How to get a key:

1. Open the Google Cloud console and create a project, or pick one you have.
2. Enable the **PageSpeed Insights API** for that project.
3. Under APIs and services, Credentials, create an API key. Leave it unrestricted, or restrict it to the PageSpeed Insights API only. Do not add a website or IP restriction, because the call comes from Apify.
4. Paste it into **Your Google API key**.

Google's own limits apply to your key: 25,000 tests a day and 240 a minute per project at the time of writing.

### What you get

One row per page and device.

| Column | Example | Notes |
|---|---|---|
| `url`, `finalUrl` | `https://web.dev/` | The page you gave, and where Google ended up |
| `strategy` | `mobile` | `mobile` or `desktop` |
| `passed` | `false` | `true`, `false`, or `null` when there is no data |
| `failedMetrics` | `["LCP", "INP"]` | Which limits the page missed |
| `assessmentBasis` | `field_url` | `field_url` (real visits to this page), `field_origin` (real visits to the whole site), `lab` (Lighthouse run) |
| `fieldLcpMs`, `fieldInpMs`, `fieldCls` | `3100`, `240`, `0.06` | 75th percentile from the Chrome UX Report, over the last 28 days |
| `fieldLcpRating`, `fieldInpRating`, `fieldClsRating` | `needs improvement` | Google's own rating |
| `fieldFcpMs`, `fieldTtfbMs` | `1500`, `600` | Other real-user timings |
| `performanceScore` | `64` | Lighthouse lab score, 0 to 100 |
| `labLcpMs`, `labCls`, `labTbtMs`, `labFcpMs`, `labSpeedIndexMs`, `labTtiMs` | `3300` | Lighthouse lab timings |
| `accessibilityScore`, `bestPracticesScore`, `seoScore` | `95` | Only when you tick them. No extra charge |
| `topOpportunities` | `[{"id": "render-blocking-resources", "savingsMs": 450}]` | The five biggest Lighthouse time savings |
| `status` | `ok` | `ok`, `page_failed`, `error`, `not_checked`, `demo` |

A `SUMMARY` record in the key-value store has the pass and fail counts per device, the ten slowest pages by LCP, the limits used and anything that went wrong.

Export as JSON, CSV, Excel or HTML.

### How pass or fail is decided

- **Real-user data first.** A page passes when its LCP and CLS, and its INP when Google has one, are within your limits. The defaults are Google's good limits: LCP 2500 ms, INP 200 ms, CLS 0.1. Pages with few interactions have no INP, and Google judges them on LCP and CLS.
- **Whole-site data when the page has none.** Small pages often lack enough real visits. Google then gives data for the whole site. The row says so in `assessmentBasis`. Switch it off with **Use whole-site data when the page has none**.
- **Lab test as a last resort.** With no real-user data at all, the row is judged on the Lighthouse run (LCP, CLS, total blocking time under 200 ms). `assessmentBasis` is `lab`. Switch it off to get `no_data` instead.
- **Optional score floor.** Set a minimum Lighthouse performance score and pages below it fail even when the vitals are good.

Lab numbers come from one simulated load and move from run to run. Real-user numbers are a 28-day average and are the ones Google uses for search. Read them as two different things.

### How to use

1. **Paste your Google API key.**
2. **Add page URLs**, one per line, or a domain or sitemap link under **Websites or sitemap links**. Sitemaps are read through robots.txt and `/sitemap.xml`, with the same reader as the Sitemap URL Extractor.
3. **Pick the device.** Mobile is the one Google ranks on. Both tests every page twice and is billed twice.
4. **Set Max pages**, then start. A test takes Google 10 to 40 seconds, so 50 pages with 5 in parallel take about 3 to 5 minutes.

### Use it from an AI agent

In Claude, ChatGPT or Cursor, add the Apify MCP server (https://mcp.apify.com) and ask the agent to run this Actor. The agent needs your Google API key for the `googleApiKey` field, plus the pages or sitemap to test. Without a key the run is a free demo with sample rows.

Example prompt: "Use the Apify Actor opstoolkit/core-web-vitals-checker on example.com's sitemap, mobile only, 30 pages, and list the pages that fail LCP."

### Input example

```json
{
  "googleApiKey": "<your key>",
  "urls": ["https://web.dev", "https://crawlee.dev"],
  "sitemapUrls": ["https://example.com"],
  "maxUrlsPerSitemap": 100,
  "strategy": "both",
  "lcpThresholdMs": 2500,
  "inpThresholdMs": 200,
  "clsThreshold": 0.1,
  "minPerformanceScore": 80,
  "extraCategories": ["seo"],
  "maxConcurrency": 5
}
```

### Output example

One row, shortened:

```json
{
  "url": "https://example.com/pricing",
  "strategy": "mobile",
  "status": "ok",
  "passed": false,
  "failedMetrics": ["LCP"],
  "assessmentBasis": "field_url",
  "fieldDataLevel": "url",
  "fieldLcpMs": 3100,
  "fieldInpMs": 180,
  "fieldCls": 0.06,
  "performanceScore": 64,
  "labLcpMs": 3300,
  "labTbtMs": 210,
  "topOpportunities": [{"id": "render-blocking-resources", "title": "Eliminate render-blocking resources", "savingsMs": 450}]
}
```

### Demo mode

If **Your Google API key** is empty, nothing is sent to Google. The Actor returns sample rows for your pages with made-up numbers, so you can see the table and the summary before you set up a key. Every sample row has `sample: true`, `status: "demo"` and a note that says it is not a measurement. Demo rows are free.

### Pricing

Pay per event: **$0.002 per page tested**, plus Apify's small run start fee. One test is one page on one device that came back with results.

| Job | Cost |
|---|---|
| 100 pages, mobile | $0.20 |
| 100 pages, mobile and desktop | $0.40 |
| 1,000 pages, mobile | $2.00 |

Free: pages Google could not load, failed tests, tests not run because you hit your max cost, and demo rows. The Google API itself costs you nothing within its free daily quota.

**Max cost per run.** The Actor stops cleanly when your limit is reached. Rows already done are kept, the rest are marked `not_checked`.

### Limits

- Real-user data exists only for pages with enough Chrome traffic. Many small sites get whole-site data or none.
- The Actor does not load your pages. Google does, from its own servers, so pages behind a login, a firewall or an IP allow-list cannot be tested.
- Your key's daily quota is Google's, 25,000 tests a day per project. If it runs out, the Actor stops and says so.
- Up to 5,000 pages per run. One sitemap is read up to 40 files deep.
- Google's tests sometimes fail on heavy or slow pages. Those rows say `page_failed` with Google's reason and cost nothing.
- Chrome UX Report data is published by Google under the Creative Commons Attribution 4.0 licence. If you republish it, credit it.

### Works well with

- [Sitemap URL Extractor](https://apify.com/opstoolkit/sitemap-url-extractor): list every page of a site, keep the ones that matter, then paste those URLs here.
- [Website SEO and Broken Link Audit](https://apify.com/opstoolkit/site-seo-link-audit): run it on the same pages for titles, links and redirects, and compare with the failing pages here.
- [Structured Data Checker](https://apify.com/opstoolkit/structured-data-checker): check schema markup on the pages that pass.
- [Website Tech Stack Detector](https://apify.com/opstoolkit/website-tech-stack-detector): see which platform or plugin the slow pages share.

### Not affiliated with Google

PageSpeed Insights, Lighthouse and the Chrome UX Report are Google products. This Actor is an independent tool that calls the public API with your key.

# Changelog

This Actor's version history is a separate document: https://apify.com/opstoolkit/core-web-vitals-checker/changelog.md

# Actor input Schema

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

A free key from your own Google Cloud project with the PageSpeed Insights API enabled (console.cloud.google.com, APIs and services, Credentials). Paste the key text as is. It allows 25,000 tests a day. It is sent to Google only and is not stored. Leave it empty for a free demo run: sample rows marked sample true and status demo, nothing measured. Real results need a key.

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

Full page URLs, one per item, including https://. Example: \["https://example.com/pricing", "https://example.com/blog"]. Each page is tested once per device, and each test is billed. Give this, sitemapUrls, or both. Capped by maxUrls.

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

A domain or a sitemap link, one per item. Example: \["example.com", "https://example.com/sitemap.xml"]. The Actor reads the sitemap (robots.txt first, then /sitemap.xml) and adds those pages to the URLs list. Each sitemap is capped by maxUrlsPerSitemap, and the total by maxUrls.

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

Which device Google simulates: mobile, desktop or both. Mobile is the one Google uses for ranking. Both tests every page twice and is billed twice. Default: mobile.

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

Most pages tested in the run, including pages read from sitemaps. A whole number from 1 to 5000, for example 100. You pay per test, so this caps the cost. Default: 50.

## `maxUrlsPerSitemap` (type: `integer`):

Most pages taken from each sitemap. A whole number from 1 to 5000, for example 100. Stops one big site from using the whole list. Default: 50.

## `lcpThresholdMs` (type: `integer`):

Largest contentful paint limit in milliseconds. A page fails when its LCP is slower than this. A whole number from 100 to 60000. Google's good limit, and the default, is 2500.

## `inpThresholdMs` (type: `integer`):

Interaction to next paint limit in milliseconds. A page fails when its INP is slower than this. A whole number from 10 to 10000. Google's good limit, and the default, is 200. Pages with no INP data are judged on LCP and CLS.

## `clsThreshold` (type: `number`):

Cumulative layout shift limit, a plain number without a unit, for example 0.1. A page fails when its CLS is higher than this. From 0 to 5. Google's good limit, and the default, is 0.1.

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

A whole number from 0 to 100, for example 80. Pages whose Lighthouse lab performance score is below this also fail, even when the vitals pass. 0 ignores the score. Default: 0.

## `useOriginFallback` (type: `boolean`):

When true, a page without enough real visits of its own is judged on the whole site's real-user data (origin), and the row says so in assessmentBasis. When false, such pages fall through to the lab fallback. Default: true.

## `labFallback` (type: `boolean`):

When true and there is no Chrome UX Report data at all, pass or fail uses the Lighthouse run (LCP, CLS and total blocking time). When false the row gets assessment no_data. Default: true.

## `extraCategories` (type: `array`):

Extra Lighthouse scores to add to each row, any of accessibility, best-practices, seo. Example: \["seo", "accessibility"]. Performance is always included. These come from the same test at no extra charge. Leave empty for none.

## `includeOpportunities` (type: `boolean`):

When true, each row gets the five Lighthouse opportunities with the biggest time saving, in topOpportunities. Default: true.

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

How many tests run at once. A whole number from 1 to 10. A test takes Google 10 to 40 seconds, so more parallel tests finish sooner. Lower it if Google answers with rate limit errors. Default: 5.

## Actor input object example

```json
{
  "urls": [
    "https://apify.com",
    "https://crawlee.dev",
    "https://web.dev"
  ],
  "strategy": "mobile",
  "maxUrls": 50,
  "maxUrlsPerSitemap": 50,
  "lcpThresholdMs": 2500,
  "inpThresholdMs": 200,
  "clsThreshold": 0.1,
  "minPerformanceScore": 0,
  "useOriginFallback": true,
  "labFallback": true,
  "includeOpportunities": true,
  "maxConcurrency": 5
}
```

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

// Run the Actor and wait for it to finish
const run = await client.actor("opstoolkit/core-web-vitals-checker").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://apify.com",
        "https://crawlee.dev",
        "https://web.dev",
    ] }

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

```

## MCP server setup

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

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/vJYfuLnEjYS9wG6RE/builds/JANFrmy8MsqEefJxo/openapi.json
