# SEO Audit Tool - On-Page SEO Checker & Broken Links (`glasswing/seo-onpage-audit`) Actor

On-page SEO audit for a list of URLs or a capped sitemap crawl: status, redirects, title and meta checks, headings, canonical, hreflang, robots, JSON-LD, Open Graph, alt text, broken links, fix hints and a 0-100 score per page. JSON, CSV, Excel.

- **URL**: https://apify.com/glasswing/seo-onpage-audit.md
- **Developed by:** [Raffy](https://apify.com/glasswing) (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 $3.50 / 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.
Since this Actor supports Apify Store discounts, the price gets lower the higher subscription plan you have.

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

### What does SEO Audit Tool do?

SEO Audit Tool runs an **on-page SEO audit** for every URL you give it and returns one row per page as JSON, CSV or Excel: HTTP status, redirect chain, title and meta description checks, H1-H6 outline, canonical, hreflang, robots rules, JSON-LD, Open Graph, image alt coverage, broken links, a list of issues with a fix hint for each, and a 0-100 score. Paste a list of pages, or switch on the site crawl to add more pages of the same sites from their `sitemap.xml`. No browser, no API key, no login.

Typical use cases:

- **Quick site checks:** audit your key pages (home, pricing, top landing pages) and see exactly what to fix first, sorted by severity.
- **Agency reports and monitoring:** schedule a weekly run for client sites and track `score`, `criticalCount` and `brokenLinkCount` over time.
- **Pre-launch and migration checks:** verify redirects, canonicals, `noindex` and robots.txt rules across a list of URLs before and after a release.

It audits only the URLs you supply (plus, if you ask, pages of those same sites found in their sitemap). It does **not** log in, solve challenges or run JavaScript, so it sees the HTML a search engine gets before rendering.

#### Result status (tri-state output)

| `status` | Meaning | Billed? |
|---|---|---|
| `ok` | The page was fetched as HTML and audited. | Yes |
| `not_found` | The page answers HTTP 404 or 410. | No |
| `error` | The page could not be fetched or is not HTML. `error` says why (for example `ENOTFOUND`). | No |

If not a single page could be audited, the run is marked failed so schedules and agents notice.

### What data can SEO Audit Tool extract?

| Field | Description |
|---|---|
| `url`, `requestedUrl`, `finalUrl` | The page as listed, as requested, and after all redirects. |
| `statusCode`, `redirectCount`, `redirectChain` | HTTP status of the final response, number of hops, and every hop as `{url, statusCode}`. |
| `responseTimeMs`, `contentType`, `htmlBytes` | Download time, content type and HTML size. |
| `robotsTxtAllowed`, `metaRobots`, `xRobotsTag`, `indexable` | robots.txt rule for the page, meta robots, X-Robots-Tag header, and a combined indexability verdict. |
| `score` | 0-100: 100 minus 20 per critical, 6 per warning and 2 per notice issue. |
| `issueCount`, `criticalCount`, `warningCount`, `noticeCount` | Number of issues, in total and by severity. |
| `issues` | List of `{code, severity, message, fix}`, most severe first. |
| `title`, `titleLength` | Title tag and its length (aim for 30-60). |
| `metaDescription`, `metaDescriptionLength` | Meta description and its length (aim for 70-160). |
| `h1`, `h1Count`, `headingCounts`, `headingOutline` | H1 texts, counts of h1-h6, and the heading outline in page order. |
| `canonical`, `canonicalStatus` | Canonical URL and whether it is `self`, `other`, `missing` or `invalid`. |
| `hreflang`, `lang`, `hasViewport`, `charset` | Language alternates and basic head tags. |
| `jsonLdTypes`, `jsonLdBlocks`, `jsonLdInvalidBlocks` | schema.org types found and JSON-LD blocks that do not parse. |
| `openGraph`, `twitterCard` | Open Graph tags (without the `og:` prefix) and the Twitter card type. |
| `wordCount`, `imageCount`, `imagesMissingAlt`, `imageAltCoverage` | Visible words and image alt statistics. |
| `internalLinkCount`, `externalLinkCount`, `nofollowLinkCount` | Link counts. |
| `linksChecked`, `brokenLinkCount`, `brokenLinks` | Links tested for 404 and server errors, and the broken ones. |
| `source` | `input`, `sitemap` or `link`: where the page came from. |
| `status`, `error`, `scrapedAt` | Tri-state status, the reason for non-ok rows, and the time of the audit. |

### How to run an SEO audit with SEO Audit Tool

1. Open the Actor in Apify Console and click **Try for free**.
2. Paste page URLs or bare domains into **Page URLs**, one per line.
3. Optionally switch on **Also crawl the site** and set **Maximum pages**.
4. Set **Broken-link checks per page** (0 switches the check off).
5. Click **Start**. The default input finishes in a few seconds.
6. Open the **Output** tab or **Export** the dataset as JSON, CSV, Excel, XML or HTML.

To automate it, use the **API** tab (Node.js, Python, curl examples) or add a **Schedule**.

### How much does it cost to run an SEO audit?

This Actor uses **pay-per-event** pricing:

| Event | Price |
|---|---|
| Actor start | $0.005 per run ($0.0045 on Scale, $0.004 on Business and up) |
| Page audited (`status: ok` row) | $0.00575 on Free, $0.005 on Starter, $0.00425 on Scale, $0.0035 on Business and up |

Example: auditing 100 pages on the Free plan costs about $0.58 ($0.005 start + 100 x $0.00575).

Rows with `status` `not_found` or `error` are never billed. Cap spending with **Maximum pages** and the run's **Max total charge** option.

### Input

| Field | What it does |
|---|---|
| `startUrls` | Pages to audit, full URLs or bare domains (default: two sample pages). |
| `crawlSite` | Add more pages of each listed site from its `sitemap.xml` (or the Sitemap lines of robots.txt; on-page links if there is no sitemap). Default `false`. |
| `maxItems` | Stop after this many pages, 1 to 5,000 (default 20). |
| `maxLinkChecks` | Links tested per page for 404s and server errors, 0 to 200 (default 20, internal links first). Links shared by many pages are tested once per run. |
| `checkExternalLinks` | Include links to other sites in the broken-link check (default `true`). |

Example input:

```json
{
    "startUrls": ["https://www.python.org", "https://developer.mozilla.org"],
    "crawlSite": true,
    "maxItems": 10,
    "maxLinkChecks": 20
}
```

### Output

Real row from a run (lists shortened):

```json
{
    "url": "https://www.python.org/",
    "status": "ok",
    "statusCode": 200,
    "redirectCount": 0,
    "responseTimeMs": 6,
    "robotsTxtAllowed": true,
    "indexable": true,
    "score": 92,
    "issueCount": 4,
    "criticalCount": 0,
    "warningCount": 0,
    "noticeCount": 4,
    "issues": [
        {
            "code": "title_too_short",
            "severity": "notice",
            "message": "Title is only 21 characters (aim for 30-60).",
            "fix": "Lengthen the <title> to 30-60 characters with a descriptive keyword phrase."
        }
    ],
    "title": "Welcome to Python.org",
    "metaDescriptionLength": 52,
    "h1Count": 5,
    "canonicalStatus": "missing",
    "jsonLdTypes": ["WebSite"],
    "imageAltCoverage": 100,
    "internalLinkCount": 126,
    "externalLinkCount": 79,
    "linksChecked": 20,
    "brokenLinkCount": 0,
    "source": "input"
}
```

### Tips

- Put all pages in **one run**: you pay the start fee once.
- With the site crawl on, a few start URLs plus a **Maximum pages** cap give a quick sample of each site. For big sites, raise the cap gradually.
- Sort by `score`, or filter `criticalCount > 0`, to get the fix list.
- Set `maxLinkChecks` to 0 for the fastest, link-free audit.

### Limitations

- **HTML only, no JavaScript.** Pages that build their content in the browser are audited as served; a page that is an empty shell scores accordingly.
- **No Core Web Vitals or backlink data.** `responseTimeMs` is the HTML download time, not a speed test.
- **The crawl is sitemap-based and capped** (at most 5,000 pages per run). It is a page audit, not a full spider.
- **robots.txt is honoured** for crawled pages, and reported as `robotsTxtAllowed` for pages you list yourself. The Actor does not work around blocks.
- Two listed or crawled URLs that redirect to the same final page (for example `/` and `/en-US/`) produce one row and one charge; the second is skipped.
- Requests are polite: at most 2 at a time and about 4 per second per host, and link checks run 4 at a time.
- Sites change; if a field looks wrong, report it in the **Issues** tab with the run ID.

### FAQ

#### Do I need an API key or a login?

No. The Actor requests the public pages you list, like a search engine would.

#### Is it legal to audit a website?

You supply the URLs and the Actor reads only public pages, respecting robots.txt for crawled pages. Audit sites you own or have permission to check, and see the notice below.

#### Can I use this Actor from an AI agent or MCP client?

Yes. Called with no arguments it audits two sample pages; every input is a plain string, number or list, and each row explains itself with `status`, `error` and `issues[].fix`.

#### Why is a page `error` or `not_found`?

`not_found` means the page answers 404 or 410. `error` means it could not be fetched (DNS failure, timeout, blocked) or is not HTML. Both are free.

#### How is the score calculated?

100 minus 20 per critical issue (for example `noindex`, a missing title, robots.txt blocking, broken internal links), 6 per warning and 2 per notice, never below 0.

### Legal and data-protection notice

This Actor reads only pages that are publicly reachable at the URLs you supply (and, if you switch on the site crawl, pages of the same sites listed in their sitemap). It does not log in or get around any access control, and it records page metadata (titles, headings, links, technical tags) rather than personal data. Page text such as headings can nevertheless mention people, so your results could contain personal data. Personal data is protected by the GDPR in the European Union and by other regulations around the world. You should not scrape personal data unless you have a legitimate reason to do so. If you are unsure whether your reason is legitimate, consult your lawyers. You are responsible for complying with the terms of the sites you audit and applicable law.

This Actor is an independent tool and is not affiliated with, endorsed by or sponsored by Google or any audited website. All trademarks belong to their respective owners.

# Changelog

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

# Actor input Schema

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

Pages to audit, one per line. Full URLs (https://example.com/pricing) or bare domains (example.com). With the site crawl on, these are also the sites to crawl.

## `crawlSite` (type: `boolean`):

Add more pages of each listed site, read from its sitemap.xml (or the Sitemap lines in robots.txt; on-page links if there is no sitemap). robots.txt is honoured for crawled pages. The total stays within Maximum pages.

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

Stop after this many pages (dataset rows). Each page audited with status `ok` is one billable result; 404 and error rows are free. Hard cap 5,000 per run.

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

How many links on each page to test for 404s and server errors (internal links first). 0 switches the check off. Links shared by many pages are tested once per run. Hard cap 200.

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

Include links to other sites in the broken-link check (after the internal ones).

## Actor input object example

```json
{
  "startUrls": [
    "https://crawlee.dev/",
    "https://docs.apify.com/"
  ],
  "crawlSite": true,
  "maxItems": 6,
  "maxLinkChecks": 10,
  "checkExternalLinks": true
}
```

# Actor output Schema

## `results` (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": [
        "https://crawlee.dev/",
        "https://docs.apify.com/"
    ],
    "crawlSite": true,
    "maxItems": 6,
    "maxLinkChecks": 10
};

// Run the Actor and wait for it to finish
const run = await client.actor("glasswing/seo-onpage-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 = {
    "startUrls": [
        "https://crawlee.dev/",
        "https://docs.apify.com/",
    ],
    "crawlSite": True,
    "maxItems": 6,
    "maxLinkChecks": 10,
}

# Run the Actor and wait for it to finish
run = client.actor("glasswing/seo-onpage-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 '{
  "startUrls": [
    "https://crawlee.dev/",
    "https://docs.apify.com/"
  ],
  "crawlSite": true,
  "maxItems": 6,
  "maxLinkChecks": 10
}' |
apify call glasswing/seo-onpage-audit --silent --output-dataset

```

## MCP server setup

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