# Website SEO Audit & Broken Link Checker (`alsadadigital/seo-audit-broken-link-checker`) Actor

Audit a whole website in one run: a 0 to 100 score for every page with the reasons, every link checked, redirect chains, sitemap gaps and a readable report. Plain web requests, no browser.

- **URL**: https://apify.com/alsadadigital/seo-audit-broken-link-checker.md
- **Developed by:** [Alsada Digital](https://apify.com/alsadadigital) (community)
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

$5.00 / 1,000 audited pages

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 SEO Audit & Broken Link Checker

Audit a whole website in one run. You get a **0 to 100 score for every page with the reasons behind it**, a check of **every link on every audited page**, the redirect chains, the gaps between your sitemap and your real pages, and a **readable report** you can pass on to a client.

It uses plain web requests, with no browser. That keeps a run quick and the price per page low.

### What you get

| Output | Where | What it holds |
| --- | --- | --- |
| Pages | Dataset | One row per audited page: score, issues, title, description, headings, word count, links, broken links |
| Readable report | Key-value store, `REPORT.html` | One page for people: scores, issues with the most pages affected first, broken links, redirect chains, sitemap gaps |
| Site summary | Key-value store, `SUMMARY` | The same facts as data (JSON), one block per website |
| Broken links | Key-value store, `BROKEN_LINKS` and `BROKEN_LINKS.csv` | Each broken address once, with the pages it sits on |

### What it checks on every page

- **Title and meta description:** missing, too short, too long, or the same as on another page
- **Main heading (h1):** missing, or more than one
- **Indexing:** `noindex` in the page or in the `X-Robots-Tag` header, and the canonical link (missing, or pointing to another address)
- **Links:** every link on the page, inside and outside the website. Each address is checked once per run
- **Redirects:** links that redirect, chains of two or more redirects, and redirect loops
- **Images:** how many have no `alt` attribute (an empty `alt=""` counts as a valid choice for a decorative image)
- **Content:** word count of the visible text
- **Social sharing and structured data:** Open Graph title, description and image; JSON-LD and microdata types
- **Basics:** https, mixed content, viewport tag, language attribute, server answer time, HTML size

### What it checks across the website

- Issues ranked by the number of pages affected, most first
- All broken links, with every page each one sits on
- Pages in the sitemap that no audited page links to
- Linked pages that are missing from the sitemap
- `noindex` pages that are listed in the sitemap
- Addresses left alone because `robots.txt` disallows them

### How to use it

1. Enter one or more website addresses under **Websites to audit**.
2. Set **Pages per website (limit)**. The default is 50.
3. Press **Start**.
4. Open the **Output** tab. The readable report is the `REPORT.html` link.

### Input

| Field | Default | Meaning |
| --- | --- | --- |
| `startUrls` | (required) | One address per website. The audit stays on that website. Up to 20 websites per run |
| `maxPagesPerSite` | 50 | The audit stops after this many pages on each website. Up to 1,000 per website and 3,000 per run |
| `checkExternalLinks` | true | Also check links that point to other websites |
| `respectRobotsTxt` | true | Do not request addresses that `robots.txt` disallows |
| `useSitemap` | true | Read the sitemap to find pages and to compare it with the linked pages |
| `maxConcurrency` | 5 | Pages loaded at the same time. Lower it for a small or slow website |
| `linkCheckTimeoutSecs` | 15 | Seconds to wait for a link before listing it as "could not be verified" |

```json
{
    "startUrls": [{ "url": "https://www.example.com" }],
    "maxPagesPerSite": 100,
    "checkExternalLinks": true
}
```

### Output: one page row

This row is shortened. Field names are exact.

```json
{
    "url": "https://www.example.com/blog",
    "site": "example.com",
    "score": 85,
    "statusCode": 200,
    "indexability": "indexable",
    "title": "Blog",
    "titleLength": 4,
    "metaDescription": "News and guides from the Example team, with a new post every week.",
    "h1": "Blog",
    "h1Count": 1,
    "canonical": "https://www.example.com/blog",
    "wordCount": 344,
    "images": 6,
    "imagesMissingAlt": 0,
    "internalLinks": 42,
    "externalLinks": 3,
    "brokenLinks": 3,
    "brokenLinkDetails": [
        { "url": "https://www.example.com/missing-page", "reason": "status 404", "type": "internal", "linkText": "Old guide" },
        { "url": "https://www.example.com/loop-a", "reason": "redirect loop", "type": "internal", "linkText": "Offers" },
        { "url": "https://other.example.org/gone", "reason": "status 404", "type": "external", "linkText": "Partner" }
    ],
    "unverifiedLinks": 1,
    "redirectingLinks": 1,
    "redirectChainLinks": 1,
    "linkedFromPages": 12,
    "inSitemap": true,
    "clicksFromStart": 1,
    "responseTimeMs": 212,
    "htmlBytes": 48213,
    "issueCodes": ["broken_links", "title_too_short", "redirect_chain_links", "links_to_redirects"],
    "issues": [
        { "code": "broken_links", "severity": "error", "pointsLost": 9, "message": "3 broken links on this page" },
        { "code": "title_too_short", "severity": "warning", "pointsLost": 3, "message": "Title has 4 characters" },
        { "code": "redirect_chain_links", "severity": "warning", "pointsLost": 2, "message": "1 link passes through two or more redirects" },
        { "code": "links_to_redirects", "severity": "notice", "pointsLost": 1, "message": "1 link points to an address that redirects" }
    ]
}
```

`clicksFromStart` is the number of clicks from the start address. It is empty for a page that was found only through the sitemap.

### How the score works

Every page starts at 100 and loses points for each issue. The score never goes below 0. The lengths and limits are common search engine optimisation (SEO) guidelines. They are not rules published by a search engine.

| Issue | Level | Points lost |
| --- | --- | --- |
| Missing title tag | error | 15 |
| Broken links on the page | error | 3 for each, 15 at most |
| Secure page loads files over plain http (mixed content) | error | 8 |
| Missing meta description | warning | 8 |
| Missing main heading (h1) | warning | 8 |
| Title used on more than one page | warning | 6 |
| Images without alt text | warning | 1 to 6, by the share of images affected |
| Page not served over https | warning | 5 |
| Missing viewport tag | warning | 5 |
| Meta description used on more than one page | warning | 4 |
| Title longer than 60 or shorter than 10 characters | warning | 3 |
| Server took more than 2 seconds to answer | warning | 3 |
| Links that pass through two or more redirects | warning | 2 |
| Missing canonical link | notice | 4 |
| Fewer than 200 words of text | notice | 4 |
| More than one main heading (h1) | notice | 3 |
| Meta description longer than 160 or shorter than 50 characters | notice | 2 |
| Missing Open Graph title, description or image | notice | 2 |
| HTML larger than 1 megabyte | notice | 2 |
| Links to addresses that redirect | notice | 1 |
| Missing language attribute | notice | 1 |
| `noindex`, canonical link to another address, no structured data | notice | 0 (listed, no points lost) |

Duplicate titles and descriptions are compared between indexable pages only.

### Broken, or "could not be verified"

A link is listed as **broken** only when it is clearly dead:

- status 404 or 410
- status 500 or 501
- a domain that does not exist, a refused connection or a security certificate error
- a redirect loop, more than 10 redirects in a row, or a redirect to an invalid address

Some websites refuse automated visits, answer too slowly or have a passing fault. Every other status that is not a success is listed as **could not be verified**. That covers 401, 403 and 429, the gateway errors 502, 503 and 504, the 52x codes of content networks, LinkedIn's 999, and timeouts. These links do not count as broken and take no points off the score.

If a link could not be verified but its page was then loaded and audited in the same run, it is taken off that list.

### What it does not do

- **It does not run scripts.** It reads the HTML the server sends. Content and links that appear only after scripts run in the browser are not seen. For a website built that way, the audit covers little.
- **No page-speed lab scores.** The server answer time is measured from Apify's servers. It is not a Core Web Vitals or Lighthouse result.
- **Not an accessibility audit.** Image alt text is the only accessibility-related check.
- **No keyword, ranking or backlink data.**
- **Links are `<a href>` links.** Image, script and style files are not checked for errors.
- The word count splits text on spaces, so it undercounts languages written without spaces, such as Chinese and Japanese.

### Cost

You pay per audited page. One page is one row in the dataset. The current price is shown on this page. Checking the links on a page is included in the page price.

**Pages per website (limit)** caps your cost: the audit never covers more pages than that on one website. With several websites in one run, the most you can pay is the limit times the number of websites. If you also set a maximum cost for the run in Apify, the audit stops at the number of pages that limit allows.

A run that cannot audit any page saves no rows, so no page is charged. The run's status message says why.

### Good to know

- **robots.txt:** with the default setting, disallowed addresses on the audited website are not audited and not link-checked. They are listed in the summary. Each origin has its own rules, so `example.com` and `www.example.com` are each checked against their own robots.txt. One exception: when the start address or a sitemap address redirects into a disallowed path, that one request has already been made by the time the tool sees where it leads. The page is then left out.
- **Other websites:** each outside address gets a light request (HEAD, then GET if the server refuses HEAD or answers with an error). A redirect is followed step by step, for up to 10 steps. At most 4 requests run at a time per website.
- **Page order:** the start address first, then pages found by following links, nearest first. Sitemap pages that no link reaches fill the remaining room.
- **Limits and partial audits:** when the page limit stops the audit, the summary says so (`crawl.complete` is `false`) and shows how many pages were found but not audited. The list "in the sitemap, not linked" is then marked as possibly incomplete.
- **Results arrive at the end of the run**, because some checks compare pages with each other. If you abort a run, nothing is saved and no page is charged. If a run nears its time limit, the audit stops about a minute before the limit and saves what it has.
- **Safety limit on link checks:** a run checks at most 100 addresses for each page it may audit, and the limit is never set below 2,000. Links beyond it are counted in the summary as not checked. Most websites stay far below it.
- **A start address that redirects to another website** is not followed. The run tells you where it leads, so you can start from there.
- **Tracking parameters** such as `utm_source` and `fbclid` are removed from addresses, so the same page is not audited twice.
- **Large websites:** one run audits up to 1,000 pages of a website, starting from the start address. The tool cannot be limited to one section of a website, and a second start address on the same website is ignored.

### Questions and problems

Use the **Issues** tab of this Actor. Please include the run link.

# Actor input Schema

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

One address per website, for example https://example.com. The audit starts there and stays on that website. Up to 20 websites per run.

## `maxPagesPerSite` (type: `integer`):

The audit stops after this many pages on each website. You pay per audited page, so this is also your cost limit for each website. Up to 1,000 per website and 3,000 per run.

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

When on, links that point to other websites are checked too. Each address gets one light request. Turn it off for a faster run that checks only links inside the website.

## `respectRobotsTxt` (type: `boolean`):

When on, addresses that the website's robots.txt disallows are not requested. They are listed in the summary. Turn it off only for a website you own.

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

When on, the sitemap is read to find pages and to compare it with the pages that are linked.

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

Lower it for a small or slow website. The highest value is 20.

## `linkCheckTimeoutSecs` (type: `integer`):

A link that does not answer in this time is listed as "could not be verified", not as broken.

## Actor input object example

```json
{
  "startUrls": [
    {
      "url": "https://books.toscrape.com/"
    }
  ],
  "maxPagesPerSite": 15,
  "checkExternalLinks": true,
  "respectRobotsTxt": true,
  "useSitemap": true,
  "maxConcurrency": 5,
  "linkCheckTimeoutSecs": 15
}
```

# Actor output Schema

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

No description

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

No description

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

No description

## `brokenLinks` (type: `string`):

No description

## `brokenLinksCsv` (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://books.toscrape.com/"
        }
    ],
    "maxPagesPerSite": 15
};

// Run the Actor and wait for it to finish
const run = await client.actor("alsadadigital/seo-audit-broken-link-checker").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://books.toscrape.com/" }],
    "maxPagesPerSite": 15,
}

# Run the Actor and wait for it to finish
run = client.actor("alsadadigital/seo-audit-broken-link-checker").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://books.toscrape.com/"
    }
  ],
  "maxPagesPerSite": 15
}' |
apify call alsadadigital/seo-audit-broken-link-checker --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,alsadadigital/seo-audit-broken-link-checker"
        }
    }
}
```

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/cKfuVXFuzVNWkDZq1/builds/FE3UU1vVHfaBdNpgp/openapi.json
