# Website Performance Analyzer — Speed Test & Core Web Vitals (`scrapeworks/website-performance-analyzer`) Actor

Test website speed for any list of URLs: TTFB, load time, page weight, compression, redirects, caching and security headers — with a transparent 0-100 score and findings. Optionally adds the Google Lighthouse score and Core Web Vitals (FCP, LCP, CLS, TBT) via PageSpeed Insights.

- **URL**: https://apify.com/scrapeworks/website-performance-analyzer.md
- **Developed by:** [Nicolas van Arkens](https://apify.com/scrapeworks) (community)
- **Categories:** SEO tools, Developer tools, Marketing
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, NaN bookmarks
- **User rating**: No ratings yet

## Pricing

from $5.00 / 1,000 analyzed urls

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/platform/actors/running/actors-in-store#pay-per-event

## What's an Apify Actor?

Actors are a software tools running on the Apify platform, for all kinds of web data extraction and automation use cases.
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.
Actors are written with capital "A".

## 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.
The best way to integrate Actors is as follows.

In JavaScript/TypeScript projects, use official [JavaScript/TypeScript client](https://docs.apify.com/api/client/js.md):

```bash
npm install apify-client
```

In Python projects, use official [Python client library](https://docs.apify.com/api/client/python.md):

```bash
pip install apify-client
```

In shell scripts, use [Apify CLI](https://docs.apify.com/cli/docs.md):

````bash
# MacOS / Linux
curl -fsSL https://apify.com/install-cli.sh | bash
# Windows
irm https://apify.com/install-cli.ps1 | iex
```bash

In AI frameworks, you might use the [Apify MCP server](https://docs.apify.com/platform/integrations/mcp.md).

If your project is in a different language, use the [REST API](https://docs.apify.com/api/v2.md).

For usage examples, see the [API](#api) section below.

For more details, see Apify documentation as [Markdown index](https://docs.apify.com/llms.txt) and [Markdown full-text](https://docs.apify.com/llms-full.txt).


# README

## Website Performance Analyzer — Speed Test & Core Web Vitals

Test the performance of any list of websites in one run. For every URL this actor measures **real server response time (TTFB), full load time, page weight, compression, HTTP version, redirects, resource counts, caching and security headers** — and turns them into a transparent **0–100 performance score with a graded A–F rating and the exact reason for every lost point**.

Optionally, each URL is also run through the **official Google PageSpeed Insights API**, adding the **Lighthouse performance score**, lab metrics (**FCP, LCP, CLS, TBT, Speed Index**) and **real-user Core Web Vitals field data** from the Chrome UX Report.

Perfect for agencies auditing client sites, SEO monitoring, competitor benchmarking, and bulk performance checks across hundreds of URLs — no browser, no setup, results as a clean dataset you can export to JSON, CSV, or Excel.

### What data you get

| Field | Description |
|---|---|
| `url` / `finalUrl` | The URL you asked for and where it ended up after redirects |
| `performanceScore` | Transparent 0–100 score from direct measurements |
| `grade` | A–F rating (A ≥ 90, B ≥ 80, C ≥ 70, D ≥ 55, F below) |
| `findings` | Human-readable list of every issue that cost points |
| `ttfbMs` | Time to first byte — real server response time in ms |
| `totalTimeMs` | Time to download the full document in ms |
| `htmlBytes` | Document size (decoded) |
| `httpVersion` | HTTP/1.1, HTTP/2 … (HTTP/1.1 is flagged) |
| `redirects` | Number of redirect hops before the final URL |
| `contentEncoding` | Compression in use (gzip / br) — missing compression is flagged |
| `resources` | Counts of scripts, external scripts, stylesheets, images, iframes, approximate DOM size, viewport meta presence |
| `caching` | Cache-Control, ETag, Last-Modified, Expires headers |
| `securityHeaders` | Presence of HSTS, CSP, X-Content-Type-Options, X-Frame-Options, Referrer-Policy, Permissions-Policy |
| `server` | Server header (e.g. cloudflare, nginx) |
| `pagespeed` | Optional Google Lighthouse score, lab metrics (FCP/LCP/CLS/TBT/Speed Index) and Core Web Vitals field data |

### Input

```json
{
    "urls": ["https://example.com", "https://www.wikipedia.org"],
    "strategy": "mobile",
    "runPagespeed": true
}
````

- **urls** — one URL per line; bare domains work too (`https://` is added).
- **strategy** — `mobile` or `desktop`, used for the Lighthouse run.
- **runPagespeed** — set `false` to skip Google and rely on direct measurements only (faster).
- **googleApiKey** — optional, free ([get one here](https://developers.google.com/speed/docs/insights/v5/get-started), 25,000 requests/day). Without a key the Lighthouse part uses Google's shared anonymous quota, which is often busy — the direct measurements always work regardless.

### Output sample (real run)

```json
{
  "url": "https://example.com",
  "finalUrl": "https://example.com",
  "success": true,
  "statusCode": 200,
  "performanceScore": 98,
  "grade": "A",
  "findings": [
    "Missing Strict-Transport-Security header"
  ],
  "ttfbMs": 181,
  "totalTimeMs": 181,
  "htmlBytes": 559,
  "httpVersion": "HTTP/2",
  "redirects": 0,
  "contentType": "text/html",
  "contentEncoding": "br",
  "resources": {
    "scripts": 0,
    "externalScripts": 0,
    "stylesheets": 0,
    "images": 0,
    "iframes": 0,
    "domNodesApprox": 12,
    "hasViewportMeta": true
  },
  "caching": {
    "cacheControl": null,
    "etag": null,
    "lastModified": "Tue, 09 Jun 2026 21:01:00 GMT",
    "expires": null
  },
  "securityHeaders": {
    "strict-transport-security": false,
    "content-security-policy": false,
    "x-content-type-options": false,
    "x-frame-options": false,
    "referrer-policy": false,
    "permissions-policy": false
  },
  "server": "cloudflare"
}
```

A slow page looks like this instead (`nytimes.com`, mobile): score **69 (D)** with findings such as *"33 external scripts referenced (target < 15)"*, *"Very large DOM (~4100 nodes)"*, and *"One redirect before the final URL"*.

### Use cases

- **Agency site audits** — run a client's whole sitemap through it and hand over a prioritized findings list per page.
- **Competitor benchmarking** — score your site against competitors on identical, objective measurements.
- **Continuous monitoring** — schedule it on Apify and diff scores week over week; integrate with Make/Zapier/webhooks.
- **Pre-launch checks** — catch missing compression, redirect chains, HTTP/1.1, missing caching or security headers before going live.

### FAQ

**How is the 0–100 score computed?** It starts at 100 and deducts points for measurable issues (slow TTFB, missing compression, heavy HTML, HTTP/1.1, redirect chains, excessive scripts/images/DOM size, missing viewport/caching/HSTS). Every deduction appears in `findings`, so the score is fully explainable — no black box.

**Is this the same as Lighthouse?** The direct score is its own measurement of server- and document-level performance. If you enable `runPagespeed`, you also get the official Google Lighthouse score and Core Web Vitals alongside it.

**Do I need a Google API key?** No — but Lighthouse enrichment is much more reliable with one (it's free). Without a key, the actor shares Google's anonymous quota with everyone else; when that quota is busy you still get all direct measurements.

**Does it render JavaScript?** No — that's why it's fast and cheap. Rendering metrics (LCP, CLS, TBT) come from the optional Lighthouse integration instead.

**What happens with unreachable URLs?** They produce an error row (`success: false`) with the reason, and you are **not charged** for them — you pay only for successful results.

**How is it priced?** Pay per event: a small fee per successfully analyzed URL. Failed URLs are free.

# Actor input Schema

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

One website URL per line (e.g. https://example.com). The scheme is optional — bare domains get https:// added automatically. Each URL produces one result row.

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

Which device profile Google PageSpeed Insights should simulate for the Lighthouse score and lab metrics. Has no effect on the direct measurements.

## `runPagespeed` (type: `boolean`):

If enabled, each URL is also run through the official Google PageSpeed Insights API to get the Lighthouse performance score, lab metrics (FCP, LCP, CLS, TBT, Speed Index) and real-user Core Web Vitals field data. Works without a key on Google's small shared quota; for reliable high-volume runs supply a free Google API key below. If the quota is exhausted the actor still returns all direct measurements.

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

Optional API key for the PageSpeed Insights API — get one free at https://developers.google.com/speed/docs/insights/v5/get-started (25,000 requests/day). Without a key, Lighthouse enrichment uses Google's shared anonymous quota, which is often exhausted; direct measurements are unaffected either way.

## Actor input object example

```json
{
  "urls": [
    "https://example.com",
    "https://www.wikipedia.org"
  ],
  "strategy": "mobile",
  "runPagespeed": true
}
```

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

// Run the Actor and wait for it to finish
const run = await client.actor("scrapeworks/website-performance-analyzer").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://example.com",
        "https://www.wikipedia.org",
    ] }

# Run the Actor and wait for it to finish
run = client.actor("scrapeworks/website-performance-analyzer").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print("💾 Check your data here: https://console.apify.com/storage/datasets/" + run["defaultDatasetId"])
for item in client.dataset(run["defaultDatasetId"]).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://example.com",
    "https://www.wikipedia.org"
  ]
}' |
apify call scrapeworks/website-performance-analyzer --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "command": "npx",
            "args": [
                "mcp-remote",
                "https://mcp.apify.com/?tools=scrapeworks/website-performance-analyzer",
                "--header",
                "Authorization: Bearer <YOUR_API_TOKEN>"
            ]
        }
    }
}

```

## OpenAPI specification

```json
{
    "openapi": "3.0.1",
    "info": {
        "title": "Website Performance Analyzer — Speed Test & Core Web Vitals",
        "description": "Test website speed for any list of URLs: TTFB, load time, page weight, compression, redirects, caching and security headers — with a transparent 0-100 score and findings. Optionally adds the Google Lighthouse score and Core Web Vitals (FCP, LCP, CLS, TBT) via PageSpeed Insights.",
        "version": "0.1",
        "x-build-id": "0MGAibqvKFjcB3RSw"
    },
    "servers": [
        {
            "url": "https://api.apify.com/v2"
        }
    ],
    "paths": {
        "/acts/scrapeworks~website-performance-analyzer/run-sync-get-dataset-items": {
            "post": {
                "operationId": "run-sync-get-dataset-items-scrapeworks-website-performance-analyzer",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor, waits for its completion, and returns Actor's dataset items in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK"
                    }
                }
            }
        },
        "/acts/scrapeworks~website-performance-analyzer/runs": {
            "post": {
                "operationId": "runs-sync-scrapeworks-website-performance-analyzer",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor and returns information about the initiated run in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/runsResponseSchema"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/acts/scrapeworks~website-performance-analyzer/run-sync": {
            "post": {
                "operationId": "run-sync-scrapeworks-website-performance-analyzer",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor, waits for completion, and returns the OUTPUT from Key-value store in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK"
                    }
                }
            }
        }
    },
    "components": {
        "schemas": {
            "inputSchema": {
                "type": "object",
                "required": [
                    "urls"
                ],
                "properties": {
                    "urls": {
                        "title": "URLs to analyze",
                        "type": "array",
                        "description": "One website URL per line (e.g. https://example.com). The scheme is optional — bare domains get https:// added automatically. Each URL produces one result row.",
                        "items": {
                            "type": "string"
                        }
                    },
                    "strategy": {
                        "title": "Device strategy (for Lighthouse)",
                        "enum": [
                            "mobile",
                            "desktop"
                        ],
                        "type": "string",
                        "description": "Which device profile Google PageSpeed Insights should simulate for the Lighthouse score and lab metrics. Has no effect on the direct measurements.",
                        "default": "mobile"
                    },
                    "runPagespeed": {
                        "title": "Add Google Lighthouse score & Core Web Vitals",
                        "type": "boolean",
                        "description": "If enabled, each URL is also run through the official Google PageSpeed Insights API to get the Lighthouse performance score, lab metrics (FCP, LCP, CLS, TBT, Speed Index) and real-user Core Web Vitals field data. Works without a key on Google's small shared quota; for reliable high-volume runs supply a free Google API key below. If the quota is exhausted the actor still returns all direct measurements.",
                        "default": true
                    },
                    "googleApiKey": {
                        "title": "Google API key (optional, free)",
                        "type": "string",
                        "description": "Optional API key for the PageSpeed Insights API — get one free at https://developers.google.com/speed/docs/insights/v5/get-started (25,000 requests/day). Without a key, Lighthouse enrichment uses Google's shared anonymous quota, which is often exhausted; direct measurements are unaffected either way."
                    }
                }
            },
            "runsResponseSchema": {
                "type": "object",
                "properties": {
                    "data": {
                        "type": "object",
                        "properties": {
                            "id": {
                                "type": "string"
                            },
                            "actId": {
                                "type": "string"
                            },
                            "userId": {
                                "type": "string"
                            },
                            "startedAt": {
                                "type": "string",
                                "format": "date-time",
                                "example": "2025-01-08T00:00:00.000Z"
                            },
                            "finishedAt": {
                                "type": "string",
                                "format": "date-time",
                                "example": "2025-01-08T00:00:00.000Z"
                            },
                            "status": {
                                "type": "string",
                                "example": "READY"
                            },
                            "meta": {
                                "type": "object",
                                "properties": {
                                    "origin": {
                                        "type": "string",
                                        "example": "API"
                                    },
                                    "userAgent": {
                                        "type": "string"
                                    }
                                }
                            },
                            "stats": {
                                "type": "object",
                                "properties": {
                                    "inputBodyLen": {
                                        "type": "integer",
                                        "example": 2000
                                    },
                                    "rebootCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "restartCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "resurrectCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "computeUnits": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            },
                            "options": {
                                "type": "object",
                                "properties": {
                                    "build": {
                                        "type": "string",
                                        "example": "latest"
                                    },
                                    "timeoutSecs": {
                                        "type": "integer",
                                        "example": 300
                                    },
                                    "memoryMbytes": {
                                        "type": "integer",
                                        "example": 1024
                                    },
                                    "diskMbytes": {
                                        "type": "integer",
                                        "example": 2048
                                    }
                                }
                            },
                            "buildId": {
                                "type": "string"
                            },
                            "defaultKeyValueStoreId": {
                                "type": "string"
                            },
                            "defaultDatasetId": {
                                "type": "string"
                            },
                            "defaultRequestQueueId": {
                                "type": "string"
                            },
                            "buildNumber": {
                                "type": "string",
                                "example": "1.0.0"
                            },
                            "containerUrl": {
                                "type": "string"
                            },
                            "usage": {
                                "type": "object",
                                "properties": {
                                    "ACTOR_COMPUTE_UNITS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_WRITES": {
                                        "type": "integer",
                                        "example": 1
                                    },
                                    "KEY_VALUE_STORE_LISTS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_INTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_EXTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_SERPS": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            },
                            "usageTotalUsd": {
                                "type": "number",
                                "example": 0.00005
                            },
                            "usageUsd": {
                                "type": "object",
                                "properties": {
                                    "ACTOR_COMPUTE_UNITS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_WRITES": {
                                        "type": "number",
                                        "example": 0.00005
                                    },
                                    "KEY_VALUE_STORE_LISTS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_INTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_EXTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_SERPS": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}
```
