# Page Size Profiler (`zerobreak/page-size-profiler`) Actor

Page size profiler that measures web page weight broken down by HTML, CSS, JavaScript, and images, so SEO teams can pinpoint what makes pages slow and decide what to cut.

- **URL**: https://apify.com/zerobreak/page-size-profiler.md
- **Developed by:** [ZeroBreak](https://apify.com/zerobreak) (community)
- **Categories:** SEO tools
- **Stats:** 3 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

$2.99/month + usage

To use this Actor, you pay a monthly rental fee to the developer. The rent is subtracted from your prepaid usage every month after the free trial period.You also pay for the Apify platform usage, which gets cheaper the higher Apify subscription plan you have.

Learn more: https://docs.apify.com/platform/actors/running/actors-in-store#rental-actors

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

## Page Size Profiler: Measure Web Page Weight by Resource Type

Page Size Profiler fetches any public web page and tells you exactly how much it weighs. You get the HTML size, plus a breakdown of every CSS file, JavaScript bundle, image, and font the page loads. Useful when you already suspect a page is too heavy and want numbers before deciding what to cut.

SEO performance and page load time are directly tied to page weight. This actor gives you the raw data to make that case without guessing.

### Use cases

- **SEO auditing**: find pages dragging down your Core Web Vitals scores by identifying which ones load the most CSS, JS, or image weight
- **Performance budgeting**: measure page size before and after optimizations to confirm the change actually helped
- **Content audits**: run a list of landing pages through the profiler and sort by total weight to find the worst offenders fast
- **Agency reporting**: pull page size data for client reports without manually checking each URL in a browser
- **QA before launch**: verify that a newly built page doesn't ship with uncompressed images or an oversized JS bundle

### What data does this actor extract?

Each result contains the HTML size, total page weight, per-type size totals, resource counts, server response time, and the final URL after redirects.

```json
{
    "url": "https://apify.com",
    "finalUrl": "https://apify.com/",
    "statusCode": 200,
    "pageTitle": "Apify: Full-Stack Web Scraping and Data Extraction Platform",
    "htmlSizeBytes": 142318,
    "htmlSizeKb": 138.98,
    "cssSizeBytes": 89423,
    "jsSizeBytes": 1247891,
    "imageSizeBytes": 384210,
    "fontSizeBytes": 62144,
    "otherSizeBytes": 0,
    "totalSizeBytes": 1925986,
    "totalSizeKb": 1880.85,
    "resourceCount": 34,
    "cssCount": 3,
    "jsCount": 18,
    "imageCount": 12,
    "fontCount": 1,
    "otherCount": 0,
    "loadTimeMs": 412,
    "scrapedAt": "2026-03-08T10:00:00.000000+00:00",
    "error": null
}
````

### Input

| Parameter | Type | Default | Description |
|-----------|------|---------|-------------|
| `url` | string | | Single URL to profile. |
| `urls` | array | | List of URLs to profile, one per line. |
| `fetchResources` | boolean | `true` | Fetch all linked CSS, JS, image, and font files to measure their sizes. Disable for HTML-only measurements. |
| `maxUrls` | integer | `100` | Maximum number of URLs to process per run. |
| `timeoutSecs` | integer | `300` | Overall actor run timeout in seconds. |
| `requestTimeoutSecs` | integer | `30` | Timeout per individual HTTP request in seconds. |
| `proxyConfiguration` | object | Datacenter (Anywhere) | Proxy type and location for requests. Supports Datacenter, Residential, Special, and custom proxies. Optional. |

#### Example input

```json
{
    "urls": [
        "https://apify.com",
        "https://docs.apify.com"
    ],
    "fetchResources": true,
    "maxUrls": 100,
    "requestTimeoutSecs": 30,
    "proxyConfiguration": { "useApifyProxy": true }
}
```

### Output

The actor stores one result per URL in the default dataset. Each entry contains:

| Field | Type | Description |
|-------|------|-------------|
| `url` | string | The input URL. |
| `finalUrl` | string | The URL after following redirects. |
| `statusCode` | integer | HTTP status code from the server. |
| `pageTitle` | string | Text from the page's `<title>` element. |
| `htmlSizeBytes` | integer | Raw HTML response size in bytes. |
| `htmlSizeKb` | number | Raw HTML response size in kilobytes. |
| `cssSizeBytes` | integer | Combined size of all linked CSS files in bytes. |
| `jsSizeBytes` | integer | Combined size of all linked JavaScript files in bytes. |
| `imageSizeBytes` | integer | Combined size of all linked images in bytes. |
| `fontSizeBytes` | integer | Combined size of all linked font files in bytes. |
| `otherSizeBytes` | integer | Combined size of all other linked resources in bytes. |
| `totalSizeBytes` | integer | HTML plus all linked resources in bytes. |
| `totalSizeKb` | number | HTML plus all linked resources in kilobytes. |
| `resourceCount` | integer | Total number of linked resources found. |
| `cssCount` | integer | Number of CSS stylesheets linked. |
| `jsCount` | integer | Number of JavaScript files linked. |
| `imageCount` | integer | Number of images linked. |
| `fontCount` | integer | Number of font files linked. |
| `otherCount` | integer | Number of other resource types linked. |
| `loadTimeMs` | integer | Time to fetch the main HTML page in milliseconds. |
| `scrapedAt` | string | ISO 8601 timestamp of when the page was profiled. |
| `error` | string | Error message if the page failed. Null on success. |

### How it works

1. Accepts a single URL or a list of URLs via input.
2. Fetches each page with a realistic browser User-Agent, following redirects.
3. Measures the HTML response body size in bytes.
4. Parses the HTML to find all linked CSS, JavaScript, image, and font resources.
5. If `fetchResources` is enabled, fetches each resource (HEAD first, then GET if needed) and records its size.
6. Sums everything up and pushes one result row per URL to the dataset.

### Integrations

Connect Page Size Profiler with other tools using [Apify integrations](https://apify.com/integrations). Export results directly to Google Sheets, trigger Slack alerts when a page exceeds a size threshold, or pipe data into Zapier and Make automations. You can also use [webhooks](https://docs.apify.com/integrations/webhooks) to kick off a downstream action the moment results are ready.

### FAQ

**Does this actor handle pages that redirect?**
Yes. The actor follows all HTTP redirects and records the final URL in the `finalUrl` field alongside the original input URL.

**What if I only want the HTML size and not the full resource breakdown?**
Set `fetchResources` to `false`. The actor will still fetch and parse the page but skip the individual resource requests. Runs are much faster this way.

**Can it profile pages that require a login?**
No. The actor works with publicly accessible pages only. It does not support cookies, sessions, or authentication headers.

**How many URLs can it process per run?**
Up to 1000, controlled by the `maxUrls` input. The default is 100. For very large lists, consider splitting into multiple runs.

**Why are some resource sizes zero even with fetchResources enabled?**
Some resources return 0 if the server rejects HEAD and GET requests for that file, or if the resource URL is behind authentication. The HTML size is always accurate.

**Does it work on JavaScript-rendered pages?**
The actor uses plain HTTP requests, not a browser. It measures the raw HTML the server returns, which may not include dynamically injected resources. For full SPA profiling, a browser-based approach is needed.

# Actor input Schema

## `url` (type: `string`):

Single web page URL to profile. Scheme (https://) is added automatically if missing.

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

List of web page URLs to profile. One URL per line.

## `fetchResources` (type: `boolean`):

If enabled, the actor fetches all linked CSS, JavaScript, image, and font files to measure their sizes. Disabling this makes runs faster but only reports HTML size.

## `maxUrls` (type: `integer`):

Maximum number of URLs to process per run. Excess URLs are ignored.

## `timeoutSecs` (type: `integer`):

Overall actor timeout in seconds. The actor stops after this time even if not all URLs are done.

## `requestTimeoutSecs` (type: `integer`):

Timeout for each individual HTTP request in seconds. Requests that exceed this are skipped with an error.

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

Select proxies to use for requests. Helps avoid IP blocking and rate limits. Datacenter proxies are fastest; Residential proxies are harder to detect.

## Actor input object example

```json
{
  "url": "https://apify.com",
  "urls": [
    "https://apify.com",
    "https://docs.apify.com"
  ],
  "fetchResources": true,
  "maxUrls": 100,
  "timeoutSecs": 300,
  "requestTimeoutSecs": 30,
  "proxyConfiguration": {
    "useApifyProxy": 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 = {
    "url": "https://apify.com",
    "proxyConfiguration": {
        "useApifyProxy": true
    }
};

// Run the Actor and wait for it to finish
const run = await client.actor("zerobreak/page-size-profiler").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 = {
    "url": "https://apify.com",
    "proxyConfiguration": { "useApifyProxy": True },
}

# Run the Actor and wait for it to finish
run = client.actor("zerobreak/page-size-profiler").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 '{
  "url": "https://apify.com",
  "proxyConfiguration": {
    "useApifyProxy": true
  }
}' |
apify call zerobreak/page-size-profiler --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "command": "npx",
            "args": [
                "mcp-remote",
                "https://mcp.apify.com/?tools=zerobreak/page-size-profiler",
                "--header",
                "Authorization: Bearer <YOUR_API_TOKEN>"
            ]
        }
    }
}

```

## OpenAPI specification

```json
{
    "openapi": "3.0.1",
    "info": {
        "title": "Page Size Profiler",
        "description": "Page size profiler that measures web page weight broken down by HTML, CSS, JavaScript, and images, so SEO teams can pinpoint what makes pages slow and decide what to cut.",
        "version": "0.0",
        "x-build-id": "cj9YmYqD8yz4Dzc32"
    },
    "servers": [
        {
            "url": "https://api.apify.com/v2"
        }
    ],
    "paths": {
        "/acts/zerobreak~page-size-profiler/run-sync-get-dataset-items": {
            "post": {
                "operationId": "run-sync-get-dataset-items-zerobreak-page-size-profiler",
                "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/zerobreak~page-size-profiler/runs": {
            "post": {
                "operationId": "runs-sync-zerobreak-page-size-profiler",
                "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/zerobreak~page-size-profiler/run-sync": {
            "post": {
                "operationId": "run-sync-zerobreak-page-size-profiler",
                "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": {
                    "url": {
                        "title": "URL",
                        "type": "string",
                        "description": "Single web page URL to profile. Scheme (https://) is added automatically if missing."
                    },
                    "urls": {
                        "title": "URLs",
                        "type": "array",
                        "description": "List of web page URLs to profile. One URL per line.",
                        "items": {
                            "type": "string"
                        }
                    },
                    "fetchResources": {
                        "title": "Fetch linked resources",
                        "type": "boolean",
                        "description": "If enabled, the actor fetches all linked CSS, JavaScript, image, and font files to measure their sizes. Disabling this makes runs faster but only reports HTML size.",
                        "default": true
                    },
                    "maxUrls": {
                        "title": "Max URLs",
                        "minimum": 1,
                        "maximum": 1000,
                        "type": "integer",
                        "description": "Maximum number of URLs to process per run. Excess URLs are ignored.",
                        "default": 100
                    },
                    "timeoutSecs": {
                        "title": "Run timeout (seconds)",
                        "minimum": 30,
                        "maximum": 3600,
                        "type": "integer",
                        "description": "Overall actor timeout in seconds. The actor stops after this time even if not all URLs are done.",
                        "default": 300
                    },
                    "requestTimeoutSecs": {
                        "title": "Request timeout (seconds)",
                        "minimum": 5,
                        "maximum": 120,
                        "type": "integer",
                        "description": "Timeout for each individual HTTP request in seconds. Requests that exceed this are skipped with an error.",
                        "default": 30
                    },
                    "proxyConfiguration": {
                        "title": "Proxy configuration",
                        "type": "object",
                        "description": "Select proxies to use for requests. Helps avoid IP blocking and rate limits. Datacenter proxies are fastest; Residential proxies are harder to detect."
                    }
                }
            },
            "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
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}
```
