# SEO Site Audit Crawler: Broken Link & Redirect Checker (`siteacs/site-audit-crawler`) Actor

Broken link checker, redirect checker and SEO site audit in one crawl: give a website, get per page the HTTP status, redirect chain, title, meta description, H1, canonical, hreflang, Open Graph tags, dead links, broken images, scripts and stylesheets, and sitemap orphan pages.

- **URL**: https://apify.com/siteacs/site-audit-crawler.md
- **Developed by:** [SiteAcs](https://apify.com/siteacs) (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

$2.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

## SEO Site Audit Crawler: broken link checker, redirect checker, meta tags and sitemap audit

Give it a website. It crawls the site from the start page and its XML sitemap, and saves one row per page with the
facts an SEO audit needs:

- **HTTP status and redirect chain** (a redirect checker for the whole site): every hop with its status code
  (301, 302, 307, 308) and the final URL.
- **Meta tags**: title, meta description, H1 (and how many), canonical, robots meta and X-Robots-Tag, hreflang,
  Open Graph tags (og:title, og:description, og:image, og:url, og:type), language and word count.
- **Broken links**: every dead link on the page, internal and external, with its status code or error and the
  anchor text. A broken link checker and a site crawler in one run.
- **Broken images, scripts and stylesheets**: every file the page loads (img src and srcset, script, stylesheet,
  icons, iframe, video, audio) is checked too, and dead ones are listed per page in `brokenAssets`.
- **Sitemap coverage**: pages listed in the sitemap that no page links to (orphan pages), and linked, indexable
  pages missing from the sitemap.
- **Issue codes** per page, such as `missing_meta_description`, `duplicate_title`, `redirect_chain`,
  `broken_links` or `canonical_to_other_page`, and one **summary row per site** with the count of each issue.

You pay per page audited. Link checks are included, so a page with 80 links costs the same as a page with 3.

**Quick start**

- **In:** the start page of each site (`startUrls`) and a page limit per site (`maxPagesPerSite`, default 200).
- **Out:** one row per URL (`httpStatus`, `redirectChain`, `title`, `metaDescription`, `h1`, `canonical`,
  `brokenLinks`, `brokenAssets`, `issues`), one summary row per site (`issueCounts`, `brokenLinkUrls`,
  `crawlComplete`), and a flat `BROKEN_LINKS` list in the key-value store.
- **Price:** $2.00 per 1,000 audited pages, no start fee; link checks, redirects and error pages are free.

```json
{ "startUrls": [{ "url": "https://htmx.org/" }], "maxPagesPerSite": 50 }
```

That input audited 47 pages of htmx.org in about 95 seconds, checked 481 link and file targets, found 11 dead links
and cost $0.094. Three fields of one of its rows: `{"url": "https://htmx.org/talk/", "brokenLinkCount": 2, "issues": ["broken_links", "links_to_redirects", "meta_description_too_long"]}`.

Typical uses: check redirects and dead links after a site migration or redesign, audit a client's site before a
proposal, or schedule a monthly run and compare the summary rows.

### What you get

A row per crawled URL (`"type": "page"`), for example:

```json
{
  "type": "page",
  "site": "example.com",
  "url": "https://example.com/blog/old-post",
  "finalUrl": "https://example.com/blog/new-post/",
  "httpStatus": 200,
  "redirectChain": [
    {"url": "https://example.com/blog/old-post", "status": 301},
    {"url": "https://example.com/blog/new-post", "status": 301},
    {"url": "https://example.com/blog/new-post/", "status": 200}
  ],
  "redirectCount": 2,
  "issues": ["redirect", "redirect_chain"]
}
```

and for a page that answered directly:

```json
{
  "type": "page",
  "url": "https://example.com/pricing/",
  "httpStatus": 200,
  "depth": 1,
  "title": "Pricing - Example",
  "titleLength": 17,
  "metaDescription": null,
  "h1": "Plans and pricing",
  "h1Count": 1,
  "canonical": "https://example.com/pricing/",
  "canonicalIsSelf": true,
  "robotsMeta": null,
  "indexable": true,
  "hreflang": [{"lang": "de", "url": "https://example.com/de/preise/"}],
  "ogTitle": "Pricing",
  "ogImage": "https://example.com/og/pricing.png",
  "wordCount": 412,
  "inSitemap": false,
  "inlinks": 14,
  "internalLinks": 38,
  "externalLinks": 6,
  "brokenLinkCount": 1,
  "brokenLinks": [
    {"url": "https://partner.example.org/offer", "status": 404, "error": null, "anchorText": "partner offer", "internal": false}
  ],
  "assets": 21,
  "brokenAssetCount": 1,
  "brokenAssets": [
    {"url": "https://example.com/img/team-2019.jpg", "element": "img", "status": 404, "error": null, "internal": true}
  ],
  "issues": ["broken_links", "broken_assets", "missing_meta_description", "linked_not_in_sitemap"]
}
```

A URL that redirects gets its own row (no title or tags, issue `redirect`), besides the row of the page it lands on.

Each site ends with a summary row (`"type": "summary"`): `pagesCrawled` (same-site URLs requested; the page limit
counts these), `pagesAudited` (HTML pages audited and charged), `pagesWithIssues` (rows with at least one issue,
redirect rows included), `issueCounts`, the number of broken link URLs, links checked, sitemap URLs, whether the
crawl was complete (`crawlComplete`, with `stopReason` when not), and the most requests the crawler ever had in
flight to the site. `sitemapUrlsOnOtherOrigin` counts sitemap entries written as `http://` or with a different
`www.` form than the address the site answers on; they are matched as the site's own address, and the count tells you
the sitemap should be fixed.

The run's key-value store also holds `BROKEN_LINKS` (one flat entry per broken link or file: page, link URL, element
such as `a` or `img`, status, anchor text; easy to export) and `SUMMARY` (the summary rows). With **Save every link with its status** on, `ALL_LINKS`
lists every distinct link and file target found, with its verdict (`ok`, `broken`, `blocked`, `unchecked`), status
and error. The dataset has five table views: Pages and issues, Meta tags, Broken links and files, Redirects, Sitemap
coverage.

### Issue codes

| Code | Meaning |
| --- | --- |
| `http_error` | the URL answered 4xx or 5xx |
| `redirect`, `redirect_chain` | the URL redirects; `redirect_chain` when it takes two hops or more |
| `broken_links` | the page links to at least one dead URL (404, 410, other 4xx and 5xx, DNS failure, a server that refuses every connection, timeout) |
| `broken_assets` | the page loads at least one dead image, script, stylesheet, icon, frame or media file |
| `links_to_redirects` | the page links to same-site URLs that redirect (link to the final URL instead) |
| `missing_title`, `title_too_long`, `title_too_short` | no title; over 60 characters; under 10 |
| `missing_meta_description`, `meta_description_too_long`, `meta_description_too_short` | none; over 160 characters; under 50 |
| `duplicate_title`, `duplicate_meta_description` | another indexable page of the site has the same one |
| `missing_h1`, `multiple_h1` | no H1, or more than one |
| `missing_canonical`, `canonical_to_other_page` | no canonical link, or one that points to another URL |
| `noindex` | robots meta or X-Robots-Tag says noindex |
| `missing_og_tags` | no og:title or no og:image (the link preview on social sites) |
| `thin_content` | under 200 words of visible text |
| `slow_response` | the server took over 3 seconds to answer |
| `in_sitemap_not_linked` | in the sitemap but no crawled page links to it (only set when the crawl was complete) |
| `linked_not_in_sitemap` | an indexable page that the site links to but its sitemap does not list |
| `sitemap_url_redirects`, `sitemap_url_broken` | the sitemap lists a URL that redirects, or one that is dead |
| `meta_refresh` | the page forwards visitors with a meta refresh tag |

Links answered with 401, 403, 429, 503 or 999 are not counted as broken, nor a server that accepts the connection
and then drops it, nor a refused connection to a server that answered other links in the same crawl: those servers
refuse or rate-limit automated checks, and the link usually works in a browser. With **Save every link with its status** on, they show as `blocked` in `ALL_LINKS`.

### How it crawls

- Starts at the start URL, follows same-site links breadth-first (closest pages first), then the sitemap's pages.
- Stays on the start URL's host, with or without `www.`; subdomains only when you turn them on.
- Respects robots.txt: disallowed pages are listed but not requested, and a `Crawl-delay` is honoured (up to 30 s).
- Polite by default: at most 2 requests in flight to the site and 250 ms between requests (at most 4 a second);
  external hosts get one request at a time, at most 2 a second.
- Stops at the page limit and the depth limit you set. Links to pages beyond the limit are still checked.
- **Only crawl URLs matching** and **Never crawl URLs matching** take globs (`/blog/**`, `/tag/*`) or `regex:`
  patterns. Pages left out are not crawled or charged; links to them still get a status check.
- Never requests private or internal addresses (localhost, 10.x, 192.168.x, cloud metadata), including names that
  resolve to them and redirects that lead to them.
- Plain HTTP, no browser: content added by JavaScript after load is not seen. Pages behind a bot challenge
  (Cloudflare, DataDome, PerimeterX) are reported as blocked, not bypassed.

### Limits

- **Link checks have a cap per site**: 2,000 same-site targets that are not crawled as pages (links past the page
  limit, excluded pages, the site's own images and scripts) and 1,000 external targets, page links first. Both are
  inputs, up to 50,000 and 20,000. Targets over a cap, and those robots.txt keeps us from, are counted in the
  summary's `linksNotChecked`; when it is above 0, raise the cap to check every link.
- A link check reads the status only (HEAD, or GET without the body), so a page that answers 200 with a "not
  found" message (a soft 404) is not caught.
- CSS `background-image` URLs and files loaded by JavaScript are not checked.

### Input

```json
{
  "startUrls": [{ "url": "https://htmx.org/" }],
  "maxPagesPerSite": 200,
  "checkExternalLinks": true
}
```

Add several start URLs to audit several sites in one run; each gets its own summary row. See the Input tab for the
depth limit, URL patterns, the link caps, file checks, subdomains, robots.txt, speed and proxy options.

### Price

$2.00 per 1,000 pages audited. An audited page is a same-site URL that answered with an HTML page (HTTP 2xx). Free:
every link check, redirects, error pages (404, 500), non-HTML files, timeouts, pages behind a bot wall, pages robots.txt
disallows, and the summary rows. So a 500-page site costs at most $1.00, however many links it has.

Set a maximum cost per run in the run options and the crawl stops when it is reached.

### Related

- For Core Web Vitals and Lighthouse scores per URL, use a PageSpeed / Lighthouse actor; this one reads the HTML only.
- To check whether a list of domains is live, parked or dead (one request per domain, no crawl), use
  [Website Status Checker](https://apify.com/siteacs/website-status-checker).

### Em português / En español

Auditoria de SEO de um site inteiro e verificador de links quebrados: informe a página inicial e receba, por página,
o status HTTP, os redirecionamentos, title, meta description, H1, canonical, links quebrados e imagens quebradas.
Auditoría SEO y comprobador de enlaces rotos: indique la página de inicio y obtenga, por página, el estado HTTP, las
redirecciones, las metaetiquetas, los enlaces rotos y las imágenes rotas. US$ 2,00 por 1.000 páginas.

### Questions and problems

Open an issue on the Issues tab with the run ID and the URL, and it will be looked at.

# Changelog

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

# Actor input Schema

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

The start page of each site, e.g. https://www.example.com/. Each start URL is crawled as its own site, with its own summary row. The crawl stays on the start URL's host (with or without www) and follows the redirect of the start page, e.g. to a /en/ home page.

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

The crawl stops after this many same-site URLs have been requested. Links to pages beyond the limit are still checked for dead links, but get no row of their own, and the sitemap coverage check is marked incomplete.

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

How many clicks away from the start page the crawl goes. 0 audits the start page only (plus its links' status). Pages found only in the sitemap are crawled whatever their depth.

## `includeUrlPatterns` (type: `array`):

Globs matched against the full URL or its path: /blog/\*\* crawls only the blog (\* stays inside one path segment, \*\* crosses them). Start with regex: for a regular expression. The start page is always crawled. Empty: the whole site.

## `excludeUrlPatterns` (type: `array`):

Same syntax, e.g. /tag/\*\* or regex:\[?&]sort=. Pages left out are not crawled or charged, but links to them still get a status check.

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

Reads the sitemaps listed in robots.txt (or /sitemap.xml), crawls the pages they list after the linked ones, and compares the two: pages in the sitemap that no crawled page links to, and linked pages missing from the sitemap.

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

Also checks links to other websites (one HEAD request each, GET when HEAD is refused) and reports the dead ones. Off: only same-site links are checked.

## `checkAssets` (type: `boolean`):

Also checks the files each page loads: img src and srcset, script src, link rel=stylesheet and icons, iframe, video, audio and source. Dead ones are listed per page in brokenAssets and in BROKEN_LINKS. Free, like the other link checks.

## `maxExternalLinksPerSite` (type: `integer`):

Distinct external targets (links and files) checked per site, links first, in the order they were found. Targets over the cap are counted in the summary's linksNotChecked.

## `maxUncrawledLinkChecks` (type: `integer`):

Same-site targets that are not crawled as pages but still get a status check: links to pages past the page or depth limit, links left out by the URL patterns, and the site's own images, scripts and stylesheets. Targets over the cap are counted in the summary's linksNotChecked.

## `saveAllLinks` (type: `boolean`):

Also saves ALL_LINKS in the key-value store: every distinct link target found, internal and external, with its verdict (ok, broken, blocked, unchecked), HTTP status and error. Useful as a full link inventory; the dataset is unchanged.

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

On: blog.example.com and shop.example.com are crawled as part of example.com. Off: they count as external links.

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

On: pages and links that robots.txt disallows are not requested (they are listed with the reason), and a Crawl-delay is honoured (up to 30 seconds). Turn it off only for your own site.

## `maxConcurrencyPerSite` (type: `integer`):

Requests in flight to the audited site at once. External sites always get one at a time.

## `delayBetweenRequestsMs` (type: `integer`):

Minimum time between two requests to the same host. With the defaults a site gets at most 4 requests a second; external hosts get at most 2.

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

How long to wait for each answer. A link that does not answer in time is reported as broken with the error timeout.

## `maxConcurrentSites` (type: `integer`):

How many start URLs are crawled in parallel. Each still gets the per-site limits above.

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

Not needed for most sites: requests go out from Apify's servers directly. Pages that show a bot challenge are reported as blocked, not bypassed.

## Actor input object example

```json
{
  "startUrls": [
    {
      "url": "https://htmx.org/"
    }
  ],
  "maxPagesPerSite": 200,
  "maxDepth": 20,
  "includeUrlPatterns": [],
  "excludeUrlPatterns": [],
  "useSitemap": true,
  "checkExternalLinks": true,
  "checkAssets": true,
  "maxExternalLinksPerSite": 1000,
  "maxUncrawledLinkChecks": 2000,
  "saveAllLinks": false,
  "includeSubdomains": false,
  "respectRobotsTxt": true,
  "maxConcurrencyPerSite": 2,
  "delayBetweenRequestsMs": 250,
  "requestTimeoutSecs": 15,
  "maxConcurrentSites": 5,
  "proxyConfiguration": {
    "useApifyProxy": false
  }
}
```

# Actor output Schema

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

One row per crawled URL: HTTP status, redirect chain, title, meta description, H1, canonical, broken links and issue codes. The last row of each site is its summary.

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

Every dead link found: the page it is on, the link URL, HTTP status or error, and anchor text.

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

Pages crawled, issue counts, broken links, sitemap coverage and whether the crawl was complete, one entry per site.

# 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://htmx.org/"
        }
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("siteacs/site-audit-crawler").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://htmx.org/" }] }

# Run the Actor and wait for it to finish
run = client.actor("siteacs/site-audit-crawler").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://htmx.org/"
    }
  ]
}' |
apify call siteacs/site-audit-crawler --silent --output-dataset

```

## MCP server setup

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

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/JyR6zDFba0fieaClz/builds/pYQx8cw4ee5Cke5ae/openapi.json
