# Website Health & Performance Monitor: Uptime, Speed, Resources (`centorprat/website-health-performance-monitor`) Actor

Monitor a website's health in one call: uptime and timings, a resource waterfall and page weight, a performance score with fixes, history across runs to catch deterioration, and an overall verdict. Schedule + webhook for alerts. Optional real Lighthouse with your own PageSpeed key. Keyless core.

- **URL**: https://apify.com/centorprat/website-health-performance-monitor.md
- **Developed by:** [Centor Prat](https://apify.com/centorprat) (community)
- **Categories:** Developer tools
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $17.00 / 1,000 site checkeds

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.
Since this Actor supports Apify Store discounts, the price gets lower the higher subscription plan you have.

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 Health & Performance Monitor: Uptime, Speed, Resources

**One call tells you if a site is healthy — and whether it's getting worse.** For each URL it measures
**uptime and timings**, audits the page's **resources** (a waterfall + page weight + by-type breakdown),
computes a **performance score** with concrete fixes, remembers **history across runs** to catch
**deterioration** and roll up per day/week/month, and gives an overall **verdict**. Schedule it (e.g.
every 5–15 min) and set `webhookUrl` to be alerted the moment a site goes down, slows, or deteriorates.
Keyless core, agent-callable.

> 🩺 **Read-only.** It loads the page and the resources the page itself references, exactly as a browser
> does — no probing or scanning. Recommendations and signals, not a verdict on anyone else's site.

### ⚡ The full picture, in one report

| Group | What you get |
|---|---|
| **Uptime** | `up`, HTTP status, HTTPS, redirects, `error` when down |
| **Timings** | full phase breakdown: DNS, TCP connect, TLS handshake, TTFB, download, total (ms) |
| **TLS cert** | days until the certificate expires, and any cert problem |
| **Content** | optional keyword assertion - flags `content-mismatch` when a 200 page is broken/defaced |
| **Resources** | request count, total page weight (KB), by-type breakdown (JS/CSS/images), largest + slowest resources, uncompressed/uncacheable counts |
| **Performance** | a 0–100 synthetic score + grade + specific issues (slow TTFB, heavy page, uncompressed assets, no HTTPS…) |
| **History** | per day/week/month rollups (uptime %, avg load, avg score) and **deterioration** vs the recent baseline |
| **Verdict** | `healthy` / `slow` / `deteriorating` / `down` |
| **Lighthouse** *(optional)* | real performance score + Core Web Vitals (FCP/LCP/CLS/TBT) via PageSpeed Insights, if you paste your own free key |

### 🔁 Monitoring & alerts

- **Schedule** the Actor (Apify Schedules) to run every few minutes — it builds history and rollups automatically.
- **`webhookUrl`** POSTs any down/slow/deteriorating sites as JSON — wire it to Slack/email/SMS via Make or Zapier.
- Set `onlyProblems: true` so scheduled runs emit only what needs attention.

### 📥 Input

```json
{ "urls": ["https://your-site.com"], "auditResources": true, "slowLoadMs": 3000 }
```

Add `pageSpeedApiKey` (your own free key) for real Lighthouse + Core Web Vitals. One report per URL.

### 📤 Example output (real run, trimmed — python.org)

```json
{ "finalUrl": "https://www.python.org/", "signal": "healthy", "status": 200,
  "ttfbMs": 190, "loadTimeMs": 199,
  "performance": { "score": 92, "grade": "A", "issues": ["HTML is not compressed (gzip/br)."] },
  "resources": { "requestCount": 14, "resourceWeightKB": 393,
    "byType": { "script": {"count": 9, "KB": 222}, "stylesheet": {"count": 4, "KB": 155} },
    "largestResources": [ {"type": "stylesheet", "KB": 122} ] },
  "history": { "day": {"checks": 12, "uptimePct": 100.0, "avgLoadMs": 205 } } }
```

### 💰 Pricing (pay-per-event)

- **Site checked — $0.02** per URL per run (includes the full resource audit). Lighthouse (your key) adds no fee.

### 💡 Use cases

- **Site owners / ops / SRE:** uptime + performance + deterioration alerts without standing up a monitoring stack.
- **Agencies / MSPs:** watch every client site's health and page weight from one place, with history.
- **Growth / e-commerce:** page weight and load creep quietly hurt conversion — catch the trend early.
- **Agents / CI:** callable as an MCP tool — give it URLs, get back a health verdict and the numbers.

### 🔑 Keyless core & agent-callable

The core (uptime, timings, resource waterfall, performance score, history) needs no keys or external
services. Real Lighthouse is optional and uses *your* PageSpeed key.

### 🚀 Ready-made tasks (one click)

- [Website Uptime & Performance Monitor (Scheduled)](https://apify.com/centorprat/website-health-performance-monitor/examples/website-uptime-performance-monitor)

### 🤖 For AI agents (MCP)

```
https://mcp.apify.com/?tools=actors,docs,centorprat/website-health-performance-monitor
```

Loads as `centorprat--website-health-performance-monitor`. Claude Code:

```
claude mcp add apify -- npx -y @apify/actors-mcp-server --actors centorprat/website-health-performance-monitor
```

# Actor input Schema

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

Pages to check, e.g. \["https://your-site.com"]. One health report per URL. Schedule the Actor (e.g. every 5-15 min) to build history and catch problems.

## `auditResources` (type: `boolean`):

Fetch the scripts, styles and images the page references and measure their size and load time. Turn off for a lightweight uptime-only check.

## `maxResources` (type: `integer`):

Cap how many referenced resources to fetch.

## `slowLoadMs` (type: `integer`):

Load times above this are flagged 'slow'.

## `persistHistory` (type: `boolean`):

Store each run's snapshot in a named key-value store so the Actor can roll up per day/week/month and flag deterioration vs the recent baseline.

## `pageSpeedApiKey` (type: `string`):

Paste your own free Google PageSpeed Insights API key to also run a REAL Lighthouse audit (performance score + Core Web Vitals). Left blank, the Actor uses its keyless synthetic score instead.

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

mobile or desktop (only used when a PageSpeed key is set).

## `onlyProblems` (type: `boolean`):

On: return only down/slow/deteriorating sites (ideal for scheduled alerting).

## `webhookUrl` (type: `string`):

If set, sites that are down/slow/deteriorating are POSTed here as JSON - wire it to Slack/email via Make or Zapier.

## `expectedText` (type: `string`):

If set, the Actor checks the page HTML contains this text and flags 'content-mismatch' if it's missing - catches pages that return 200 but are broken, empty or defaced.

## Actor input object example

```json
{
  "urls": [
    "https://www.python.org/"
  ],
  "auditResources": true,
  "maxResources": 40,
  "slowLoadMs": 3000,
  "persistHistory": true,
  "strategy": "mobile",
  "onlyProblems": false
}
```

# Actor output Schema

## `health` (type: `string`):

One report per URL: a verdict signal (healthy / slow / deteriorating / down), uptime and status, TTFB and load time, a resource waterfall (requests, page weight, by-type breakdown, largest/slowest), a synthetic performance score with fixes, optional real Lighthouse (with your key), deterioration vs the recent baseline, and per day/week/month rollups.

# 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://www.python.org/"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("centorprat/website-health-performance-monitor").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://www.python.org/"] }

# Run the Actor and wait for it to finish
run = client.actor("centorprat/website-health-performance-monitor").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 '{
  "urls": [
    "https://www.python.org/"
  ]
}' |
apify call centorprat/website-health-performance-monitor --silent --output-dataset

```

## MCP server setup

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

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/RAd2UveysOwELAdEY/builds/Jrdq0DyhQdPWVyZVz/openapi.json
