# Website SEO Audit Crawler - On-Page SEO and Meta Tags (`batreek/website-seo-audit-crawler`) Actor

Crawl a website and audit on-page SEO for each page: title and meta description length, H1, canonical, robots noindex, hreflang, image alt text, internal links, and duplicate titles. Each row has a deterministic 0-100 score and a fix. Respects robots.txt. Static HTML only.

- **URL**: https://apify.com/batreek/website-seo-audit-crawler.md
- **Developed by:** [Adam Abdou-Gustavson](https://apify.com/batreek) (community)
- **Categories:** SEO tools, Developer tools, Automation
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $10.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 Audit Crawler

Crawl one website and review on-page SEO for every page you accept: title and meta description, H1, canonical, robots `noindex`, hreflang, image alt text, internal links, and duplicate titles or descriptions across the crawl. Each row has the HTTP status, the redirect chain, a deterministic 0–100 score, and a fix.

The score is a **heuristic from fixed deductions**. It is **not a Google ranking** and it does not predict rankings. Title length 30–60 and meta description length 70–160 are this Actor's character thresholds, not official Google limits. Google does not publish stable character caps.

The crawler reads static HTML. It does not run JavaScript, and it does not call a browser, PageSpeed, a keyword API, a backlink index, or WHOIS.

### What a row contains

- Final HTTP status, error (if the fetch failed), content type, and the redirect chain. One hop is normal. Longer chains are flagged when they pass `redirectChainThreshold` (default 1).
- Title and meta description presence and character length, plus duplicates among the pages this run actually audited.
- H1 text and count, canonical URL, meta robots, and `X-Robots-Tag`.
- hreflang codes checked as syntax (`en`, `en-US`, `x-default`). Alternate URLs are not fetched, so return tags are not confirmed. HTTP `Link` headers are not read.
- Images missing an `alt` attribute. `alt=""` is treated as decorative and is not flagged. Whitespace-only alt text is flagged. At most 200 images per page are inspected.
- Internal and external link counts from `<a href>`, plus how many other audited pages link here. At most 300 links per page are followed.
- A 0–100 score and a grade from A to F. Info issues such as an intentional `noindex` do not change the score. On-page tag deductions apply to HTTP 200 HTML. Other rows still show status, redirects, and the fields that could be read.

The same limits are copied onto every row (`limitationsText`) and into the `SUMMARY` record.

### Quick start

1. Start the Actor.
2. Put the site in **Start URLs**. The form is prefilled with `https://example.com/` and 10 pages.
3. Open the dataset, or the flat CSV from the Output tab. The key-value record `SUMMARY` has the totals.

The crawler stays on the same site as each start URL. `www.example.com` and `example.com` are one site. `blog.example.com` is not. Add that host as its own start URL if you want it audited. `http` and `https` on that host are the same site.

### Input examples

**1. Quick audit of a small site** (25 accepted pages = $0.25, plus the start fee below):

```json
{
  "startUrls": [{ "url": "https://example.com/" }],
  "maxPages": 25,
  "maxDepth": 2
}
```

**2. Blog section only, glob include and exclude, lower concurrency:**

```json
{
  "startUrls": [{ "url": "https://example.com/blog/" }],
  "maxPages": 100,
  "maxDepth": 4,
  "urlPatternSyntax": "glob",
  "includeUrlPatterns": ["https://example.com/blog/*"],
  "excludeUrlPatterns": ["*/tag/*", "*?replytocom=*"],
  "maxConcurrency": 2,
  "perHostConcurrency": 1,
  "respectRobotsTxt": true
}
```

Start URLs are still audited when they do not match an include pattern. A start URL that matches an exclude pattern fails the run. 100 pages = $1.00 before the start fee.

**3. Sitemap URLs only (no link following):**

```json
{
  "startUrls": [{ "url": "https://example.com/" }],
  "useSitemap": true,
  "maxDepth": 0,
  "maxPages": 500,
  "sitemapUrls": ["https://example.com/sitemap.xml"]
}
```

With `maxDepth` 0, links on those pages are not followed. Sitemap files themselves are not charged. 500 accepted page audits = $5.00 before the start fee. Orphan pages (in the sitemap, not linked from an audited page) are reported only when the crawl finishes inside `maxPages`, `maxDepth`, and the cost cap.

| Field | Default | What it does |
|---|---|---|
| `startUrls` | – | One or more http(s) URLs. Each site is crawled separately. `maxPages` is shared. |
| `maxPages` | 100 | Accepted page audits (1–20,000). This is the main cost cap. |
| `maxDepth` | 5 | Link hops from a start or sitemap URL. |
| `useSitemap` | false | Also queue same-site sitemap URLs. |
| `sitemapUrls` | \[] | Use these sitemap files instead of discovery. Turns sitemap mode on. |
| `includeUrlPatterns` | \[] | If set, discovered URLs must match. Start URLs stay eligible. |
| `excludeUrlPatterns` | \[] | Matching URLs are skipped. |
| `urlPatternSyntax` | regex | `regex` or `glob`. |
| `maxConcurrency` | 4 | Parallel fetches for the whole run (1–8). |
| `perHostConcurrency` | 2 | Parallel fetches for one site (1–4, and not above max concurrency). |
| `requestTimeoutSecs` | 20 | Per attempt (5–45). |
| `maxResponseBytes` | 2000000 | Decompressed body cap (100,000–5,000,000). |
| `maxRetries` | 2 | Extra attempts for timeouts and HTTP 429/502/503/504. Not charged. |
| `redirectChainThreshold` | 1 | Flag chains with more hops than this. |
| `respectRobotsTxt` | true | Skip disallowed URLs. Those rows are not charged. |

### Sample output

This row is the shape produced for a healthy fixture page (HTTPS, one title in range, one meta description in range, one H1, a same-site canonical, `lang`, no redirect). It is not a live crawl.

```json
{
  "url": "https://example.com/",
  "finalUrl": "https://example.com/",
  "statusCode": 200,
  "audited": true,
  "charged": true,
  "score": 100,
  "grade": "A",
  "scoreModel": "deterministic heuristic deductions from 100; not a Google ranking and not a prediction of rankings",
  "title": "Readable Example Title For The SEO Audit",
  "titleLength": 40,
  "h1Count": 1,
  "noindex": false,
  "indexable": true,
  "issuesText": ""
}
```

`charged` is true only when this run's pay-per-event pricing counted a `page-audited` event. `audited` is true for every accepted page audit. If pricing is not set, the row is still audited and `charged` is false. `SUMMARY.pagesAudited` is the audit count. `SUMMARY.pagesCharged` is the number of `page-audited` events the SDK recorded (0 when pricing is off). `billing.defaultStartFeeUsd` is `$0.00005` at 512 MB.

`SUMMARY` also includes `issuesBySeverity`, `gradeCounts`, `stoppedByCostLimit`, and the thresholds.

For a spreadsheet, open the **Flat table** view or export `?view=flat&format=csv`. Nested `issues` objects are omitted there. `issuesText` and `fixesText` are single columns.

Grades: **A** 90–100, **B** 75–89, **C** 60–74, **D** 40–59, **F** 0–39.

### Pricing

Pay per event. There is no rental fee in this price.

| Event | Price | When it is charged |
|---|---|---|
| Page audited (`page-audited`) | **$0.01** ($10.00 per 1,000) | Once per accepted page audit |
| Actor start (`apify-actor-start`) | **$0.00005 per event** | Platform only, when the run starts. This Actor does not charge it. |

Apify rounds the start event up to whole gigabytes. One event covers any allocation **up to and including 1 GB**. Each additional GB is one more event. At the default **512 MB** that is **1 event, $0.00005**, not half of $0.00005. 128 MB and 1 GB are also $0.00005. 4 GB is 4 events, **$0.0002**. The page prices below do not include that start fee.

| Accepted pages | `page-audited` total |
|---|---|
| 10 | $0.10 |
| 25 | $0.25 |
| 100 | $1.00 |
| 1,000 | $10.00 |
| 10,000 | $100.00 |

**Charged once:** an in-scope URL that passed the public-address checks and robots.txt, after the fetch attempt finishes. That includes HTML, non-HTML, HTTP 4xx/5xx, and failed fetches (DNS, timeout, connection). Redirect hops and retries are part of that one event.

**Not charged:** `robots.txt`, sitemap files, URLs skipped by robots.txt (they are still listed), unsafe URLs that are skipped, and a URL already audited in this run (including after a restart that reloads saved state).

`maxPages` caps how many audits are accepted. `ACTOR_MAX_TOTAL_CHARGE_USD` (the run's maximum cost) is checked **before** another billable fetch is scheduled. The run stops with `stoppedByCostLimit` when one more `page-audited` event would not fit. The Actor does not add the SDK's extra over-cap event. Set the maximum in the run options or `maxTotalChargeUsd` on the API.

A platform-recorded start event already stored on the run counts toward that maximum. This code never calls `Actor.charge` for `apify-actor-start`.

### API

Replace `<YOUR_APIFY_TOKEN>` with a token from Apify Console → Settings → Integrations. Runs are billed to that account.

```bash
curl -X POST "https://api.apify.com/v2/acts/batreek~website-seo-audit-crawler/run-sync-get-dataset-items?maxTotalChargeUsd=1" \
  -H "Authorization: Bearer <YOUR_APIFY_TOKEN>" \
  -H "Content-Type: application/json" \
  -d '{"startUrls":[{"url":"https://example.com/"}],"maxPages":25}'
```

```python
from apify_client import ApifyClient

client = ApifyClient("<YOUR_APIFY_TOKEN>")
run = client.actor("batreek/website-seo-audit-crawler").call(run_input={
    "startUrls": [{"url": "https://example.com/"}],
    "maxPages": 25,
})
for item in client.dataset(run["defaultDatasetId"]).iterate_items():
    print(item["url"], item["score"], item["issuesText"])
```

```javascript
import { ApifyClient } from 'apify-client';

const client = new ApifyClient({ token: '<YOUR_APIFY_TOKEN>' });
const run = await client.actor('batreek/website-seo-audit-crawler').call({
    startUrls: [{ url: 'https://example.com/' }],
    maxPages: 25,
});
const { items } = await client.dataset(run.defaultDatasetId).listItems();
console.log(items);
```

The same Actor can be used as an MCP tool at `https://mcp.apify.com?tools=batreek/website-seo-audit-crawler`.

### Safety

- Only `http` and `https`. Other schemes are rejected.
- Usernames and passwords in URLs are rejected and are not written into the error text.
- Seeds, redirects, robots.txt, sitemaps, and discovered links must resolve to public addresses. Private, loopback, link-local, CGNAT (`100.64.0.0/10`), documentation, and similar special-use ranges are blocked. If any address for a name is non-public, the name is blocked.
- Each connection uses a pinned address from that check so a DNS change between lookup and connect is not followed.
- Response bodies are size-capped, including gzip and deflate. Sitemap files reject `DOCTYPE` and entity declarations, and sitemap recursion is capped (25 files, 10,000 URLs, depth 5).
- Cookies, `Authorization`, proxy environment variables, and netrc are not used. `Set-Cookie` is not stored and is not logged.
- No personal-data collection fields. The dataset is on-page SEO, not profiles or contact lists.

### Local run

```bash
pip install -r requirements.txt
python -m src
```

Put input in the default key-value store as `INPUT`, or follow the Apify CLI local-run layout. Tests do not use the network:

```bash
pip install -r requirements-dev.txt
pytest
```

The image is `apify/actor-python:3.13` (see `.actor/Dockerfile`). Default memory is 512 MB.

### Limitations

- **No JavaScript.** Content that appears only after scripts run is invisible. The same is true for cookie-walled HTML.
- **Not a rank tracker, backlink report, or keyword tool.** There is no Search Console, PageSpeed, WHOIS, or backlink data.
- **Hreflang targets are not fetched**, and HTTP `Link` headers are not parsed.
- **Duplicates and inlinks cover this crawl only.** If `maxPages`, depth, the cost cap, or the per-page link cap stops the crawl, orphan detection is skipped and duplicate groups only include audited URLs.
- **One site per start host**, with `www` ignored. Other subdomains need their own start URL.
- **Redirecting URL and final URL** are separate rows when both are queued. Each accepted URL is one charge.
- **Dataset rows are not a second price.** Pushes go to the default dataset without `charged_event_name`. On Apify, `apify-default-dataset-item` is not billed unless you add a price for it. Do not. Off-platform, the SDK prices an unknown event at $1 in `ACTOR_TEST_PAY_PER_EVENT` mode, so a local pay-per-event simulation must list that synthetic event at $0 or the simulated cap will trip on every row.
- **Resume.** Progress is stored as `SEO_AUDIT_STATE`. A restarted run does not fetch, charge, or push a page that record already accepted. `Actor.charge` idempotency keys also suppress a repeat for about three minutes; the saved record is what covers a later restart. A crash in the moment after a dataset push and before that record is marked emitted can leave a duplicate row. The charge is not repeated once the record is saved.
- **robots.txt.** A 401 or 403 blocks that origin. Other failures allow the crawl. `Crawl-delay` is not read; concurrency limits are the cap.
- **Charset** comes from the `Content-Type` header, otherwise UTF-8. A `<meta charset>` that disagrees is not applied.

# Actor input Schema

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

Pages that start the audit. The crawler stays on the same site as each start URL (www and the bare domain are one site; other subdomains are not). HTTP and HTTPS only. URLs with a username or password are rejected.

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

Maximum accepted page audits in this run. When pay-per-event pricing is on, each accepted audit is one page-audited event at $0.01 ($10 per 1,000), including HTTP errors, failed fetches, and non-HTML responses. robots.txt and sitemap files are not charged. 25 pages = $0.25, 100 pages = $1.00, 1,000 pages = $10.00. The platform also bills one apify-actor-start event ($0.00005) for the default 512 MB; that is one event up to and including 1 GB, not a half-GB fraction.

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

Link hops from a start URL or sitemap URL. 0 audits only the start URLs and, in sitemap mode, the sitemap URLs.

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

Also queue same-site URLs from the sitemap named in robots.txt, or from /sitemap.xml. Sitemap indexes and .gz files are read up to a fixed cap. Reading sitemap files is not charged. Setting sitemap URLs below turns this on.

## `sitemapUrls` (type: `array`):

Sitemap or sitemap index URLs to read instead of auto-discovery. They must be on the same site as a start URL. This turns sitemap mode on. These fetches are not charged.

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

If set, only matching URLs are audited, except the start URLs, which are always eligible. Empty means the whole site within the other limits.

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

Matching URLs are not audited. A start URL that matches an exclude pattern fails the run.

## `urlPatternSyntax` (type: `string`):

Regex searches the URL. A glob matches the whole URL; a glob that does not start with http://, https://, or \* may match anywhere, for example /blog/\*.

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

How many page fetches may run at once, across all sites in the run.

## `perHostConcurrency` (type: `integer`):

How many fetches may run at once for one site. This stays at or below max concurrency.

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

Time limit for each attempt, including connect. Redirect hops and retries use this same limit and are not extra charges.

## `maxResponseBytes` (type: `integer`):

Cap for the decompressed body of one response. Larger bodies are not parsed. The cap cannot be turned off.

## `maxRetries` (type: `integer`):

Extra attempts after a connection failure, timeout, or HTTP 429/502/503/504. Retries are not charged.

## `redirectChainThreshold` (type: `integer`):

A chain with more hops than this is an issue. One hop (for example HTTP to HTTPS) is not flagged when this is 1. Hops are not extra charges.

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

Skip URLs disallowed for the WebsiteSeoAudit token. A skipped URL is reported and is not charged. A 401 or 403 robots.txt disallows the whole origin. Other robots.txt failures allow the crawl.

## Actor input object example

```json
{
  "startUrls": [
    {
      "url": "https://example.com/"
    }
  ],
  "maxPages": 10,
  "maxDepth": 5,
  "useSitemap": false,
  "sitemapUrls": [],
  "includeUrlPatterns": [],
  "excludeUrlPatterns": [],
  "urlPatternSyntax": "regex",
  "maxConcurrency": 4,
  "perHostConcurrency": 2,
  "requestTimeoutSecs": 20,
  "maxResponseBytes": 2000000,
  "maxRetries": 2,
  "redirectChainThreshold": 1,
  "respectRobotsTxt": true
}
```

# Actor output Schema

## `overview` (type: `string`):

One row per audited or robots-skipped URL, with the heuristic score, title, and issue summary.

## `csv` (type: `string`):

The same rows as a flat CSV. Nested issue objects are not included; use issuesText and fixesText.

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

Pages charged, issue counts, score bands, sitemap stats, and the billing rules for this run.

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

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

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

```

## MCP server setup

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