# Website Performance Analyzer — Lighthouse & Core Web Vitals (`junipr/website-performance-analyzer`) Actor

Audit website performance, SEO, accessibility, and best practices with Lighthouse-style scores, page weight, diagnostics, and report exports.

- **URL**: https://apify.com/junipr/website-performance-analyzer.md
- **Developed by:** [junipr](https://apify.com/junipr) (community)
- **Categories:** SEO tools, Developer tools
- **Features:** Limited permissions
- **Stats:** 3 total users, 0 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $15.00 / 1,000 url analyzeds

This Actor is paid per event and usage. You are charged both the fixed price for specific events and for Apify platform usage.

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

## Website Performance Analyzer — Lighthouse & Core Web Vitals

Audit website performance, SEO, accessibility, and best practices with Lighthouse-style scores, page weight, diagnostics, and report exports. Unlike tools that dump raw Lighthouse JSON, this actor produces structured reports with pass/fail ratings and actionable recommendations sorted by impact.

### What It Measures

#### Core Web Vitals (with pass/fail ratings)

- **LCP** (Largest Contentful Paint) — how fast the main content loads. Good: < 2.5s
- **FCP** (First Contentful Paint) — when the first pixel of content appears. Good: < 1.8s
- **CLS** (Cumulative Layout Shift) — how much the layout shifts during load. Good: < 0.1
- **TTFB** (Time to First Byte) — server response speed. Good: < 800ms

Each metric receives one of three ratings: **good**, **needs-improvement**, or **poor** — matching Google's CWV thresholds.

#### Page Stats

Total transfer size (with human-readable formatting), resource count, per-type breakdown (scripts, stylesheets, images, fonts, etc.), and a count of render-blocking resources that delay page rendering.

#### SEO Basics

Title tag (presence + length 10–70 chars), meta description (presence + length 50–160 chars), viewport meta tag, canonical URL, and H1 heading (presence + count).

#### Accessibility Basics

Images without alt text, links without descriptive text or aria-label, form inputs without associated labels, and a heuristic contrast check across visible text elements.

#### Performance Scores

Each URL receives three scores (0–100): **Performance**, **SEO**, and **Accessibility** — calculated directly from the measured metrics using the same thresholds as industry-standard auditors.

### Prioritized Recommendations

Every result includes a ranked list of fixes sorted **high → medium → low** priority. Each recommendation includes:

- Category (performance, seo, or accessibility)
- A plain-English title
- A description explaining what to fix and why, with specific values from the page

Examples: "LCP is 4,200ms — add `<link rel=preload>` for your hero image", "3 images missing alt text — add descriptive alt attributes", "No meta description found — add 50–160 character description".

### Input Options

| Field | Default | Description |
|---|---|---|
| `urls` | `[{"url": "https://crawlee.dev"}]` | URLs to analyze. Each entry: `{ "url": "...", "label": "..." }` |
| `device` | `mobile` | Viewport mode: `mobile` (375×812) or `desktop` (1280×800) |
| `requestTimeout` | `45000` | Page load timeout in milliseconds (10,000–90,000) |

All fields have defaults — the actor runs zero-config.

### Output Format

Each URL produces one dataset record with:

- `coreWebVitals` — LCP, FCP, CLS, TTFB with values, ratings, and units
- `pageStats` — total requests, transfer size, resource breakdown by type
- `seo` — title, meta description, viewport, canonical, H1 checks
- `accessibility` — image alt, link text, input label, contrast issue counts
- `scores` — performance (0–100), seo (0–100), accessibility (0–100)
- `recommendations` — prioritized fix list with title + description
- `analyzedAt` — ISO 8601 timestamp

### Competitive Advantage

Most performance tools produce raw JSON that requires interpretation. This actor produces **decision-ready output**: every result tells you what's wrong and what to do about it, ranked by impact. Useful for developers auditing their own sites, agencies producing reports for clients, and SEO/performance monitoring workflows.

### Pricing

This actor charges per URL analyzed via Apify's Pay Per Event billing with the `url-analyzed` event at **$15.00 per 1,000 URLs analyzed** in the queued monetization update. Platform usage pass-through is queued because real-browser performance audits consume CPU, memory, network, and timing resources. You only pay for URLs that complete analysis — failed navigations are not charged.

***

#### FAQ

**Can I analyze multiple URLs in one run?**
Yes — pass multiple URLs in the `urls` array. They are processed sequentially so each browser audit has isolated CPU and debug-port resources.

**How is the performance score calculated?**
LCP (40%), FCP (25%), CLS (25%), TTFB (10%) — each metric earns 100 points for "good", 60 for "needs-improvement", 20 for "poor". Scores are weighted and summed.

**Does this run real Lighthouse?**
No — it uses Playwright's browser Performance APIs (Navigation Timing, Paint Timing, PerformanceObserver) which capture the same underlying metrics. Results are comparable to Lighthouse field data.

**What devices are supported?**
Mobile (iPhone-style, 375×812, 2× DPR) and Desktop (1280×800, 1× DPR). Mobile is the default since Google uses mobile-first indexing.

**Can I analyze pages behind a login?**
Not directly in the current version. Authentication flows require additional configuration.

**How accurate is the contrast check?**
The contrast check is heuristic — it samples up to 100 text elements and calculates WCAG contrast ratios from computed styles. It may miss some issues and flag some false positives on elements with complex backgrounds. Use a dedicated accessibility scanner for comprehensive WCAG auditing.

# Actor input Schema

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

URLs to audit. Each entry: { "url": "https://...", "label": "optional-name" }.

## `device` (type: `string`):

Lighthouse emulation mode. Mobile uses throttled 4x CPU slowdown and 3G-like network; Desktop uses unthrottled settings.

## `requestTimeout` (type: `integer`):

Maximum time Lighthouse will wait for a page to load before collecting metrics.

## Actor input object example

```json
{
  "urls": [
    {
      "url": "https://crawlee.dev",
      "label": "crawlee"
    }
  ],
  "device": "mobile",
  "requestTimeout": 45000
}
```

# Actor output Schema

## `results` (type: `string`):

Per-URL Lighthouse audit results including all 5 category scores, CWV ratings, and actionable recommendations.

# 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 = {};

// Run the Actor and wait for it to finish
const run = await client.actor("junipr/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 = {}

# Run the Actor and wait for it to finish
run = client.actor("junipr/website-performance-analyzer").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 '{}' |
apify call junipr/website-performance-analyzer --silent --output-dataset

```

## MCP server setup

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

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/chZ24ka0CYTaqNals/builds/ohphwmYSD9RTpTfjq/openapi.json
