# Website SEO Audit: Broken Links, Titles, Meta Tags (`politecrawl/seo-site-audit`) Actor

Audits the pages of a site you own or manage: status, title, meta description, canonical, h1 count and broken internal links. Reads only what robots.txt allows.

- **URL**: https://apify.com/politecrawl/seo-site-audit.md
- **Developed by:** [Umberto Vignetta](https://apify.com/politecrawl) (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

$3.10 / 1,000 results

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 Links, Titles, Meta Tags

### What it does

Give it a page of a site you own or manage, and it audits the site's pages, following the
site's own links from that page, up to `maxItems` pages (50 by default). For each page it
reports the status code, the title and its length, the meta description and its length, the
canonical address, the number of h1 headings, and the links on the page to the same site that
are broken. It reads the site's robots.txt first and requests only what it allows, one request
a second.

Run it after a change, or on a schedule:

- **A weekly site check.** Run it every week and compare with the week before: pages that
  started to fail, lost their title or meta description, or gained broken links.
- **Broken links, before your customers find them.** The links to the same site on each page
  audited are checked, up to 50 new ones a page, and each one that answers with an error or
  does not answer is listed with its status.
- **After a redesign or a deploy.** Run it right after the release and check that every page
  still has a title, a meta description of a sensible length, one h1 and the right canonical.

### Run it on a schedule

1. Fill in your start page and save the input as a task.
2. In Apify Console, open Schedules and create a schedule for the task, such as every Monday
   morning. Weekly suits most sites; daily suits a site that changes every day.
3. Send the results where you work, from the task's Integrations tab or the API:
   - **Google Sheets:** add each run's pages to a sheet with the Zapier or Make integration,
     or download the run's results as CSV and import them.
   - **Make and Zapier:** start a scenario or a Zap when a run finishes, for example to send
     your team the pages that have broken links.
   - **Webhooks:** Apify calls your own address when a run succeeds or fails.
   - **The API:** start a run from your deploy pipeline after each release, and read its
     results as JSON, CSV or Excel.

### Input

- `startUrl` (default `https://books.toscrape.com/`, a sandbox site built for scrapers): the
  page where the audit starts, usually your home page. An address written without
  `https://` gets it. The audit stays on this site: the same host, with or without `www.`,
  by http or https.
- `maxItems` (default 50): the most pages the run audits, and so the most results it
  charges.

An input for a weekly check of your own site, where `https://www.example.com/` stands for it:

```json
{
  "startUrl": "https://www.example.com/",
  "maxItems": 200
}
```

### Sample output

The start page of the default input, from an evaluation run:

```json
{
  "url": "https://books.toscrape.com/",
  "statusCode": 200,
  "title": "All products | Books to Scrape - Sandbox",
  "titleLength": 40,
  "metaDescription": "",
  "metaDescriptionLength": 0,
  "canonical": "",
  "h1Count": 1,
  "linksChecked": 50,
  "linksNotChecked": 23,
  "brokenLinks": []
}
```

- `url`: the page audited, after any redirect inside the site.
- `statusCode`: the HTTP status the page answered with.
- `title`, `titleLength`: the text of the page's title tag, with its spaces tidied, and its
  number of characters. Empty and 0 when the page has none.
- `metaDescription`, `metaDescriptionLength`: the same for the page's meta description.
- `canonical`: the address in the page's canonical link, made absolute, or empty.
- `h1Count`: how many h1 headings the page has.
- `linksChecked`: how many distinct links on the page to the same site were checked.
- `linksNotChecked`: how many were not, because robots.txt forbids them, the page reached
  its 50 new checks or the run was near its time limit (see Limits).
- `brokenLinks`: the checked links whose page answered with an error (4xx or 5xx) or did
  not answer at all, each as `{"url": "...", "statusCode": 404}`, with `statusCode` 0 for
  no answer.

The Output tab shows the pages as a table, and the results download as JSON, CSV, Excel, XML
or HTML.

### Price

One `result` event is charged for each page saved to the dataset, and nothing else. A page
that fails to load is not saved or charged: it shows up as a broken link on the pages that
link to it. A scheduled run is charged the same way. The price per result is shown on the
Actor's page.

### Limits

- It is meant for sites you own or manage, and reads one site: the start page's host, with
  or without `www.`. Links to other sites are not checked.
- It reads robots.txt first and never requests a page that robots.txt forbids. When
  robots.txt cannot be read because of a server error, it reads nothing. It waits one
  second between requests, or longer when robots.txt sets a Crawl-delay; a Crawl-delay over
  10 seconds stops the run.
- When the site refuses (HTTP 401, 403 or 429) or shows a CAPTCHA page, the run stops and
  fails with the status message `blocked: <what>`. It never works around a refusal, and it
  sends plain requests from Apify's servers with no proxy. Pages saved before the refusal
  stay in the dataset.
- It checks the `<a href>` links of each page, each link once per run, and at most 50 links
  per page that no earlier page had sent to be checked. Images, scripts and stylesheets are
  not checked. Links to files, such as PDFs, are checked but not audited as pages.
- It reads the HTML the server sends and runs no JavaScript, so links that only JavaScript
  adds are not seen.
- It follows redirects inside the site, five at most, and reports the page they end on. A
  link that redirects to another site counts as working.
- It does not measure page speed or Core Web Vitals, and gives no score. Each run is a
  snapshot: compare runs yourself to see what changed.
- Each page audited and each link checked takes about a second. A run starts no new work in
  the last minute before its timeout, then ends with the pages audited so far and says so in
  its status message. The default timeout is one hour; give the run a longer one in its run
  options to audit more pages.
- It stores page facts only, no data about people. Links to email addresses and phone
  numbers are skipped.

### FAQ

**Can I audit a site I do not own?**
The tool is meant for sites you own or manage. It obeys robots.txt, waits between requests
and stops when a site refuses.

**Why are some links counted as not checked?**
robots.txt forbids them, the page reached its 50 new link checks, or the run was near its
time limit. A link checked on one page counts as checked on every later page that has it.

**Why is a page missing from the results?**
robots.txt forbids it, it failed to load (it then shows as a broken link on the pages that
link to it), only JavaScript links to it, or the run reached `maxItems` or its time limit.

**How do I hear about a broken link without opening every run?**
Schedule the audit, send each run's results to Make or Zapier, and have it alert you about
pages whose `brokenLinks` list is not empty.

**Does it check links to other sites, images or scripts?**
No. It checks the `<a href>` links to the same site.

# Actor input Schema

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

A page of a site you own or manage, usually its home page. The audit starts here and follows the site's own links, reading only what the site's robots.txt allows. The default is a sandbox site built for scrapers.

## `maxItems` (type: `integer`):

The run audits at most this many pages. Each page audited is one charged result.

## Actor input object example

```json
{
  "startUrl": "https://books.toscrape.com/",
  "maxItems": 50
}
```

# Actor output Schema

## `dataset` (type: `string`):

No description

## `run` (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://books.toscrape.com/"
};

// Run the Actor and wait for it to finish
const run = await client.actor("politecrawl/seo-site-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://books.toscrape.com/" }

# Run the Actor and wait for it to finish
run = client.actor("politecrawl/seo-site-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://books.toscrape.com/"
}' |
apify call politecrawl/seo-site-audit --silent --output-dataset

```

## MCP server setup

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