# Bulk PageSpeed Insights & Core Web Vitals Audit (`gunpark/bulk-pagespeed-audit`) Actor

Audit hundreds of pages with Google PageSpeed Insights (Lighthouse): Performance, Accessibility, Best Practices and SEO scores, lab metrics, real-user Core Web Vitals (CrUX) and top fixes. URLs or a whole sitemap, mobile and desktop, one flat row per page.

- **URL**: https://apify.com/gunpark/bulk-pagespeed-audit.md
- **Developed by:** [Alejandro Rodriguez](https://apify.com/gunpark) (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 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.
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

## Bulk PageSpeed Insights & Core Web Vitals Audit

Run **Google PageSpeed Insights (Lighthouse)** on hundreds of pages in one go and get **one flat, spreadsheet-ready row per page and device**: Performance, Accessibility, Best Practices and SEO scores, lab metrics (LCP, CLS, TBT, Speed Index…), **real-user Core Web Vitals from the Chrome UX Report** (page and origin level), a Core Web Vitals assessment flag (true/false, or null when Google has too little real-user data), and the top fixes ranked by time saved.

Paste a list of URLs or just a **sitemap URL** — the Actor finds the pages for you. Mobile, desktop or both.

### Why use it

- **SEO & technical audits at scale** – audit a whole site (or all competitors' home pages) instead of pasting URLs one by one into pagespeed.web.dev.
- **Core Web Vitals monitoring** – schedule it weekly and track LCP, INP and CLS regressions over time.
- **Agency reporting** – export to Excel/Google Sheets/CSV for client reports; every metric is its own column.
- **Lead generation for web agencies** – find prospects whose sites fail Core Web Vitals.
- **AI agents** – call it from the Apify MCP server or API and let your agent explain the results.

### Input

| Field | Description |
|---|---|
| `urls` | Pages to audit (`example.com` works too). |
| `sitemapUrl` | Optional XML sitemap or sitemap index; pages are added up to `maxUrls`. |
| `maxUrls` | Max pages per run (default 50). |
| `strategies` | `mobile`, `desktop` or both (each is a separate audit). |
| `categories` | `performance`, `accessibility`, `best-practices`, `seo`. |
| `locale` | Language of audit titles (`en`, `es`, `de`, `pt-BR`…). |
| `googleApiKey` | Optional: your own PageSpeed Insights API key. If empty, the Actor's own key is used. |
| `maxConcurrency` | Parallel audits (default 4). |

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

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

```json
{
  "url": "https://example.com/",
  "strategy": "mobile",
  "performanceScore": 91,
  "accessibilityScore": 98,
  "bestPracticesScore": 100,
  "seoScore": 100,
  "passesCoreWebVitals": true,
  "lab": { "fcpMs": 900, "lcpMs": 1800, "tbtMs": 50, "cls": 0.012, "speedIndexMs": 1500, "serverResponseMs": 120 },
  "fieldData": { "overall": "FAST", "lcpMs": 2100, "inpMs": 150, "cls": 0.05 },
  "originFieldData": { "overall": "AVERAGE", "lcpMs": 2600, "inpMs": 210, "cls": 0.08 },
  "topOpportunities": [{ "id": "render-blocking-resources", "title": "Eliminate render-blocking resources", "savingsMs": 900 }]
}
```

`fieldData` is empty when Google has no real-user data for that page (low traffic) – `originFieldData` often still has data for the whole site.

### Pricing

Pay per successful audit (see the pricing tab). Failed audits (unreachable page, invalid URL) are saved with an `error` message and **not charged**. Use "Max total charge" to cap any run.

### Notes & limits

- Results come from Google's official PageSpeed Insights API, the same engine as pagespeed.web.dev; scores can vary a few points between runs, like in Google's own tool.
- Each audit takes ~10–40 s on Google's side; parallel audits keep large jobs fast.
- Only publicly reachable pages can be audited.

### Support

Open an issue on the Issues tab for bugs or feature requests. The Actor is health-checked automatically every day.

### More tools from the same author

- [PDF to Markdown & Text Extractor](https://apify.com/gunpark/pdf-to-markdown-extractor) – PDF URLs → Markdown/text/tables for RAG, flat $0.003 per PDF.
- [Bulk Image OCR](https://apify.com/gunpark/bulk-image-ocr) – image URLs → text (English & Spanish), $0.003 per image with text.
- [Bulk Image Converter & Compressor](https://apify.com/gunpark/image-converter-compressor) – PNG/JPEG → WebP/AVIF, resize, strip metadata.
- [Dataset Transformer](https://apify.com/gunpark/dataset-transformer) – filter, dedupe, sort any Apify dataset/JSON/CSV and export CSV/JSONL.

# Actor input Schema

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

Pages to audit, e.g. https://example.com/ (protocol optional).

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

Audit pages listed in an XML sitemap or sitemap index, up to 'Max URLs'.

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

Upper limit of pages audited in one run (each page is audited once per selected strategy).

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

Audit as mobile, desktop or both. Each strategy is a separate audit.

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

Which Lighthouse category scores to compute.

## `locale` (type: `string`):

Locale for audit titles, e.g. en, es, de, pt-BR.

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

Optional. Use your own PageSpeed Insights API key for very large jobs. Leave empty to use the Actor's built-in key.

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

How many pages are audited at the same time.

## Actor input object example

```json
{
  "urls": [
    "https://apify.com/"
  ],
  "maxUrls": 50,
  "strategies": [
    "mobile"
  ],
  "categories": [
    "performance",
    "accessibility",
    "best-practices",
    "seo"
  ],
  "locale": "en",
  "maxConcurrency": 4
}
```

# Actor output Schema

## `results` (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/"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("gunpark/bulk-pagespeed-audit").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/"] }

# Run the Actor and wait for it to finish
run = client.actor("gunpark/bulk-pagespeed-audit").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/"
  ]
}' |
apify call gunpark/bulk-pagespeed-audit --silent --output-dataset

```

## MCP server setup

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

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/hb36f9rTibA6c0roD/builds/XAAqnv08Wuw9DTEQT/openapi.json
