# Bulk PageSpeed Insights & Core Web Vitals Checker (`cvillasanti/bulk-pagespeed-core-web-vitals`) Actor

Audit thousands of URLs or a whole sitemap with Google PageSpeed Insights: mobile and desktop Lighthouse scores, lab metrics, real-user Core Web Vitals (CrUX) and top opportunities in one record per page.

- **URL**: https://apify.com/cvillasanti/bulk-pagespeed-core-web-vitals.md
- **Developed by:** [Ciro Villasanti](https://apify.com/cvillasanti) (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 $3.00 / 1,000 page 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

## Bulk PageSpeed Insights & Core Web Vitals Checker

Audit **hundreds or thousands of URLs, or a whole sitemap,** with Google **PageSpeed Insights** and get one clean JSON record per page with **mobile and desktop Lighthouse scores**, **lab metrics** (LCP, FCP, CLS, TBT, Speed Index), **real-user Core Web Vitals from the Chrome UX Report (CrUX)** and the **top opportunities** to make the page faster.

- ✅ **Mobile and desktop in one record and one price:** no need to run the Actor twice or merge results.
- ✅ **Real-user data (CrUX):** 75th percentile LCP, INP, CLS, FCP and TTFB with Google's good / needs-improvement / poor ratings, plus a ready **Core Web Vitals passed / failed** verdict.
- ✅ **Sitemap input:** paste `sitemap.xml` (indexes and `.xml.gz` included) and audit every page of a site.
- ✅ **All four Lighthouse categories:** performance, accessibility, best practices and SEO scores from 0 to 100.
- ✅ **Fair pricing:** pages Google cannot load (DNS errors, timeouts, 5xx) are saved with the reason and are **free**.
- ✅ **No API key needed:** works out of the box. Bring your own free Google key for very large daily volumes.
- ✅ **Ready for AI agents and MCP:** flat English field names and a fully described output schema.

### What data does it extract?

| Field | Example |
|---|---|
| Performance score, mobile and desktop | `58`, `71` |
| Accessibility, best practices, SEO scores | `100`, `73`, `85` |
| Lab LCP, FCP, CLS, TBT, Speed Index | `2011 ms`, `2011 ms`, `0`, `4918 ms`, `10357 ms` |
| Real-user LCP, INP, CLS, FCP, TTFB (p75) | `2337 ms`, `372 ms`, `0.01`, `2218 ms`, `1328 ms` |
| Ratings and Core Web Vitals verdict | `good`, `needs-improvement`, `failed` |
| Top opportunities with estimated savings | `Reduce JavaScript execution time — 5300 ms` |
| Final URL after redirects, Lighthouse version | `https://apify.com/`, `13.6.0` |

### Use cases

- **SEO audits:** check Core Web Vitals, a Google ranking signal, for every page of a client site from its sitemap.
- **Agency reporting:** monthly performance snapshots for dozens of client sites; schedule the Actor and export to Google Sheets, CSV or Excel.
- **Lead generation:** find prospects with slow websites (`mobilePerformance < 50`) and pitch speed optimization.
- **Release monitoring:** run after each deploy and alert when scores drop.
- **Competitor benchmarking:** compare your pages with competitors on lab and real-user metrics.

### Input examples

**A list of pages, mobile and desktop:**

```json
{
    "urls": ["https://apify.com", "web.dev", "https://www.wikipedia.org/"]
}
```

**The first 500 pages of a sitemap, mobile only, performance and SEO only:**

```json
{
    "sitemapUrls": ["https://www.example.com/sitemap.xml"],
    "maxUrlsPerSitemap": 500,
    "strategies": ["mobile"],
    "categories": ["performance", "seo"]
}
```

| Field | Description |
|---|---|
| `urls` | Pages to audit. `https://` is added when missing and duplicates are removed. Up to 10,000 per run. |
| `sitemapUrls` | Sitemap URLs. Sitemap indexes and gzipped sitemaps are followed. |
| `maxUrlsPerSitemap` | How many pages to take from each sitemap. Default `100`. |
| `strategies` | `mobile`, `desktop` or both. Default both. |
| `categories` | `performance`, `accessibility`, `best-practices`, `seo`. Default all four. |
| `apiKey` | Optional. Your own free PageSpeed Insights API key, stored as a secret. |

### Output example

```json
{
    "url": "https://apify.com/",
    "finalUrl": "https://apify.com/",
    "mobilePerformance": 58,
    "desktopPerformance": 71,
    "coreWebVitals": "failed",
    "mobile": {
        "scores": {
            "performance": 58,
            "accessibility": 100,
            "bestPractices": 73,
            "seo": 85
        },
        "lab": {
            "lcpMs": 2011,
            "fcpMs": 2011,
            "cls": 0,
            "tbtMs": 4918,
            "speedIndexMs": 10357
        },
        "field": {
            "source": "url",
            "overall": "needs-improvement",
            "coreWebVitalsPassed": false,
            "lcpMs": 2337,
            "lcpRating": "good",
            "inpMs": 372,
            "inpRating": "needs-improvement",
            "cls": 0.01,
            "clsRating": "good",
            "fcpMs": 2218,
            "fcpRating": "needs-improvement",
            "ttfbMs": 1328,
            "ttfbRating": "needs-improvement"
        },
        "opportunities": [
            {
                "id": "bootup-time",
                "title": "Reduce JavaScript execution time",
                "savingsMs": 5300
            },
            {
                "id": "mainthread-work-breakdown",
                "title": "Minimize main-thread work",
                "savingsMs": 4900
            }
        ],
        "lighthouseVersion": "13.6.0",
        "error": null
    },
    "desktop": {
        "scores": {
            "performance": 71,
            "accessibility": 100,
            "bestPractices": 73,
            "seo": 85
        },
        "lab": {
            "lcpMs": 568,
            "fcpMs": 568,
            "cls": 0.003,
            "tbtMs": 921,
            "speedIndexMs": 1221
        },
        "field": {
            "source": "url",
            "overall": "needs-improvement",
            "coreWebVitalsPassed": true,
            "lcpMs": 1567,
            "lcpRating": "good",
            "inpMs": 78,
            "inpRating": "good",
            "cls": 0,
            "clsRating": "good",
            "fcpMs": 1459,
            "fcpRating": "good",
            "ttfbMs": 982,
            "ttfbRating": "needs-improvement"
        },
        "opportunities": [
            {
                "id": "bootup-time",
                "title": "Reduce JavaScript execution time",
                "savingsMs": 900
            },
            {
                "id": "mainthread-work-breakdown",
                "title": "Minimize main-thread work",
                "savingsMs": 900
            }
        ],
        "lighthouseVersion": "13.6.0",
        "error": null
    },
    "error": null,
    "checkedAt": "2026-11-23T16:27:01.762Z"
}
```

`coreWebVitals` at the top level is the verdict from real mobile users (Google ranks with mobile data). Mobile INP is the metric that most often fails: in the example above the desktop data passes while mobile does not. `field.source` is `url` when Google has data for that exact page and `origin` when it falls back to the whole site. `field` is `null` for pages with too little traffic to appear in the Chrome UX Report.

### Pricing

Pay per event: you pay per page audited.

| Event | When it is charged |
|---|---|
| `audit` | Once per page that Google audited, with mobile and desktop included. |

Pages Google could not load are saved with an `error` and are free. Set a **maximum cost per run** in the run options and the Actor stops cleanly when it reaches it.

### Tips and limits

- Google runs Lighthouse on its own servers. Most pages take 10 to 40 seconds; heavy pages can take a few minutes. The Actor audits 10 pages in parallel, about 1,000 pages per hour.
- Lab scores vary a few points between runs. That is how Lighthouse works; real-user `field` data is stable over its 28-day window.
- Only public pages can be audited: Google cannot reach pages behind a login or on localhost.
- For more than a few thousand pages a day, add your own free Google API key in `apiKey` (25,000 audits per day per key).

### Use it from the API

Run the Actor and get the results in one call. This endpoint waits up to 5 minutes, so use the Python client below for longer runs:

```bash
curl -X POST "https://api.apify.com/v2/acts/cvillasanti~bulk-pagespeed-core-web-vitals/run-sync-get-dataset-items?token=YOUR_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"urls": ["https://apify.com", "web.dev", "https://www.wikipedia.org/"]}'
```

Or with the Python client (`pip install apify-client`):

```python
from apify_client import ApifyClient

client = ApifyClient("YOUR_API_TOKEN")
run = client.actor("cvillasanti/bulk-pagespeed-core-web-vitals").call(run_input={
    "urls": [
        "https://apify.com",
        "web.dev",
        "https://www.wikipedia.org/"
    ]
})
for item in client.dataset(run["default_dataset_id"]).iterate_items():
    print(item)
```

It also works from Make, Zapier, n8n, Google Sheets and any AI agent through the [Apify MCP server](https://mcp.apify.com).

### FAQ

**Is this the official Google data?** Yes. Scores and metrics come from the official PageSpeed Insights API, the same engine as pagespeed.web.dev.

**Why do some pages have no real-user data?** The Chrome UX Report only covers pages and sites with enough Chrome traffic. Lab metrics are always available.

**Can I use it from an AI agent?** Yes. Call it through the Apify MCP server or the API. The input and output schemas are fully described.

# Actor input Schema

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

Pages to audit. https:// is added when missing and duplicates are removed. Up to 10,000 per run.

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

Optional sitemap.xml URLs (sitemap indexes and .xml.gz included). Their pages are added to the list.

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

How many pages to take from each sitemap.

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

Run Lighthouse as mobile, desktop or both. Both are included in the same record and price.

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

Which scores to compute.

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

Leave empty to use the Actor's key. Add your own free PageSpeed Insights API key for very large daily volumes.

## Actor input object example

```json
{
  "urls": [
    "https://apify.com",
    "web.dev",
    "https://www.wikipedia.org/"
  ],
  "maxUrlsPerSitemap": 100,
  "strategies": [
    "mobile",
    "desktop"
  ],
  "categories": [
    "performance",
    "accessibility",
    "best-practices",
    "seo"
  ]
}
```

# Actor output Schema

## `pages` (type: `string`):

Scores, lab metrics, Core Web Vitals and opportunities per page.

# 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",
        "web.dev",
        "https://www.wikipedia.org/"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("cvillasanti/bulk-pagespeed-core-web-vitals").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",
        "web.dev",
        "https://www.wikipedia.org/",
    ] }

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

```

## MCP server setup

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

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/i6VQg9hoN9xKMXymb/builds/cbSWyWoo7bgsjNvfz/openapi.json
