# Website Health Report: PageSpeed, Broken Links & SEO (PDF) (`grace_hartwell/website-health-report`) Actor

Client-ready website audit: PageSpeed & Core Web Vitals, broken links, redirect chains and on-page SEO per page, a 0-100 health score and prioritised to-dos, as dataset plus white-label HTML/PDF report.

- **URL**: https://apify.com/grace_hartwell/website-health-report.md
- **Developed by:** [Grace M. Hartwell](https://apify.com/grace_hartwell) (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 $10.00 / 1,000 page analyseds

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

<img src="https://apify-image-uploads-prod.s3.us-east-1.amazonaws.com/dpsKHwXKHdbwBgwOT-profile-dxtJoi0ame-avatar-hartwell-800.png" alt="Hartwell Toolworks" width="96" height="96" />

**Website Health Report** audits a website and turns the result into a **client-ready report**: **PageSpeed Insights and Core Web Vitals** scores per page, **broken links and redirect chains**, **on-page SEO checks**, a **0–100 health score** and a **prioritised to-do list**. You get a dataset (one item per page) plus an **HTML and PDF report** in the key-value store, optionally **white-label** with your agency name, logo, colour and contact line. Built for freelancers and agencies who send monthly website reports. You pay **$0.01 per page** plus **$0.004 per PageSpeed audit** with your own free Google API key. Without a key, links and on-page SEO are still checked and the PageSpeed part is skipped for free.

### What does the Website Health Report do?

- **Crawls your site** from the start URL (same host, robots.txt respected, depth and page limits).
- **Checks every unique link once**: internal and external links, images, scripts and stylesheets. It finds 404/410/5xx errors, timeouts, redirect chains and loops, https→http downgrades and mixed content.
- **Runs Google PageSpeed Insights** (official API, your own key) for the most important pages on mobile and/or desktop: performance, SEO, accessibility and best-practices scores, LCP, CLS, TBT, FCP, Speed Index, TTFB, the real-user Core Web Vitals assessment (CrUX via PageSpeed) and the biggest Lighthouse opportunities.
- **Checks on-page SEO**: title, meta description, H1, canonical, `lang`, mobile viewport, `noindex` (meta and `X-Robots-Tag`), images without `alt`, thin content, and duplicate titles and descriptions across pages.
- **Scores** every page and the whole site (0–100, grade A–D) and builds **one prioritised to-do list** (High / Medium / Low, with effort, affected pages, examples and a short fix).
- **Writes the report**: `report.html` (self-contained, print-friendly, mobile-friendly) and `report.pdf` (A4), plus `OUTPUT` (summary JSON), `TODOS` and `LINKS` in the default key-value store.

### Key features

- 🧾 **Client-ready HTML and PDF report**, not just JSON. Send it as it is.
- 🏷️ **White label**: your agency name, logo (PNG/JPEG), brand colour and footer contact line. With white label on, the report has no tool credit.
- 📊 **One health score** with a transparent formula: 40% performance + 30% links + 30% on-page SEO.
- ✅ **Prioritised to-dos** across the site instead of one long list of issues per page.
- ⚡ **PageSpeed and Core Web Vitals** from the official Google API, with retries and Retry-After handling. Your key is stored as a secret input and masked in every log line.
- 🔗 **Reliable link checks**: HEAD with GET fallback, manual redirect following, retries with backoff for 429/5xx, and per-host politeness.
- 🆓 **No key? No charge for PageSpeed**: the report still covers links and on-page SEO, a free notice item explains how to add a key, and the run succeeds.
- 💸 **Budget-aware**: the run is sized to your *Max total charge* and stops cleanly.

### Use cases

1. **Monthly client reports** for web design and SEO retainers: schedule the Actor and send the PDF.
2. **Sales audits**: show a prospect their health score and top 10 fixes in the first call. Only audit sites you are allowed to test.
3. **Website launch and relaunch QA**: find broken links, redirect chains and missing meta tags before go-live.
4. **Portfolio monitoring** for agencies: run it for every client site and compare the scores month by month.
5. **Handover to developers**: the to-do list says what to fix first, where, and roughly how much work it is.

### How much does a website health report cost?

The Actor uses **pay-per-event** pricing:

| Event | Price | When it is charged |
| --- | --- | --- |
| `page-reported` | **$0.01** per page | One analysed page in the report: all links on it checked, on-page checks, scores, to-dos |
| `pagespeed-audit` | **$0.004** per page × strategy | One successful PageSpeed Insights audit (with your own Google API key) |
| `apify-actor-start` | $0.00005 per run | Automatically at run start (Apify default price) |

**Free:** notice items (no API key, budget too low), failed or skipped PageSpeed audits, pages that could not be loaded. Google API usage is billed by Google, not by this Actor; it is free within Google's quota for your own key.

**Example: a 30-page client site, PageSpeed on mobile for 10 pages**

```
30 pages × $0.01                  = $0.30
10 PageSpeed audits × $0.004      = $0.04
+ 1 Actor start × $0.00005        ≈ $0.00
-----------------------------------------
Total per report                  ≈ $0.34
```

Mobile + desktop PageSpeed for all 30 pages: 30 × ($0.01 + 2 × $0.004) = **$0.54**.

### How to create a website health report

1. Optional but recommended: get a **Google API key**. In Google Cloud Console go to *APIs & Services* → *Credentials* → **Create credentials → API key**, and enable the **PageSpeed Insights API**.
2. Open the Actor, enter the **Website (start URL)** and set **Max pages**.
3. Paste the key into **Google API key** and choose the **PageSpeed strategies**.
4. Optional white label: **Client name**, **Your agency / company name**, **Your logo URL**, **Brand colour**, **Contact line**.
5. Click **Start**. When the run finishes, open **HTML report** or **PDF report** in the *Output* tab.
6. Monthly reports: create an Apify **schedule** with the same input. You can also start it from n8n, Make or Zapier via the API.

### Input example

```json
{
    "startUrl": "https://www.example.org/",
    "maxPages": 30,
    "maxDepth": 2,
    "apiKey": "YOUR_GOOGLE_API_KEY",
    "strategies": ["mobile"],
    "maxPagespeedPages": 10,
    "clientName": "Bakery Miller",
    "agencyName": "Northwind Web Studio",
    "agencyLogoUrl": "https://www.example.org/logo.png",
    "brandColor": "#0E5A8A",
    "contactLine": "hello@northwind.example · northwind.example",
    "generatePdf": true,
    "checkExternalLinks": true,
    "checkResources": true,
    "maxLinksToCheck": 500
}
```

| Input field | Type | Default | Description |
| --- | --- | --- | --- |
| `startUrl` | string | `https://example.com/` | Website to audit. Only pages on this host are crawled. |
| `maxPages` | integer | `20` | Pages to analyse (one `page-reported` event each). Also capped by your *Max total charge*. |
| `maxDepth` | integer | `2` | 0 = start page only, 1 = plus the pages it links to, and so on. |
| `apiKey` | string (secret) | – | Your Google API key for PageSpeed Insights. Without it, PageSpeed is skipped for free. |
| `strategies` | array | `["mobile"]` | `mobile` and/or `desktop` (one `pagespeed-audit` event each per page). |
| `maxPagespeedPages` | integer | `10` | PageSpeed runs for this many pages closest to the start page. `0` = off. |
| `clientName` | string | – | Shown in the report header. |
| `agencyName` | string | – | White label: "Prepared by …". Removes the tool credit. |
| `agencyLogoUrl` | string | – | Public URL of your logo, max 2 MB. PNG/JPEG appear in the HTML and PDF reports; SVG/WebP only in the HTML report. |
| `brandColor` | string | `#1F3A5F` | Header colour (`#RRGGBB`). |
| `contactLine` | string | – | Footer text, for example your e-mail address and website. |
| `reportTitle` | string | `Website Health Report` | Report title. |
| `generatePdf` | boolean | `true` | Also store `report.pdf`. |
| `checkExternalLinks` | boolean | `true` | Check links to other websites (one request each, never crawled). |
| `checkResources` | boolean | `true` | Check images, scripts and stylesheets, and detect mixed content. |
| `maxLinksToCheck` | integer | `500` | Unique links per run, internal first. `0` = no limit. |
| `includeSubdomains` | boolean | `false` | Treat subdomains as internal. |
| `requestTimeoutSecs` | integer | `15` | Timeout per page or link request. |
| `psiTimeoutSecs` | integer | `120` | Timeout per PageSpeed call. |
| `maxRetries` | integer | `2` | Retries for 429, 5xx and network errors, with backoff. |
| `maxConcurrency` / `perHostConcurrency` | integer | `5` / `2` | Parallel requests overall / per host. |

### Output

#### Key-value store

| Key | Content |
| --- | --- |
| `report.html` | The client report (self-contained HTML, print-friendly). |
| `report.pdf` | The same report as an A4 PDF. |
| `OUTPUT` | Summary: health score, grade, category scores, stats, prioritised to-dos, notes, report URLs. |
| `TODOS` | The prioritised to-do list (JSON). |
| `LINKS` | Every checked link with status, HTTP code, redirect target, hops and the pages it was found on. |

#### Dataset: one item per page

Example from a local test run (trimmed):

```json
{
    "type": "page",
    "url": "https://www.example.org/",
    "httpStatus": 200,
    "depth": 0,
    "title": "Home",
    "healthScore": 33,
    "grade": "D",
    "scores": { "performance": 58, "links": 13, "onPage": 19 },
    "pagespeed": {
        "mobile": {
            "status": "ok", "performance": 45, "accessibility": 72, "bestPractices": 92, "seo": 75,
            "lcpMs": 4800, "cls": 0.12, "tbtMs": 720, "fcpMs": 900, "speedIndexMs": 1500, "ttfbMs": 120,
            "fieldCwv": "SLOW", "fieldSource": "psi-url",
            "opportunities": [{ "id": "unused-javascript", "title": "Reduce unused JavaScript", "savingsMs": 1650 }],
            "errorCode": null, "error": null
        }
    },
    "links": {
        "found": 18, "checked": 17, "broken": 6, "redirected": 1,
        "brokenLinks": [{ "url": "https://www.example.org/missing", "status": "broken", "httpStatus": 404, "internal": true, "error": "HTTP 404" }],
        "redirects": [{ "url": "https://www.example.org/chain-1", "finalUrl": "https://www.example.org/ok", "redirectCount": 3, "internal": true }]
    },
    "onPage": { "title": "Home", "titleLength": 4, "metaDescription": null, "h1Count": 1, "canonical": null, "lang": null, "hasViewport": false, "noindex": false, "imagesTotal": 2, "imagesWithoutAlt": 1, "wordCount": 29, "issues": ["TITLE_TOO_SHORT", "MISSING_META_DESCRIPTION", "MISSING_VIEWPORT"] },
    "issues": [
        { "code": "BROKEN_INTERNAL_LINK", "detail": "https://www.example.org/missing (HTTP 404)" },
        { "code": "REDIRECT_CHAIN", "detail": "https://www.example.org/chain-1 → https://www.example.org/ok (3 hops)" }
    ],
    "issueCount": 28,
    "checkedAt": "2026-10-26T17:23:23.209Z"
}
```

Without a Google API key, the dataset also has one **free notice item**:

```json
{ "type": "notice", "url": "https://example.com/", "status": "skipped_no_api_key", "errorCode": "API_KEY_REQUIRED", "message": "PageSpeed Insights skipped (not charged): no Google API key provided … Links and on-page SEO were checked. Add your own free key in the \"Google API key\" field …" }
```

#### To-do example (from `OUTPUT.todos`)

```json
{ "rank": 2, "code": "BROKEN_INTERNAL_LINK", "priority": 1, "priorityLabel": "High", "category": "links", "effort": "low",
  "title": "Broken internal links", "fix": "Fix the link target or restore the page; add a 301 redirect if the page has moved.",
  "affectedPages": 2, "occurrences": 7, "examples": [{ "page": "https://www.example.org/", "detail": "https://www.example.org/missing (HTTP 404)" }] }
```

#### How the scores work

- **Performance** = average PageSpeed performance score of the measured strategies. Pages without PageSpeed data have no performance score.
- **Links** = 100 minus 15 per high-priority link issue (broken internal link, loop, mixed content, https→http), 6 per medium issue (broken external link, chain) and 2 per low issue on that page.
- **On-page SEO** = 100 minus 25 / 10 / 4 per distinct high / medium / low on-page issue.
- **Health score** = 40% performance + 30% links + 30% on-page. Missing categories are left out and the weights re-normalised. A ≥ 90, B ≥ 75, C ≥ 50, D < 50.

### Integrations and API

Start a report from your own tools and download the PDF:

```bash
curl -X POST "https://api.apify.com/v2/acts/grace_hartwell~website-health-report/runs?token=[YOUR_APIFY_TOKEN]&waitForFinish=300" \
  -H "Content-Type: application/json" \
  -d '{"startUrl":"https://www.example.org/","maxPages":20,"apiKey":"YOUR_GOOGLE_API_KEY","agencyName":"Northwind Web Studio"}'
## then: GET https://api.apify.com/v2/key-value-stores/[defaultKeyValueStoreId]/records/report.pdf
```

```js
import { ApifyClient } from 'apify-client';

const client = new ApifyClient({ token: process.env.APIFY_TOKEN });
const run = await client.actor('grace_hartwell/website-health-report').call({ startUrl: 'https://www.example.org/', apiKey: process.env.PSI_KEY, agencyName: 'Northwind Web Studio' });
const store = client.keyValueStore(run.defaultKeyValueStoreId);
const summary = (await store.getRecord('OUTPUT')).value; // healthScore, todos, stats …
const pdf = (await store.getRecord('report.pdf', { buffer: true })).value; // Buffer
```

Works with Apify schedules, webhooks and integrations (Make, Zapier, n8n, Google Sheets exports).

### FAQ

#### Do I need a Google API key?

For speed scores and Core Web Vitals, yes. Google currently allows almost no PageSpeed Insights requests without a key. The key is free (Google Cloud Console → APIs & Services → Credentials, enable "PageSpeed Insights API"). Without a key, the report still covers links and on-page SEO, PageSpeed is not charged, and the report says so clearly.

#### Is the report really white-label?

Yes. When you set an agency name or logo, the HTML and PDF show "Prepared by \[your agency]" and your contact line, with no tool credit or Hartwell branding. Without white-label fields, the footer shows a small "Generated with Website Health Report" credit.

#### Why does PageSpeed run only for some pages?

PageSpeed audits take 10–60 seconds each. `maxPagespeedPages` (default 10) picks the pages closest to the start page: home page, main navigation and so on. Raise it if you need speed data for every page.

#### Why is a link that works in my browser reported as 401/403?

Some sites block non-browser clients or need a login. External 401/403 links are reported as a low-priority "check manually" to-do, not as broken.

#### Does it render JavaScript?

No. Pages are fetched as HTML without a browser, so links and tags added only by client-side JavaScript are not seen. PageSpeed Insights itself does render the page in Google's Lighthouse.

#### How do I keep the cost under control?

Use `maxPages`, `maxPagespeedPages`, `strategies` and a *Max total charge*. The Actor sizes the crawl to your budget before it starts and stops cleanly; skipped work is free.

#### Can I audit any website?

Only audit websites you own or have permission to test. The Actor is polite (robots.txt, low per-host concurrency, rate limit) and only reads public pages. It does not log in, submit forms or collect personal data.

### Limitations: what this Actor does not do

- **No JavaScript rendering** for the crawl and on-page checks (PageSpeed data comes from Google's Lighthouse).
- **No logins, forms or bot-protection bypass.** Protected pages may show up as 401/403.
- **Not a full SEO suite**: no keyword rankings, backlinks, structured-data validation or content analysis. The checks are the technical basics that matter in a monthly client report.
- **PageSpeed lab data varies** from run to run. Real-user (CrUX) data reflects the last 28 days and exists only for sites with enough traffic.
- **The report is in English.** The texts in the dataset are English too; codes (`BROKEN_INTERNAL_LINK` and so on) are stable for your own templates.
- **PDF logos must be PNG or JPEG**; SVG/WebP logos appear only in the HTML report.
- **Pages are discovered by following links** from the start URL (no sitemap import), within `maxDepth` and `maxPages`.

***

Author: Grace M. Hartwell · Hartwell Toolworks

# Actor input Schema

## `startUrl` (type: `string`):

The website to audit, e.g. https://example.com/. Only pages on this host are crawled. Audit only sites you own or are allowed to test.

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

Internal HTML pages to analyse (each one is a 'page analysed' event). Also capped by your 'Max total charge'.

## `maxDepth` (type: `integer`):

0 = only the start page, 1 = start page + pages it links to, …

## `apiKey` (type: `string`):

Your own free Google Cloud API key with the 'PageSpeed Insights API' enabled. Stored encrypted by Apify; never logged. Without a key, Google allows (almost) no PageSpeed requests: speed scores are then skipped (free) and the report covers links and on-page SEO.

## `strategies` (type: `array`):

mobile and/or desktop. Each strategy is one 'PageSpeed audit' event per page.

## `maxPagespeedPages` (type: `integer`):

PageSpeed Insights runs for this many pages closest to the start page (10–60 s each). 0 = no PageSpeed.

## `clientName` (type: `string`):

Shown in the report header, e.g. 'Bakery Miller'.

## `agencyName` (type: `string`):

White label: shown as 'Prepared by …'. When set (or a logo is set), the report shows no tool credit.

## `agencyLogoUrl` (type: `string`):

Public https URL of your logo (PNG or JPEG for the PDF; SVG/WebP only in the HTML report). Max 2 MB.

## `brandColor` (type: `string`):

Header colour as hex, e.g. #1F3A5F.

## `contactLine` (type: `string`):

e.g. 'hello@youragency.com · youragency.com'. Shown in the report footer.

## `reportTitle` (type: `string`):

Default: 'Website Health Report'.

## `generatePdf` (type: `boolean`):

Store report.pdf next to report.html in the key-value store.

## `checkExternalLinks` (type: `boolean`):

Also check links to other websites (one HEAD/GET request each, never crawled).

## `checkResources` (type: `boolean`):

Also check sub-resources and detect mixed content (http resources on https pages).

## `maxLinksToCheck` (type: `integer`):

Unique links checked per run (internal first). 0 = no limit.

## `includeSubdomains` (type: `boolean`):

Crawl blog.example.com when starting at example.com.

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

A link that does not answer in this time is reported as timeout.

## `psiTimeoutSecs` (type: `integer`):

PageSpeed Insights audits usually take 10–60 s.

## `maxRetries` (type: `integer`):

With exponential backoff (Retry-After is honoured for PageSpeed).

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

Parallel crawl requests (link checks use up to 2×, never more than 'per host' on one host).

## `perHostConcurrency` (type: `integer`):

Keeps the load on each website low.

## Actor input object example

```json
{
  "startUrl": "https://example.com/",
  "maxPages": 20,
  "maxDepth": 2,
  "strategies": [
    "mobile"
  ],
  "maxPagespeedPages": 10,
  "brandColor": "#1F3A5F",
  "generatePdf": true,
  "checkExternalLinks": true,
  "checkResources": true,
  "maxLinksToCheck": 500,
  "includeSubdomains": false,
  "requestTimeoutSecs": 15,
  "psiTimeoutSecs": 120,
  "maxRetries": 2,
  "maxConcurrency": 5,
  "perHostConcurrency": 2
}
```

# Actor output Schema

## `reportHtml` (type: `string`):

No description

## `reportPdf` (type: `string`):

No description

## `pages` (type: `string`):

No description

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

No description

# 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 = {
    "startUrl": "https://example.com/"
};

// Run the Actor and wait for it to finish
const run = await client.actor("grace_hartwell/website-health-report").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 = { "startUrl": "https://example.com/" }

# Run the Actor and wait for it to finish
run = client.actor("grace_hartwell/website-health-report").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 '{
  "startUrl": "https://example.com/"
}' |
apify call grace_hartwell/website-health-report --silent --output-dataset

```

## MCP server setup

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

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/ueHFoCRQhZxkF4mis/builds/eevm6mCeRRfX8ilj1/openapi.json
