# Website Health Check - Broken Link Checker (`faglez/website-health-check`) Actor

Find broken links, server errors, redirect chains and loops, and sitemap problems on any website, with an HTML report. Pages come from the sitemap; links on each page are checked too.

- **URL**: https://apify.com/faglez/website-health-check.md
- **Developed by:** [Chaseb Gonzalez](https://apify.com/faglez) (community)
- **Categories:** SEO tools, Developer tools, Automation
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $1.00 / 1,000 address checkeds

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

## Website Health Check

Find what's broken on a website in one run: broken links, pages that answer with errors, redirect chains and loops, temporary redirects that should be permanent, and sitemaps that list the wrong addresses. You get a readable **HTML report** with a health score, and every checked address in a table you can download as Excel, CSV or JSON.

Enter a website, and the Actor finds its pages in the sitemap, checks each page, reads the links on it and checks those too. No browser, so it's fast and cheap.

### What does it do?

- **Finds the pages for you** from the website's sitemaps (via `robots.txt` or the usual sitemap addresses). No sitemap? It starts from the home page.
- **Checks every page and every link on it**, internal and external, following each redirect hop by hop.
- **Reports each problem with a severity and where it was found:**
  - **Errors:** broken (404 and other 4xx), server errors (5xx), unreachable addresses, redirect loops, too many redirects.
  - **Warnings:** redirect chains (2+ hops), temporary redirects (302/307) on your own website, and redirects listed in your sitemap.
  - **Notices:** links on your pages that point to an address that redirects.
- **A health report** (HTML, ready to open or forward to a client) with a score from 0 to 100, counts per issue, and the problem list with the page each broken link was found on.
- **Polite and safe:** at most 2 requests at a time per website, retries on temporary errors, follows `robots.txt`, limits on pages and links so a big website never surprises you.

### Who uses it?

- **Website owners and small businesses:** a monthly check-up that catches broken links before customers or Google do.
- **SEO consultants and agencies:** a quick technical audit for a new client, with a shareable HTML report.
- **Developers and QA:** run it after each release to catch pages and links that broke.
- **Site migrations:** after moving a website, find old links that now go nowhere and redirect chains to clean up.
- **Content teams:** find outside links in old blog posts that died over the years.

### How to use it

1. Enter one or more websites, for example `https://example.com`.
2. Optional: set **Maximum pages per website** and **Maximum links per website**, turn off **Check links to other websites**, or turn on **Only save problems**.
3. Click **Start**. When the run finishes, open **Health report (HTML)** in the Output tab, or download the table as Excel, CSV or JSON.
4. To keep an eye on a website, create a **Schedule** (for example every Monday) and get the report each week.

#### Input example

```json
{
    "startUrls": [{ "url": "https://crawlee.dev" }],
    "maxPages": 10,
    "maxLinks": 30
}
```

#### Output example

A real problem found by the input above: a link on the blog page to an outside website that answered with a server error.

```json
{
    "website": "https://crawlee.dev",
    "url": "https://github.com/fingerprintjs/BotD",
    "type": "link",
    "inSitemap": false,
    "foundOn": ["https://crawlee.dev/blog"],
    "issue": "server-error",
    "severity": "error",
    "outcome": "server-error",
    "statusCode": 504,
    "finalUrl": "https://github.com/fingerprintjs/BotD",
    "finalStatusCode": 504,
    "redirectCount": 0,
    "redirectChain": [{ "url": "https://github.com/fingerprintjs/BotD", "statusCode": 504, "redirectTo": null }],
    "error": null,
    "responseTimeMs": 968,
    "checkedAt": "2026-11-09T07:52:51.352Z"
}
```

Addresses without a problem have `issue` and `severity` set to `null`. `type` is `page` for addresses from the sitemap (or the home page) and `link` for links found on those pages. `foundOn` lists up to 5 pages that contain the link, so you know where to fix it.

The run also saves:

- **REPORT**: the HTML health report, one section per website.
- **SUMMARY**: the same report as JSON (pages in sitemaps, pages and links checked, counts per issue, health score and the problem list), handy for dashboards and automations.

### Use it from the API or an AI agent

- **AI agents:** connect your AI assistant to the [Apify MCP server](https://mcp.apify.com) and it can find and run this Actor on its own. The Actor's ID is `faglez/website-health-check`.
- **API:** start a run with your input, then read the dataset, or the `REPORT` and `SUMMARY` records from the run's key-value store. The Apify clients for JavaScript and Python make this a few lines of code.
- **No code:** set up schedules, webhooks and integrations (Make, Zapier, Slack, Google Drive and more) from the Actor's Integrations tab.

### How much does it cost?

You pay for each address checked (pages and links), plus a small fee per saved row.

| Event | Price |
| --- | --- |
| Each address checked | $1.00 per 1,000 addresses |
| Each row saved to the table | $0.10 per 1,000 rows |
| Actor start | $0.001 per run |

Example: checking 10,000 addresses (for example 2,000 pages and 8,000 links) costs about $11 with every address saved, or about $10 with **Only save problems** on. Set the page and link limits, or a maximum cost per run, and the Actor stops cleanly at your limit with a report of what it checked.

### Tips

- **Start small:** check 20 pages and 100 links first to see the report, then raise the limits.
- **Only your own links:** turn off **Check links to other websites** for a faster, internal-only check.
- **Only the problems:** turn on **Only save problems** to keep the table short. The report always shows the totals.
- **Weekly monitoring:** schedule a run and send the report link to Slack or email through the Integrations tab.
- **SEO too?** This Actor checks links and errors. To check titles, meta descriptions, H1s, canonicals and noindex on every page, run the [On-Page SEO Audit](https://apify.com/faglez/on-page-seo-audit) on the same website.

### Questions

**Why is a link reported as a server error when it opens fine for me?** Server errors (5xx) and timeouts can be temporary, for example when the other website is overloaded. The Actor already retries them twice. If a problem disappears in the next run, it was temporary.

**Does it check every page of a big website?** It checks up to **Maximum pages per website** pages, in sitemap order, but the report counts every page the sitemaps list. Raise the limit to check more.

**Some links were not checked. Why?** Links that the target website's `robots.txt` asks tools not to visit are skipped and counted in the report, as are links over **Maximum links per website**.

**Does it run JavaScript or log in?** No. It checks public addresses the way a simple browser request would, without running page scripts or logging in.

**Is it allowed?** The Actor reads only the response headers of each address (plus the HTML of your own pages to find their links), at most 2 at a time per website, and respects `robots.txt`. Only check websites you own or have permission to audit, or public pages in a reasonable amount.

**Which pages are checked?** The address you enter is checked first (for example `https://example.com/en.html`), then the pages from the website's sitemaps, up to **Maximum pages per website**. The links on every page are checked too.

**Why is an address marked "Could not be checked"?** The server refused the check: HTTP 401 or 403 (a bot firewall or a login page), a bot challenge, or 429 "Too Many Requests" even after waiting the time the server asked for. Some websites refuse automated tools while letting browsers in, so these are not counted as broken, do not lower the health score and are not charged. Open them once in a browser to be sure. A 404 or 410 means the page really does not exist and is reported as broken.

**Can I run it every week?** Yes. Add a schedule (Schedules > Create) with your website, and turn on **Only save problems** so each run lists only what needs fixing. Connect an integration (email, Slack, Google Sheets) to receive the results.

**Found a bug or need a feature?** Open an issue in the Issues tab and I will look into it.

# Changelog

This Actor's version history is a separate document: https://apify.com/faglez/website-health-check/changelog.md

# Actor input Schema

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

The websites to check, for example https://example.com. Only the website part of each address is used. For long lists, link a text file with one website per line.

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

Check at most this many pages from each website's sitemaps (the first ones listed). The report still counts every page the sitemaps list.

## `checkLinks` (type: `boolean`):

Read each checked page and check the links on it too. This finds broken links on your pages, not only broken pages. Turn off to check only the sitemap pages.

## `maxLinks` (type: `integer`):

Check at most this many different links per website (on top of the pages). Links already checked as pages are not counted twice.

## `includeExternalLinks` (type: `boolean`):

Also check links that lead to other websites (for example partners or sources). Turn off to check only links within the website.

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

Save only the addresses with a problem in the results. Off (default): every checked address is saved, with its status, so you have the full picture.

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

How long to wait for an answer before counting an address as unreachable (after 2 retries).

## Actor input object example

```json
{
  "startUrls": [
    {
      "url": "https://crawlee.dev"
    }
  ],
  "maxPages": 10,
  "checkLinks": true,
  "maxLinks": 30,
  "includeExternalLinks": true,
  "onlyProblems": false,
  "requestTimeoutSecs": 15
}
```

# Actor output Schema

## `report` (type: `string`):

No description

## `results` (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 = {
    "startUrls": [
        {
            "url": "https://crawlee.dev"
        }
    ],
    "maxPages": 10,
    "maxLinks": 30
};

// Run the Actor and wait for it to finish
const run = await client.actor("faglez/website-health-check").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": [{ "url": "https://crawlee.dev" }],
    "maxPages": 10,
    "maxLinks": 30,
}

# Run the Actor and wait for it to finish
run = client.actor("faglez/website-health-check").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": [
    {
      "url": "https://crawlee.dev"
    }
  ],
  "maxPages": 10,
  "maxLinks": 30
}' |
apify call faglez/website-health-check --silent --output-dataset

```

## MCP server setup

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

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/QQsLsKbfmU0uOW10X/builds/aoX7LGJslOqLccoqs/openapi.json
