# Bulk PageSpeed Insights & Lighthouse Scores Checker (`lepidata/pagespeed`) Actor

Get Google PageSpeed and Lighthouse scores plus Core Web Vitals for many URLs at once, mobile and desktop. Flat price per URL, no start fee.

- **URL**: https://apify.com/lepidata/pagespeed.md
- **Developed by:** [Lepi Data](https://apify.com/lepidata) (community)
- **Categories:** SEO tools, Developer tools
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $1.80 / 1,000 pagespeed results

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 & Lighthouse Scores Checker

Get Google PageSpeed and Lighthouse scores plus Core Web Vitals for many URLs at once, mobile and desktop. Flat price per URL, no start fee.

### What you get

For each URL and device (mobile / desktop):

- Lighthouse scores 0–100: **performance, accessibility, best practices, SEO**
- Lab metrics: LCP, FCP, CLS, Total Blocking Time, Speed Index, Time to Interactive
- Real-user **Core Web Vitals** (LCP, INP, CLS, FCP, TTFB) for the page and its origin, when Google has Chrome UX Report data
- Final URL, Lighthouse version and test time

### How it works

- Uses only the **official Google PageSpeed Insights API v5**. Google runs Lighthouse on its own servers; this Actor does not run a browser and does not load your pages itself.
- Checks 5–10 URLs in parallel (default 10). Each check takes Google about 10–60 seconds.
- **Private, local and internal addresses are refused** (localhost, private IP ranges, internal host names, names that resolve to private addresses). They get a free `blocked-address` row and are never sent to Google.

### Pricing

**$1.80 per 1,000 results** ($0.0018 per result; one result = one URL on one device). Same price on every Apify plan, including Free. `strategy: both` gives two results per URL. No start fee.
Errors, blocked addresses, rate limits and limit rows are **free**.

### Limits

- **Free-plan accounts: up to 100 results per run.** Paid plans have no per-run result cap (max 5,000 URLs per run).
- **Shared daily capacity:** all users share one Google quota. When today's shared capacity is used up, the run stops cleanly with a free `service-busy` row; nothing undelivered is charged. Capacity resets at 00:00 UTC.
- **Time limit:** if a run gets close to its timeout, it stops starting new checks, writes a free `time-limit-reached` row with the number of unfinished URLs, and ends successfully. Unfinished URLs are not charged. The default timeout is 1 hour.
- If Google asks us to slow down (HTTP 429) after retries, the run stops with a free `rate-limit` row.

### Input example

```json
{ "urls": ["https://apify.com", "https://example.org"], "strategy": "both", "concurrency": 10 }
```

# Actor input Schema

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

Public http(s) pages to test. Private, local and internal addresses are refused (free row). Up to 5,000 per run.

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

Which Lighthouse strategy to run. "both" returns and bills two results per URL.

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

How many URLs are checked at once (5–10).

## Actor input object example

```json
{
  "urls": [
    "https://apify.com"
  ],
  "strategy": "mobile",
  "concurrency": 10
}
```

# Actor output Schema

## `items` (type: `string`):

All rows from this run.

# 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("lepidata/pagespeed").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("lepidata/pagespeed").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 lepidata/pagespeed --silent --output-dataset

```

## MCP server setup

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

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/WF5Gk4FF4XHIJM46l/builds/zH3PAqTd45zlBBnCw/openapi.json
