# Website SEO & Broken Link Audit (`opstoolkit/site-seo-link-audit`) Actor

Audit your own website from its sitemap or by crawling it. One row per page: status, title and meta description length, H1, canonical, noindex, alt text, word count, response time and every broken link on the page. Ends with an HTML report you can send to a client.

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

## Pricing

from $3.00 / 1,000 page auditeds

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

Give it a website and it audits every page from the sitemap: titles, meta descriptions, H1, canonical, noindex, alt text, response time and every broken link, with the anchor text so you can find it. It ends with an HTML report you can send to a client.

Built for freelancers, agencies, site owners and developers who want a page-by-page list of what to fix, not a score to interpret.

**$3 per 1,000 pages audited**, link checks included. Apify's free monthly credit covers a first test run at no cost.

### What you get

One row per page, plus a report for the whole site.

| Column | Example | What it tells you |
|---|---|---|
| `url` / `statusCode` | `https://crawlee.dev/blog/...` / `200` | Page loads, or not |
| `title` / `titleLength` | 139 characters | Titles that will be cut off in search results |
| `metaDescriptionLength` | `156` | Missing, too short or too long |
| `h1` / `h1Count` | `1` | Missing or duplicate H1 |
| `canonical`, `metaRobots`, `xRobotsTag` | | Canonical pointing elsewhere, noindex |
| `imagesMissingAlt` | `0` | Images without an `alt` attribute |
| `wordCount` | `3563` | Thin pages |
| `responseTimeMs` | `17` | Server answer time |
| `brokenLinks` | `[{"url": "...readthedocs.io/...", "status": 404, "anchorText": "TLS presets"}]` | Which link, what error, what the link text says |
| `issues` | `["title_too_long", "broken_links"]` | Short codes you can filter on |

Also saved in the key-value store: `REPORT` (the HTML report) and `SUMMARY` (JSON totals, duplicate titles and descriptions, sitemap problems).

### How to use

1. **Enter the homepage** of the site, for example `https://example.com`. The Actor finds the sitemap through robots.txt or `/sitemap.xml`, and crawls internal links if there is none.
2. **Set Max pages.** You pay per page audited, so start with 100.
3. **Press Start**, then open the dataset for the page table or `REPORT` in the Storage tab for the shareable version.

### Input example

```json
{
  "startUrl": "https://example.com",
  "discovery": "sitemap-then-crawl",
  "maxPages": 100,
  "checkExternalLinks": true,
  "maxLinkChecks": 2000,
  "maxConcurrency": 4
}
```

- **How to find pages**: sitemap first (audits exactly what you tell Google about), sitemap only, or crawl internal links. Sitemap indexes and `.xml.gz` files work.
- **Check links to other websites**: on by default. Internal links are always checked.
- **Max unique links to check**: each unique link is checked once, even if 500 pages use it.
- **Pages in parallel**: 4 is gentle on small shared hosting.

### Output example

From a real run on a public site (shortened). It found one dead link on this page:

```json
{
  "url": "https://crawlee.dev/blog/common-problems-in-web-scraping",
  "statusCode": 200,
  "redirected": false,
  "responseTimeMs": 17,
  "inSitemap": true,
  "titleLength": 139,
  "metaDescriptionLength": 156,
  "h1": "Current problems and mistakes of web scraping in Python and tricks to solve them!",
  "h1Count": 1,
  "canonical": "https://crawlee.dev/blog/common-problems-in-web-scraping",
  "lang": "en",
  "hasOpenGraph": true,
  "hasStructuredData": true,
  "wordCount": 3563,
  "imagesTotal": 11,
  "imagesMissingAlt": 0,
  "internalLinks": 38,
  "externalLinks": 51,
  "brokenLinksCount": 1,
  "brokenLinks": [
    {
      "url": "https://curl-cffi.readthedocs.io/en/latest/impersonate.html",
      "status": 404,
      "error": null,
      "anchorText": "TLS presets"
    }
  ],
  "linksBlockedOrSkipped": 5,
  "issues": ["title_too_long", "broken_links"],
  "issueCount": 2
}
```

The tested crawl above audited 15 pages of that site, found a dead link and flagged long titles. On a 69-page site, a full run took 32 seconds and checked 151 unique links.

### What it checks

| Check | Issue code |
|---|---|
| Page returns 4xx/5xx or does not load | `http_error` |
| Page URL redirects | `redirect` |
| Title missing, under 15 or over 60 characters | `missing_title`, `title_too_short`, `title_too_long` |
| Meta description missing, under 50 or over 160 characters | `missing_meta_description`, `meta_description_too_short`, `meta_description_too_long` |
| No H1, or more than one | `missing_h1`, `multiple_h1` |
| `noindex` in meta robots or X-Robots-Tag header | `noindex` |
| Canonical missing, or pointing to another URL | `missing_canonical`, `canonical_elsewhere` |
| No `lang` on `<html>`, no mobile viewport | `missing_lang`, `missing_viewport` |
| Fewer than 200 words | `thin_content` |
| Images with no `alt` attribute (`alt=""` is fine for decoration) | `images_missing_alt` |
| Links that return 4xx/5xx or point to a domain that does not exist | `broken_links` |
| Server took more than 2 seconds | `slow_response` |

Across the site it also lists duplicate titles, duplicate meta descriptions, and every broken link with the pages that link to it.

### Use cases

- **Freelancers and agencies**: run it before and after a client project and attach the report.
- **Site owners**: schedule it weekly and catch broken links after each content update.
- **Developers**: check a staging site's sitemap before launch.
- **Content teams**: find pages with missing meta descriptions or thin copy to fix first.

### Pricing

Pay per event: **$3 per 1,000 pages audited** ($0.003 per page). Link checks are included, so a page with 80 links costs the same as one with 5. Apify adds a small fee for each run start.

- The Apify free plan includes monthly platform credit, so auditing a small site costs nothing.
- Set **Max pages** to cap what a run can cost.
- A page that answers with an error code (404, 500) is a finding, so it counts as audited. A page that never answers at all (timeout, DNS error, connection reset) is listed with an `error` field and is free.
- If you set a max cost per run, the audit stops when it is reached. The report and `SUMMARY` then cover only the pages you got.

| Site size | Cost |
|---|---|
| 100 pages | about $0.30 |
| 500 pages | about $1.50 |
| 2,000 pages | about $6 |

**Compared with other options.** Many audit tools price per page with the link checks on top, or give you a 0 to 100 score. This one has a flat per-page price with links included and gives you a plain list of problems and the exact link text to look for. It does not measure Core Web Vitals or run Lighthouse (see Limits).

### How it treats other people's servers

- It follows robots.txt on your site and on every site it checks a link on. Disallowed pages and links are skipped, not counted as broken.
- Links get a light HEAD request, and a normal GET only when a server refuses HEAD.
- At most two requests at a time go to any other website.
- Status 401, 403, 429 and 999 usually mean "this site blocks bots", for example LinkedIn. They are reported as blocked, not broken, so your report does not fill up with false alarms.

### Limits

- It reads the HTML the server sends. Content added later by JavaScript (some single-page apps) is not seen.
- It does not measure Core Web Vitals or run Lighthouse. Response time is the server's answer time.
- One site per run. Pages on other subdomains are treated as external links.
- Up to 10,000 pages per run.

### Integrations

Everything Apify supports works here: weekly schedules, webhooks, the REST API, and the official integrations with Zapier, Make, n8n and Google Sheets. A common setup is a weekly run that emails the `REPORT` link, or sends broken links to a Slack channel. The **API** tab on this page has ready code for JavaScript, Python and cURL.

### FAQ

**Can I audit a competitor's site?**
It works on any public site that allows it in robots.txt. It is built for your own sites and your clients', and it keeps the request rate low either way.

**Why is a link I know is fine marked as broken?**
Some servers return 404 to bots or to HEAD requests. The Actor retries with GET before reporting. If it still happens, open an issue with the URL.

**Does it follow nofollow links?**
It checks them, because a broken nofollow link is still broken for your visitors.

**Something broke.**
Open an issue on the Issues tab with the run link. I reply within a day.

# Changelog

This Actor's version history is a separate document: https://apify.com/opstoolkit/site-seo-link-audit/changelog.md

# Actor input Schema

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

The homepage of the site, e.g. https://example.com. Only pages on this host are audited.

## `discovery` (type: `string`):

Sitemap first is fastest and audits exactly the pages you tell Google about. If there is no sitemap, the Actor follows internal links from the homepage.

## `sitemapUrl` (type: `string`):

Only if your sitemap is not listed in robots.txt or at /sitemap.xml.

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

You pay per page audited. Start with 100 to see the report.

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

Also check outgoing links. Internal links are always checked.

## `maxLinkChecks` (type: `integer`):

Each unique link is checked once, even if 500 pages use it. Link checks are included in the page price.

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

Keep it low for small shared-hosting sites. 4 is gentle.

## Actor input object example

```json
{
  "startUrl": "https://crawlee.dev",
  "discovery": "sitemap-then-crawl",
  "maxPages": 25,
  "checkExternalLinks": true,
  "maxLinkChecks": 500,
  "maxConcurrency": 4
}
```

# Actor output Schema

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

No description

## `report` (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://crawlee.dev"
};

// Run the Actor and wait for it to finish
const run = await client.actor("opstoolkit/site-seo-link-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 = { "startUrl": "https://crawlee.dev" }

# Run the Actor and wait for it to finish
run = client.actor("opstoolkit/site-seo-link-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 '{
  "startUrl": "https://crawlee.dev"
}' |
apify call opstoolkit/site-seo-link-audit --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,opstoolkit/site-seo-link-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/kq5mhZ3SEROSkVEZT/builds/g7VrYKhjDCDYCCFEL/openapi.json
