# Page Weight Checker – Page Size, Requests & Load Time (`adamplaenitz/page-weight-checker`) Actor

Measure page weight and load performance in headless Chrome, without Google APIs: transferred and uncompressed bytes, requests per type, largest files, TTFB, LCP, load time, gzip/Brotli and cache headers, third-party domains, grade and fixes.

- **URL**: https://apify.com/adamplaenitz/page-weight-checker.md
- **Developed by:** [Adam Plänitz](https://apify.com/adamplaenitz) (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 $6.00 / 1,000 page measureds

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/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

## Page Weight Checker – Page Size, Requests & Load Time

**Find out how heavy a web page really is and what makes it slow – without Google PageSpeed API keys or quotas.** The Actor loads every URL once in a real headless Chrome with an empty cache and records every network request through the Chrome DevTools protocol. One row per page shows the transferred and uncompressed size, requests per type (HTML, JavaScript, CSS, images, fonts, media, XHR), the largest files, TTFB, First/Largest Contentful Paint, DOMContentLoaded and load time, gzip/Brotli compression and Cache-Control per resource, third-party domains, a 0–100 score with grade A–F and concrete recommendations. Export as JSON, CSV or Excel, or connect to Google Sheets, Slack, Make, Zapier, n8n or webhooks.

### What does it do?

1. Opens each URL in a fresh browser context (empty cache, no cookies) as desktop (1366 × 900) or mobile (Android phone, 412 × 915) visitor.
2. Waits for the load event, network idle (max. 10 s) and an extra 2 s (adjustable). Optionally scrolls to the bottom so lazy-loaded images count too.
3. Records every request – also those of cross-site iframes such as video embeds and ads – with transferred bytes (incl. headers, as in the DevTools "Transferred" column), uncompressed size, status, protocol (h2/h3/http/1.1), `Content-Encoding`, `Cache-Control` / `Expires` lifetime and timing.
4. Reads the browser's own Navigation Timing, Paint Timing, Largest Contentful Paint and Layout Shift entries.
5. Aggregates per page, applies the rules below and calculates a transparent score.
6. Optional crawl: follows links to other pages on the same host until *Maximum pages* is reached.

#### Recommendation rules

| Code | Triggered when |
|---|---|
| `LARGE_PAGE_WEIGHT` | more than 2.5 MB transferred (high above 5 MB) |
| `MANY_REQUESTS` | more than 80 requests (medium above 150) |
| `SLOW_TTFB` | time to first byte above 800 ms (high above 1800 ms) |
| `SLOW_LCP` | Largest Contentful Paint above 2.5 s (high above 4 s) |
| `UNCOMPRESSED_TEXT` | HTML/CSS/JS/JSON/SVG over 1.4 KB sent without gzip, Brotli or zstd – with estimated savings |
| `NO_BROTLI` | (info) only gzip is used |
| `SHORT_CACHE_TTL` | own static files (JS, CSS, images, fonts, media) without or with less than 7 days browser cache lifetime |
| `LARGE_JAVASCRIPT` / `LARGE_CSS` | more than 500 KB JavaScript (high above 1 MB) / 200 KB CSS transferred |
| `LARGE_IMAGES` / `LEGACY_IMAGE_FORMAT` | images over 200 KB / JPEG, PNG or GIF over 100 KB |
| `MANY_WEB_FONTS` | more than 6 font files or 300 KB of fonts |
| `MANY_THIRD_PARTIES` | more than 8 third-party domains (medium above 15) |
| `HTTP1_ONLY` | more than 6 own requests over HTTP/1.1 |
| `FAILED_REQUESTS` | requests that failed or returned 4xx/5xx |
| `DOCUMENT_REDIRECTS` | the page URL redirects before the HTML arrives |
| `LARGE_DOM` / `LARGE_HTML` | more than 1,500 DOM elements / HTML larger than 500 KB uncompressed |

#### Score

The score starts at 100 and loses points for page weight above 1 MB (max. −30), requests above 50 (max. −10), TTFB above 800 ms (max. −15), LCP above 2.5 s (max. −15), uncompressed text (max. −10), poorly cached own assets (max. −5), JavaScript above 300 KB (max. −10) and more than 5 third-party domains (max. −5). The deductions are part of every row (`scoreDeductions`). Grades: A ≥ 90, B ≥ 80, C ≥ 65, D ≥ 50, F below 50.

### Who is it for?

- **Web agencies and freelancers** who want a quick weight/performance overview for many client pages or a whole site.
- **SEO and marketing teams** who need to see which tags, images and third parties make pages heavy.
- **Developers** who want a repeatable, scriptable check after deployments – schedule runs and compare the numbers.
- Anyone who needs page-weight data in bulk without Google API keys, quotas or Lighthouse installations.

### Input

| Field | Default | Description |
|---|---|---|
| URLs to measure | 3 example pages | One per line. Bare domains open as `https://domain/`. |
| Also measure linked pages on the same site | off | Same-host crawl. |
| Maximum pages | 10 | Cap for measured pages per run (start URLs + crawled pages). |
| Device | desktop | `desktop` or `mobile`. |
| Scroll to the bottom | off | Counts lazy-loaded content as well. |
| Wait after page load | 2 s | Extra time after load + network idle. |
| List every resource | off | Adds the full request list (up to 1,000 per page). |
| Respect robots.txt when crawling | on | Applies to crawled pages; start URLs are always opened. |
| Page load timeout | 45 s | |
| Parallel browser pages | 2 | Fewer parallel pages give more stable timings. |
| Proxy configuration | none | Only needed for sites that block cloud servers. |

### Output example (shortened)

```json
{
  "url": "https://www.wikipedia.org/",
  "finalUrl": "https://www.wikipedia.org/",
  "statusCode": 200,
  "pageTitle": "Wikipedia",
  "device": "desktop",
  "grade": "A",
  "score": 98,
  "transferMB": 0.07,
  "transferBytes": 78526,
  "uncompressedBytes": 217833,
  "requests": 5,
  "requestsByType": { "document": 1, "script": 2, "stylesheet": 0, "image": 2, "font": 0, "media": 0, "xhr": 0, "other": 0 },
  "transferBytesByType": { "document": 30544, "script": 11853, "image": 36129, "…": 0 },
  "timings": { "ttfbMs": 171, "serverResponseMs": 89, "firstContentfulPaintMs": 376, "largestContentfulPaintMs": 376, "domContentLoadedMs": 370, "loadMs": 372, "cumulativeLayoutShift": 0, "documentRedirects": 0 },
  "domElements": 1199,
  "mainDocument": { "protocol": "h2", "encoding": "gzip", "cacheControl": "s-maxage=86400, must-revalidate, max-age=3600", "transferBytes": 30544, "uncompressedBytes": 122506, "server": "ATS/9.2.16" },
  "thirdParty": { "requests": 0, "transferBytes": 0, "uncompressedBytes": 0, "domains": 0, "sharePct": 0 },
  "thirdPartyDomains": [],
  "protocols": { "h2": 5 },
  "compression": { "compressibleBytes": 202004, "brotliOrZstdResponses": 0, "gzipOnlyResponses": 3, "uncompressedCount": 0, "uncompressedBytes": 0, "uncompressedResources": [] },
  "caching": {
    "staticAssets": 4, "poorlyCachedCount": 4, "poorlyCachedFirstParty": 4, "poorlyCachedBytes": 47982,
    "poorlyCachedResources": [{ "url": "https://www.wikipedia.org/portal/wikipedia.org/assets/img/sprite-e49fbf32.svg", "type": "image", "thirdParty": false, "transferBytes": 19296, "uncompressedBytes": 51190, "cacheControl": "s-maxage=86400, max-age=86400", "cacheTtl": "1 d" }]
  },
  "images": { "count": 2, "modernFormat": 0, "largeImages": [], "legacyFormatLarge": [] },
  "largestResources": [{ "url": "https://www.wikipedia.org/", "type": "document", "thirdParty": false, "transferBytes": 30544, "uncompressedBytes": 122506 }],
  "recommendationCount": 1,
  "recommendations": [
    { "code": "SHORT_CACHE_TTL", "severity": "low", "message": "4 own static asset(s) have no or a short (< 7 days) browser cache lifetime. Use versioned file names with \"Cache-Control: max-age=31536000, immutable\".", "savingsBytes": 47982 }
  ],
  "scoreDeductions": { "pageWeight": 0, "requests": 0, "ttfb": 0, "lcp": 0, "compression": 0, "caching": 2, "javascript": 0, "thirdParties": 0 },
  "crawlDepth": 0,
  "measuredAt": "2026-11-20T20:10:41.512Z",
  "note": "Lab measurement from a single headless Chromium visit …",
  "error": null
}
```

With *List every resource* each row also contains `resources` with `url`, `type`, `thirdParty`, `status`, `mimeType`, `protocol`, `transferBytes`, `uncompressedBytes`, `encoding`, `cacheControl`, `cacheTtl`, `startMs`, `durationMs`, `failed` and `redirect`.

Pages that could not be measured (HTTP 4xx/5xx, DNS errors, timeouts, proxy errors, non-HTML files, invalid input) produce a row with `errorCode` and `error`. The **Overview** table shows URL, grade, score, MB transferred, requests per type, third parties, TTFB, LCP, DOMContentLoaded, load time and the number of recommendations. The run summary (key-value store record `RUN-SUMMARY`) adds the grade distribution, averages, the most frequent recommendations and third-party domains.

### Pricing and speed

See the **Pricing** tab. You pay per measured page; **rows for pages that could not be measured are free**. Duplicates are removed. You can set a maximum cost per run – the Actor stops cleanly when it is reached.

The Actor runs a real browser (default 2 GB memory). Each page needs its load time plus up to 10 s network idle plus the extra wait (2 s by default); typical pages take 5–15 s, two pages run in parallel by default. If you select the Apify proxy group *RESIDENTIAL*, pages are charged with the separate, higher-priced event "Page measured via Apify residential proxy", which already includes the residential traffic of the whole page. Other proxy settings use the normal per-page price.

### How to read the numbers

- **Lab data, not field data.** Each page is loaded once from an Apify data centre without network or CPU throttling. Timings (TTFB, LCP, load) therefore depend on the distance to the server and vary between runs; they are best used to compare pages and to spot outliers, not as Core Web Vitals field values. Byte and request counts are much more stable.
- **Third parties** are requests to another registrable domain (eTLD+1). Asset domains that contain the site's name (e.g. `githubassets.com` for `github.com`) count as first party.
- **Transferred bytes** include HTTP headers, like the "Transferred" column in Chrome DevTools. Requests still running when the measurement ends (e.g. streaming video) are counted with the bytes received so far.

### Data, licence and privacy

- All data comes from loading the page itself; **no Google API, no third-party database**.
- No page content, screenshots, cookies or form data are stored – only URLs, sizes, headers relevant to performance (`Content-Encoding`, `Cache-Control`, `Server`) and timings. No forms are submitted, no logins.
- The browser presents itself with a common browser fingerprint, because many websites block headless browsers. Please measure only websites you own or are allowed to test. Private and internal addresses are refused.
- This Actor is **not affiliated with or endorsed by** Google, Lighthouse or any website mentioned.

### Limits

- One load per page with an empty cache (first visit). Repeat-visit performance is not measured; the caching section shows what could be reused.
- Content that loads only after clicks or consent (e.g. tags behind a cookie banner) is not counted.
- Service-worker responses and WebSocket traffic are only partly visible.
- Sites with strong bot protection may answer with 403 (free row); a proxy can help.
- Crawling follows `<a href>` links on the same host only.

Questions or feature requests? Please open an issue in the **Issues** tab.

# Actor input Schema

## `startUrls` (type: `array`):

Pages to measure, one per line (e.g. https://www.example.com). Bare domains are opened as https://domain/. Each page is loaded once in a fresh headless Chromium profile with an empty cache. If empty, three example pages are measured.

## `crawlSameDomain` (type: `boolean`):

Follow links on the measured pages to other pages of the same website (same host, "www." ignored) until "Maximum pages" is reached.

## `maxPages` (type: `integer`):

Upper limit for measured pages in this run (start URLs plus crawled pages). You pay per measured page, so this also caps the cost.

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

Desktop (1366 x 900) or mobile (Android phone, 412 x 915, touch). Many sites serve different images and scripts to phones.

## `scrollPage` (type: `boolean`):

Scroll through the page after loading so lazy-loaded images and widgets are counted as well. Off = only what loads without user interaction (initial page weight).

## `waitAfterLoadSecs` (type: `integer`):

Extra time after the load event and network idle (max. 10 s) before the measurement ends. Late requests (tags, lazy widgets) are counted until then.

## `includeAllResources` (type: `boolean`):

Add the full request list (up to 1,000 per page) with type, sizes, compression, Cache-Control and timing. Off = only the 10 largest resources and the problem lists, which keeps rows small.

## `respectRobotsTxt` (type: `boolean`):

Pages found by the crawl that robots.txt disallows are skipped. The start URLs are always opened, like a visitor would.

## `pageTimeoutSecs` (type: `integer`):

Pages that do not reach the load event within this time are retried and then reported as a free error row.

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

Maximum pages measured at the same time (1-10). Fewer parallel pages give more stable timings.

## `proxyConfiguration` (type: `object`):

Optional. Only needed if a site blocks cloud servers or serves different content by country. The Apify RESIDENTIAL group is charged with a separate, higher-priced event (it includes the residential traffic).

## Actor input object example

```json
{
  "startUrls": [
    "https://www.wikipedia.org/",
    "https://github.com/",
    "https://apify.com/"
  ],
  "crawlSameDomain": false,
  "maxPages": 10,
  "device": "desktop",
  "scrollPage": false,
  "waitAfterLoadSecs": 2,
  "includeAllResources": false,
  "respectRobotsTxt": true,
  "pageTimeoutSecs": 45,
  "maxConcurrency": 2,
  "proxyConfiguration": {
    "useApifyProxy": false
  }
}
```

# Actor output Schema

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

One item per measured page with sizes, requests per type, timings, compression, caching, third parties, grade and recommendations (plus free rows for pages that could not be measured).

## `summary` (type: `string`):

Grade distribution, averages, most frequent recommendations and third-party domains.

# 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 = {
    "startUrls": [
        "https://www.wikipedia.org/",
        "https://github.com/",
        "https://apify.com/"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("adamplaenitz/page-weight-checker").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 = { "startUrls": [
        "https://www.wikipedia.org/",
        "https://github.com/",
        "https://apify.com/",
    ] }

# Run the Actor and wait for it to finish
run = client.actor("adamplaenitz/page-weight-checker").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 '{
  "startUrls": [
    "https://www.wikipedia.org/",
    "https://github.com/",
    "https://apify.com/"
  ]
}' |
apify call adamplaenitz/page-weight-checker --silent --output-dataset

```

## MCP server setup

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

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/ulKAlFtOtBE5hckhQ/builds/JBB4d8zdPUEGhEQfV/openapi.json
