# Website Performance Analyzer (`junipr/website-performance-analyzer`) Actor

Audit sites with real Google Lighthouse for Performance, Accessibility, Best Practices, SEO, and PWA. Core Web Vitals (LCP, CLS, TBT, SI). Detailed audit findings per category. Mobile/desktop. Multi-URL.

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

## Pricing

from $13.00 / 1,000 url analyzeds

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

Audit any URL for Core Web Vitals, SEO, accessibility, and page weight — then get a prioritized, human-readable list of exactly what to fix. 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) |
| `waitForNetworkIdle` | `true` | Wait for network activity to settle before collecting metrics |
| `maxConcurrency` | `3` | URLs analyzed in parallel (1–10) |
| `requestTimeout` | `60000` | Page load timeout in milliseconds (10,000–120,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. You only pay for URLs that complete analysis — failed navigations are not charged.

---

#### FAQ

**Can I analyze multiple URLs in one run?**
Yes — pass any number of URLs in the `urls` array. They are processed in parallel up to `maxConcurrency`.

**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.
## `maxConcurrency` (type: `integer`):

Maximum number of URLs analyzed in parallel. Note: Lighthouse runs are resource-intensive, so keep this low.
## `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",
  "maxConcurrency": 3,
  "requestTimeout": 60000
}
````

# 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("💾 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 '{}' |
apify call junipr/website-performance-analyzer --silent --output-dataset

```

## MCP server setup

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

```

## OpenAPI specification

```json
{
    "openapi": "3.0.1",
    "info": {
        "title": "Website Performance Analyzer",
        "description": "Audit sites with real Google Lighthouse for Performance, Accessibility, Best Practices, SEO, and PWA. Core Web Vitals (LCP, CLS, TBT, SI). Detailed audit findings per category. Mobile/desktop. Multi-URL.",
        "version": "1.0",
        "x-build-id": "JuFh8a2hdqoPfy6ke"
    },
    "servers": [
        {
            "url": "https://api.apify.com/v2"
        }
    ],
    "paths": {
        "/acts/junipr~website-performance-analyzer/run-sync-get-dataset-items": {
            "post": {
                "operationId": "run-sync-get-dataset-items-junipr-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/junipr~website-performance-analyzer/runs": {
            "post": {
                "operationId": "runs-sync-junipr-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/junipr~website-performance-analyzer/run-sync": {
            "post": {
                "operationId": "run-sync-junipr-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",
                "properties": {
                    "urls": {
                        "title": "URLs to Analyze",
                        "type": "array",
                        "description": "URLs to audit. Each entry: { \"url\": \"https://...\", \"label\": \"optional-name\" }.",
                        "items": {
                            "type": "object",
                            "properties": {
                                "url": {
                                    "type": "string",
                                    "title": "URL",
                                    "description": "URL to analyze"
                                },
                                "label": {
                                    "type": "string",
                                    "title": "Label",
                                    "description": "Optional label for reporting"
                                }
                            }
                        },
                        "default": [
                            {
                                "url": "https://crawlee.dev",
                                "label": "crawlee"
                            }
                        ]
                    },
                    "device": {
                        "title": "Device Mode",
                        "enum": [
                            "mobile",
                            "desktop"
                        ],
                        "type": "string",
                        "description": "Lighthouse emulation mode. Mobile uses throttled 4x CPU slowdown and 3G-like network; Desktop uses unthrottled settings.",
                        "default": "mobile"
                    },
                    "maxConcurrency": {
                        "title": "Max Concurrency",
                        "minimum": 1,
                        "maximum": 5,
                        "type": "integer",
                        "description": "Maximum number of URLs analyzed in parallel. Note: Lighthouse runs are resource-intensive, so keep this low.",
                        "default": 3
                    },
                    "requestTimeout": {
                        "title": "Page Load Timeout (ms)",
                        "minimum": 10000,
                        "maximum": 120000,
                        "type": "integer",
                        "description": "Maximum time Lighthouse will wait for a page to load before collecting metrics.",
                        "default": 60000
                    }
                }
            },
            "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
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}
```
