# Bulk Core Web Vitals Auditor - Sitemap, CrUX & URL Groups (`beryline_pastel/bulk-core-web-vitals-auditor`) Actor

Audit hundreds of pages with Google PageSpeed Insights. Paste URLs or a sitemap; get Lighthouse scores, real-user Core Web Vitals (LCP, INP, CLS), pass/fail, top fixes, and a Search Console-style report per URL group.

- **URL**: https://apify.com/beryline_pastel/bulk-core-web-vitals-auditor.md
- **Developed by:** [Beryline Pastel](https://apify.com/beryline_pastel) (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.00 / 1,000 page auditeds

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/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 Core Web Vitals Auditor - Sitemap, CrUX & URL Groups

Audit **hundreds of pages with Google PageSpeed Insights in one run**. Paste a list of URLs, a **sitemap.xml**, or just a domain — get Lighthouse performance scores, **real-user Core Web Vitals (LCP, INP, CLS from the Chrome UX Report)**, a clear **pass/fail**, and the **top fixes for every page**, ready to export to CSV, Excel, JSON or Google Sheets.

### Why use it

- **Whole-site audits from a sitemap** — give a `sitemap.xml` (or sitemap index) or tick *Auto-discover sitemap* and every page gets audited. No copy-pasting URLs.
- **Real-user data, not just lab scores** — Google ranks on field data. Each row includes CrUX p75 LCP, INP and CLS for the page *and* the whole origin, plus lab metrics (FCP, LCP, TBT, CLS, Speed Index).
- **Pass/fail you can act on** — `cwvPassed` and `cwvFailing` (e.g. `["LCP","INP"]`) using Google's "good" thresholds (LCP ≤ 2.5 s, INP ≤ 200 ms, CLS ≤ 0.1). Falls back to lab data when a page has no field data.
- **Top fixes per page** — the biggest Lighthouse opportunities sorted by estimated savings (ms / KB), e.g. *Eliminate render-blocking resources — 910 ms*.
- **URL-group report (like Search Console) — audit big sites for a fraction of the cost.** Set *Sample pages per URL group* (e.g. 3): URLs are grouped by pattern (`/products/*`, `/blog/*/*`…), only a few pages per group are audited, and `TEMPLATE_REPORT` gives each group's CWV pass rate, median score, median real-user LCP/INP/CLS, most common failing metric, most common fixes and worst page. A 10,000-URL store with 8 templates costs ~24 audits instead of 10,000.
- **Mobile and desktop** in the same run.
- **You only pay for successful audits.** Pages that fail to load are reported with the error and are not charged.
- **No API key needed.** (Bring your own free Google key for very large runs if you want.)

### Use cases

- SEO agencies: monthly Core Web Vitals report for every client page.
- E-commerce: find which product/category templates fail CWV.
- Developers: before/after checks for a deploy; schedule the actor and track regressions.
- Lead generation for web agencies: audit prospects' sites and show concrete issues.

### Input

| Field | Description |
|---|---|
| `urls` | List of page URLs or domains |
| `sitemapUrl` | Optional sitemap or sitemap index |
| `crawlSitemapForDomain` | Read robots.txt / sitemap.xml of each domain and audit found pages |
| `maxPages` | Max unique pages per run (default 50) |
| `samplesPerTemplate` | Audit only N pages per URL group and build the group report (0 = audit all) |
| `maxSitemapUrls` | URLs read from sitemaps before sampling (default 5000) |
| `strategies` | `mobile`, `desktop` or both |
| `maxOpportunities` | Fixes per page (default 5) |
| `onlyFailing` | Output only pages that fail Core Web Vitals |

```json
{ "sitemapUrl": "https://example.com/sitemap.xml", "maxPages": 200, "strategies": ["mobile", "desktop"] }
```

### Output (one row per page × device)

```json
{
  "url": "https://shop.example/",
  "strategy": "mobile",
  "status": "ok",
  "performanceScore": 47,
  "cwvPassed": false,
  "cwvSource": "field",
  "cwvFailing": ["LCP"],
  "field": { "overall": "SLOW", "lcpMs": 3400, "inpMs": 180, "cls": 0.05, "fcpMs": 1900, "ttfbMs": 900 },
  "originField": { "overall": "AVERAGE", "lcpMs": 2600, "cls": 0.08 },
  "lab": { "fcpMs": 2100, "lcpMs": 5301, "tbtMs": 640, "cls": 0.012, "speedIndexMs": 4200 },
  "topOpportunities": [
    { "id": "render-blocking-resources", "title": "Eliminate render-blocking resources", "savingsMs": 910 },
    { "id": "unused-javascript", "title": "Reduce unused JavaScript", "savingsMs": 600, "savingsKb": 420 }
  ],
  "pageSpeedUrl": "https://pagespeed.web.dev/analysis?url=...&form_factor=mobile"
}
```

A run summary (`audited`, `failed`) is saved to the key-value store as `SUMMARY`, and the per-group report as `TEMPLATE_REPORT`:

```json
{ "template": "shop.example/products/*", "strategy": "mobile", "pagesInGroup": 4120, "pagesAudited": 3,
  "cwvPassRate": 33, "medianScore": 41, "medianFieldLcpMs": 3100, "medianFieldInpMs": 240,
  "mostCommonFailing": [{ "id": "LCP", "count": 2 }], "mostCommonFixes": [{ "id": "unused-javascript", "count": 3 }],
  "worstUrl": "https://shop.example/products/red-dress" }
```

### Pricing

Pay per event: **$0.003 per successful audit** (one page on one device). 1,000 mobile audits = $3. Failed pages are free. Set *Max cost per run* in the run options to cap spending — the actor stops cleanly when the limit is reached.

### FAQ

**Why do some pages have `field: null`?** The Chrome UX Report only has data for pages with enough real Chrome traffic. Then `cwvSource` is `lab` and pass/fail uses lab LCP, CLS and TBT (as an INP proxy).

**Is this the same data as pagespeed.web.dev?** Yes — it calls the official PageSpeed Insights API v5. Every row links to the full report.

**How are URL groups built?** Host + first path segment, deeper levels collapsed (`/blog/2024/05/post` → `/blog/*/*/*`). Numeric first segments become `:id`. Samples are spread evenly across each group.

**Why are scores slightly different between runs?** Lab tests vary a few points run to run; field data is a 28-day rolling average and is stable.

Data comes from Google's public PageSpeed Insights API. This actor does not log in to or scrape any website; it only fetches public sitemaps/robots.txt you point it to.

### Use with AI agents (MCP)

This Actor works as a tool for Claude, ChatGPT, Cursor and other MCP clients through the Apify MCP server:

```
https://mcp.apify.com?tools=beryline_pastel/bulk-core-web-vitals-auditor
```

Example prompt: *"Audit Core Web Vitals for every URL in https://example.com/sitemap.xml and list the slowest page templates."*

### Related tools by the same author

- [Bulk Domain Checker (expiry, WHOIS, DNS, SSL)](https://apify.com/beryline_pastel/bulk-domain-checker)
- [Bulk Phone Number Validator (E.164)](https://apify.com/beryline_pastel/bulk-phone-number-validator)
- [Broken Link & Redirect Checker](https://apify.com/beryline_pastel/broken-link-redirect-checker)
- [Bulk PDF Text Extractor](https://apify.com/beryline_pastel/bulk-pdf-text-extractor)
- [Bulk Email Validator (MX, disposable, typos)](https://apify.com/beryline_pastel/bulk-email-validator-mx-disposable)

# Actor input Schema

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

Pages to audit. Bare domains are fine (https:// is added).

## `sitemapUrl` (type: `string`):

A sitemap.xml or sitemap index. All page URLs in it are audited (up to Max pages).

## `crawlSitemapForDomain` (type: `boolean`):

Reads robots.txt (or /sitemap.xml) of each URL's domain and audits the pages found.

## `maxPages` (type: `integer`):

Upper limit of unique pages per run (each page × device = 1 audit).

## `samplesPerTemplate` (type: `integer`):

Big site? URLs are grouped like Search Console (e.g. /products/*, /blog/*). Audit only N pages per group and get a per-group report (TEMPLATE_REPORT) — a fraction of the cost of auditing every page.

## `maxSitemapUrls` (type: `integer`):

How many sitemap URLs to read before grouping and sampling.

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

mobile and/or desktop. Each device is a separate audit.

## `maxOpportunities` (type: `integer`):

How many improvement opportunities (sorted by estimated savings) to include.

## `onlyFailing` (type: `boolean`):

Skip pages that pass Core Web Vitals in the output (they are still audited and counted in the URL-group report).

## `concurrency` (type: `integer`):

How many audits run in parallel. 4 is a good default; Google may rate-limit above 8.

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

Optional. Use your own free PageSpeed Insights key for very large runs.

## Actor input object example

```json
{
  "urls": [
    "https://apify.com",
    "https://web.dev"
  ],
  "crawlSitemapForDomain": false,
  "maxPages": 50,
  "samplesPerTemplate": 0,
  "maxSitemapUrls": 5000,
  "strategies": [
    "mobile"
  ],
  "maxOpportunities": 5,
  "onlyFailing": false,
  "concurrency": 4
}
```

# Actor output Schema

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

No description

## `templateReport` (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://web.dev"
    ]
};

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

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

```

## MCP server setup

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

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/y538dIm7m4MrXHip9/builds/hMKr7N0t9gKPJD87h/openapi.json
