# Website Health Audit: Broken Links, SEO & Speed (`datalantern/website-health-audit`) Actor

Audit any website for broken links, redirect chains, missing titles and meta descriptions, H1, canonical, noindex, image alt text, page size and response time, with a health score per page and site.

- **URL**: https://apify.com/datalantern/website-health-audit.md
- **Developed by:** [Data Lantern](https://apify.com/datalantern) (community)
- **Categories:** SEO tools, Developer tools, Automation
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

Pay per event

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 Audit: Broken Links, SEO & Speed

**Website Health Audit** crawls a website and checks every page for broken links, redirect chains, HTTP errors, missing or too-long titles and meta descriptions, missing or duplicate H1s, canonical and noindex tags, images without alt text, mixed content, page size, and response time. Each page gets a health score and a list of issues, and each website gets a summary with issue counts, so you can fix what matters first. Add your own free Google API key to include PageSpeed Insights performance scores.

### What can this tool do?

- Crawl a website within its own domain, following links and its XML sitemap, and respecting robots.txt.
- Find broken internal links (404, 410, 5xx, dead domains), and optionally broken external links.
- Record redirect chains, for example `301 http://… → https://…`.
- Check on-page SEO: title and meta description length, H1 count, canonical URL, noindex, language, image alt text.
- Measure response time and page size, and flag slow or heavy pages and mixed (http) content on https pages.
- Score every page from 0 to 100 and summarise each website with issue counts by type.
- Add mobile PageSpeed Insights results (performance score, LCP, CLS, TBT) with your own Google API key.

### What data does it return?

One row per audited page (`rowType: page`) plus one summary row per website (`rowType: site`). Example values from a real run of the default input (apify.com, 10 pages):

| Field | Page row example | Site row example |
|---|---|---|
| `rowType` | page | site |
| `site` | https://apify.com/ | https://apify.com/ |
| `url` | https://apify.com/actors | https://apify.com |
| `status` | 200 | null |
| `redirectChain` | \[] | \[] |
| `responseTimeMs` | 69 | 246 (average) |
| `sizeKb` | 377.3 | null |
| `title` | Automate anything with Apify Actors · Apify | null |
| `titleLength` | 43 | null |
| `metaDescriptionLength` | 187 | null |
| `h1Count` | 1 | null |
| `canonical` | https://apify.com/actors | null |
| `noindex` | false | null |
| `imagesMissingAlt` | 0 | null |
| `brokenLinks` | \[] | \[] (all broken links found on the site) |
| `brokenLinksCount` | 0 | 0 |
| `issues` | \["meta-description-too-long"] | \["meta-description-too-long"] |
| `pageScore` | 97 | null |
| `score` | null | 99 |
| `issuesByType` | null | {"meta-description-too-long": 3} |
| `pagesAudited` | null | 10 |
| `performanceScore`, `lcpMs`, `cls`, `tbtMs` | null (filled on the start page when a PageSpeed key is given) | null |
| `error` | null | null |

Other fields: `finalUrl`, `metaDescription`, `h1`, `lang`, `imagesTotal`, `internalLinksCount`, `externalLinksCount`. Every row has the same fields; values that do not apply are `null`. Each broken link is listed as `{"url", "status", "error"}`.

**Issue codes:** `http-error`, `broken-links`, `missing-title`, `title-too-long` (over 60 characters), `title-too-short`, `duplicate-title`, `missing-meta-description`, `meta-description-too-long` (over 160), `meta-description-too-short`, `missing-h1`, `multiple-h1`, `missing-canonical`, `canonical-to-other-page`, `noindex`, `images-missing-alt`, `missing-lang`, `redirect-chain` (two or more redirects), `slow-response` (over 3 s), `large-page` (over 3 MB), `not-https`, `mixed-content`.

### How to use it

1. Enter one or more websites and the maximum number of pages to audit per website.
2. Optionally turn on external link checks and add your Google PageSpeed API key.
3. Click **Start**, then open the **Site summaries** view or download all rows as CSV, Excel, or JSON.

### Pricing

Pay per audited page: **$4.00 per 1,000 pages**, plus $0.005 per run. Link checks on each page are included, and the per-site summary rows are free. Websites that block the audit are listed with the reason and not charged. Set a maximum cost per run in the run options.

### Use it through the API, AI agents, and integrations

Schedule a weekly audit to catch new broken links, call it from your code with the Apify API, or connect it to Make, Zapier, n8n, Slack, Google Sheets, or an AI agent through Apify's MCP server.

### Is it legal?

This tool visits public pages the way a search-engine crawler does: slowly (two requests at a time per website), within the website's own domain, and following its robots.txt rules. It does not log in, bypass access controls, or collect personal information. Audit your own websites or websites you have permission to audit.

### FAQ

**Why are some links not reported as broken even though they fail in the tool?** Many websites (for example social networks) refuse automated requests with 401, 403, or 429 codes while working fine in a browser. Those are not counted as broken; only 404, 410, server errors, and dead domains are.

**How do I get a PageSpeed API key?** In Google Cloud Console, create a project, enable the **PageSpeed Insights API**, and create an API key under **APIs & Services → Credentials**. The free quota is enough for daily audits. The key is stored as a secret input.

**Why did the audit stop before the page limit?** The website has fewer reachable pages than the limit, robots.txt blocks the rest, or the pages are not linked. Turn on **Use the sitemap** to include pages listed only in the sitemap.

### Feedback

Found a bug or need another check? Open an issue on the **Issues** tab. We usually respond within 24 hours.

# Actor input Schema

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

One or more websites to audit. Each is crawled from this page, within the same domain, following robots.txt.

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

How many pages to audit on each website. Links on these pages are checked too.

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

Also check links that point to other websites (slower). Internal links are always checked.

## `useSitemap` (type: `boolean`):

Add pages from the website's XML sitemap to the crawl, so pages that are not linked from the home page are audited too.

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

Optional. Your own free Google API key with the PageSpeed Insights API enabled. Adds mobile performance score, LCP, CLS and TBT for each website's start page.

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

Optional. Use if a website blocks cloud servers.

## Actor input object example

```json
{
  "startUrls": [
    {
      "url": "https://apify.com"
    }
  ],
  "maxPages": 10,
  "checkExternalLinks": false,
  "useSitemap": true
}
```

# Actor output Schema

## `results` (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://apify.com"
        }
    ],
    "maxPages": 10
};

// Run the Actor and wait for it to finish
const run = await client.actor("datalantern/website-health-audit").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://apify.com" }],
    "maxPages": 10,
}

# Run the Actor and wait for it to finish
run = client.actor("datalantern/website-health-audit").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://apify.com"
    }
  ],
  "maxPages": 10
}' |
apify call datalantern/website-health-audit --silent --output-dataset

```

## MCP server setup

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

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/akehwArUhM3SuA9hv/builds/QDSJiCszaTWaJKfIl/openapi.json
