# SEO Audit API - On-Page Score, Issues and Fixes (`stas_k/seo-audit-api`) Actor

Most SEO checkers fetch raw html, so a javascript page scores as an empty shell and you still pay for the row. This one opens every url in its own Chromium: a 0-100 score, each issue with severity and a fix, and a page it could not read comes back free with a reason.

- **URL**: https://apify.com/stas_k/seo-audit-api.md
- **Developed by:** [Stas K](https://apify.com/stas_k) (community)
- **Categories:** SEO tools, Developer tools
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 1 bookmarks
- **User rating**: No ratings yet

## Pricing

$10.00 / 1,000 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 Audit API - on-page score, issues and fixes

Opens a page in a real Chromium and turns what it finds into a number you can act on:
a score from 0 to 100, and a list of issues where each one carries a severity, the
points it took away, and the sentence that says what to change.

One row per page. Payment is per audited page, and a page that could not be read is
free with a reason a human can act on.

### Why this exists

Two things are wrong with the SEO checkers that are already on the store, and both of
them are visible from the outside:

1. Most of them fetch raw html with an http client. On a site that renders with
   javascript, that returns an empty shell, and the shell scores as a page with no
   title and no text. The report looks precise and says nothing true.
2. Many charge per page whether or not the page was read. A 404, a pdf, a timeout and
   a real audit can land on the same invoice.

This actor opens every url in its own browser, reads the page as a visitor sees it,
and never charges for a row it could not fill.

### What the score means

The score starts at 100 and every triggered check takes its own penalty away. Nothing
is hidden: add the `points` of the issues in the row, subtract the sum from 100, and
you get the score back. Grades: `good` at 80 and above, `needs-improvement` from 50 to
79, `poor` below 50.

| check | severity | points | what it means | what to do |
|---|---|---|---|---|
| `title-missing` | critical | 20 | The page has no title tag. | Add a unique title of 30 to 65 characters; it is the line a search result shows. |
| `title-length` | warning | 6 | The title is outside the 30 to 65 character window. | Rewrite the title so the whole line is shown instead of being cut with an ellipsis. |
| `description-missing` | critical | 12 | The page has no meta description. | Add a meta description of 70 to 165 characters; the search engine may use it as the snippet. |
| `description-length` | warning | 5 | The meta description is outside the 70 to 165 character window. | Shorten or expand it so it is not cut in the snippet. |
| `h1-missing` | critical | 12 | The page has no h1. | Add one h1 that names what the page is about. |
| `h1-multiple` | warning | 5 | The page has more than one h1. | Keep one h1 and move the rest to h2. |
| `canonical-missing` | warning | 5 | The page does not declare a canonical url. | Add rel=canonical with the preferred url so duplicates do not split the signals. |
| `noindex` | critical | 25 | The page tells search engines not to index it. | Remove noindex from the robots meta tag if this page should be found. |
| `lang-missing` | notice | 4 | The html tag does not declare a language. | Add lang to the html tag, for example lang=en. |
| `viewport-missing` | warning | 8 | The page has no viewport meta tag. | Add the viewport meta tag so the page scales on a phone. |
| `images-alt` | warning | 8 | More than a fifth of the images have no alt text. | Describe each meaningful image in alt; leave alt empty only for decoration. |
| `images-alt-few` | notice | 4 | Some images have no alt text. | Describe each meaningful image in alt; leave alt empty only for decoration. |
| `structured-data-missing` | notice | 3 | The page carries no JSON-LD structured data. | Add JSON-LD for the type that fits the page, for example Article or Product. |
| `structured-data-invalid` | warning | 6 | A JSON-LD block on the page is not valid JSON. | Fix the JSON inside the script tag; a broken block is ignored by search engines. |
| `social-missing` | warning | 5 | The page has no Open Graph tags. | Add og:title, og:description and og:image so shared links show a card. |
| `twitter-missing` | notice | 2 | The page has no Twitter card tags. | Add twitter:card and twitter:title if links to this page are shared on social media. |
| `thin-content` | warning | 8 | The page has very little readable text. | Add the text a visitor needs; a page with almost no words has little to rank on. |
| `no-internal-links` | notice | 4 | The page links to no other page of the same site. | Link to related pages so a crawler can reach them from here. |
| `empty-anchors` | notice | 2 | Some links have no text and no image. | Give each link text or an image, otherwise its destination is not described. |
| `meta-robots-nofollow` | notice | 3 | The page tells search engines not to follow its links. | Remove nofollow from the robots meta tag unless you really want the links ignored. |

Total penalty available: 147 points, so a page with everything wrong scores 0.

Title window 30 to 65 characters, meta description window
70 to 165, thin content below 150 words.
These are published ranges where a search result shows the whole line instead of
cutting it; being outside them costs points but is never called critical.

### What is free, and why

Every one of these comes back as its own row with `billable: false` and a reason:

- `NOT_CHECKED_INVALID` - the line is not an http url.
- `NOT_CHECKED_DUPLICATE` - the same url came earlier in the list.
- `NOT_CHECKED_LIMIT` - the url is beyond `maxPages`.
- `NOT_CHECKED_PRIVATE_ADDRESS` - a host name answered with a non public address.
- `NOT_CHECKED_DNS_ERROR` - the host name does not resolve, or is not a valid name.
- `NOT_CHECKED_TIMEOUT` - the page did not finish loading in `pageTimeoutSecs`.
- `NOT_CHECKED_HTTP_ERROR` - the page answered 4xx or 5xx.
- `NOT_CHECKED_NOT_HTML` - the response is a pdf, an image or something that is not a page.
- `NOT_CHECKED_PROBE_ERROR` - Chromium could not read the page.
- `NOT_CHECKED_TIME`, `NOT_CHECKED_CAP`, `NOT_CHECKED_BILLING`, `NOT_CHECKED_ERROR` -
  the run stopped before this page; the summary says why.

A redirect into the private network, and a page that loads something from a private
address, are recognised after the browser has already asked for it, and such a page is
never charged. This is written plainly instead of promising that the request was
stopped: a route handler in this browser does not see every hop. A host name that does
not resolve at all is not a private address, and such a page is audited as usual.

### Input

- `urls` - one page url per line.
- `maxPages` - default 10; urls beyond it are free.
- `strategy` - `mobile` (412 px, phone user agent) or `desktop` (1440 px).
- `settleSecs` - how long the page keeps running after load before the signals are read.
- `pageTimeoutSecs` - default 45.
- `ignoreHttpsErrors` - for a staging site with a self signed certificate.

### Output

One row per page, in the default dataset. The fields that matter most:

Real row from a local run against example.com, not an illustration:

```json
{
  "url": "https://example.com/",
  "status": "OK",
  "billable": true,
  "title": "Example Domain",
  "titleLength": 14,
  "metaDescription": null,
  "h1Count": 0,
  "canonical": null,
  "noindex": false,
  "images": 0,
  "internalLinks": 0,
  "wordCount": 125,
  "seoScore": 43,
  "seoGrade": "poor",
  "issues": [
    {
      "code": "description-missing",
      "severity": "critical",
      "points": 12,
      "message": "The page has no meta description.",
      "fix": "Add a meta description of 70 to 165 characters; the search engine may use it as the snippet."
    },
    {
      "code": "h1-missing",
      "severity": "critical",
      "points": 12,
      "message": "The page has no h1.",
      "fix": "Add one h1 that names what the page is about."
    },
    {
      "code": "thin-content",
      "severity": "warning",
      "points": 8,
      "message": "The page has very little readable text.",
      "fix": "Add the text a visitor needs; a page with almost no words has little to rank on."
    },
    {
      "code": "title-length",
      "severity": "warning",
      "points": 6,
      "message": "The title is outside the 30 to 65 character window.",
      "fix": "Rewrite the title so the whole line is shown instead of being cut with an ellipsis."
    },
    {
      "code": "canonical-missing",
      "severity": "warning",
      "points": 5,
      "message": "The page does not declare a canonical url.",
      "fix": "Add rel=canonical with the preferred url so duplicates do not split the signals."
    },
    {
      "code": "social-missing",
      "severity": "warning",
      "points": 5,
      "message": "The page has no Open Graph tags.",
      "fix": "Add og:title, og:description and og:image so shared links show a card."
    },
    {
      "code": "no-internal-links",
      "severity": "notice",
      "points": 4,
      "message": "The page links to no other page of the same site.",
      "fix": "Link to related pages so a crawler can reach them from here."
    },
    {
      "code": "structured-data-missing",
      "severity": "notice",
      "points": 3,
      "message": "The page carries no JSON-LD structured data.",
      "fix": "Add JSON-LD for the type that fits the page, for example Article or Product."
    },
    {
      "code": "twitter-missing",
      "severity": "notice",
      "points": 2,
      "message": "The page has no Twitter card tags.",
      "fix": "Add twitter:card and twitter:title if links to this page are shared on social media."
    }
  ]
}
```

The run summary is written to the named store `seo-audit-api-summary` under
`RUN_SUMMARY-<runId>`, and to the run's own store under `RUN_SUMMARY`. It carries the
counters, `byGrade`, `duplicateTitles` (the same title on two pages of one run is a
problem a single page cannot see), the address guard counters and the stop reason.

### Price

Charged per audited page, event `page-audited`, only when the row carries an audit.
The price itself is set on the actor page and is not repeated here, so this file cannot
drift away from the card.

### What this actor does not do

Said plainly, because an audit tool that implies everything is worse than one that
names its edges:

- It does not crawl a site. It audits the pages you give it.
- It does not read backlinks, domain authority or traffic.
- It does not call Google, does not use a Google key and does not guess search positions.
- It does not measure Core Web Vitals; the measurements are of the page as a document,
  not of its speed.
- It does not see inside an iframe.

### Limits and run time

- One browser for the whole run, warmed once, so the cold start is not charged to the
  first page.
- The deadline is watched before each page: if less time is left than one page needs in
  the worst case, the rest comes back free with `NOT_CHECKED_TIME` instead of the
  platform killing the run mid page.
- `maxPages` defaults to 10 and the summary reports the limit actually applied.
- The subresource host list is capped at 25 names for the address guard, and the row
  says when it was cut (`resourceHostsTruncated`).

# Actor input Schema

## `urls` (type: `array`):

One page url per line. Every page is opened in a real Chromium and audited once. A line that is not a url comes back as its own free row with the reason, and a url that repeats is free as well.

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

The list is cut here, and urls beyond the limit come back free with status NOT_CHECKED_LIMIT. 0 means the default of 10, and the summary reports the number actually applied.

## `strategy` (type: `string`):

mobile uses a phone viewport and user agent, which is what a search engine mostly indexes; desktop uses a 1440 px window. The row says which profile was used, so two audits are only comparable on the same profile.

## `settleSecs` (type: `integer`):

How long the page keeps running after the load event before the signals are read. Content that arrives from a timer rather than a request lands in this window; 0 reads immediately after load.

## `pageTimeoutSecs` (type: `integer`):

A page that does not finish loading in this many seconds comes back free with status NOT_CHECKED_TIMEOUT. Raising it costs run time, not money.

## `ignoreHttpsErrors` (type: `boolean`):

Turn this on only for a staging site with a self signed certificate. Every other run checks the certificate normally.

## Actor input object example

```json
{
  "urls": [
    "https://example.com",
    "https://apify.com",
    "https://developer.mozilla.org"
  ],
  "maxPages": 10,
  "strategy": "mobile",
  "settleSecs": 2,
  "pageTimeoutSecs": 45,
  "ignoreHttpsErrors": false
}
```

# Actor output Schema

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

One row per page. status is OK when the row carries a real audit, or NOT_CHECKED\_\* with the reason in plain words: INVALID (the line is not an http url), DUPLICATE (the same url came earlier), LIMIT (beyond maxPages), PRIVATE_ADDRESS (a host name really answered with a non public address, whether the page host, a redirect hop or a host the page loads from; a redirect and a loaded resource are recognised after the browser has already asked, and such a row is never charged, while a name that does not resolve at all is not a private address and does not block the page), DNS_ERROR (the host name does not resolve or is not a valid host name), TIMEOUT (the page did not finish loading in pageTimeoutSecs), HTTP_ERROR (the page answered 4xx or 5xx), NOT_HTML (the response is a pdf, an image or anything else that is not a page), PROBE_ERROR (Chromium could not read the page), and TIME, CAP, BILLING and ERROR when the run stopped before this page for the reason in the summary. The signals: title and titleLength, metaDescription and metaDescriptionLength, h1 with the first heading text, h1Count, h2Count, h3Count, canonical, metaRobots, noindex, nofollow, htmlLang, viewport, charset, ogCount with ogTitle and ogImage, twitterCount, jsonLdBlocks with jsonLdTypes and jsonLdInvalid, images and imagesMissingAlt, internalLinks, externalLinks, nofollowLinks, emptyAnchors, hreflangCount, wordCount, bodyChars. The judgement: seoScore from 0 to 100, seoGrade (good at 80 and above, needs-improvement from 50 to 79, poor below 50), issues as a list of code, severity, points, message and fix, with issueCount, criticalIssues, warningIssues, noticeIssues and penalty. The penalty is the sum of the points of the issues, so 100 minus the penalty gives the score back. httpStatus, contentType, finalUrl and redirects say where the browser ended up. resourceHosts lists at most 25 host names the page loads from, resourceHostsTotal is how many were seen and resourceHostsTruncated says the list was cut. billable is a claim about the price list; the money actually taken is chargedEvents in the summary.

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

Run summary. requested is how many lines were sent, blank lines included; processed plus notChecked always equals requested. delivered counts OK rows, rowsWritten counts every row written, chargedEvents is what the platform charged, billingActive says whether this run could bill at all and billingReason says why not. chargedEvents and delivered are the same number unless a charge failed: deliveredUncharged counts those rows and chargeErrors the attempts, writeErrors counts rows the dataset refused. stopReason is null, spending-cap, charge-error, dataset-write-error, deadline, billing-price-unknown or unexpected-error, and unexpectedError carries the reason for the last one. byStatus is the full breakdown, byGrade counts good, needs-improvement and poor pages. duplicateTitles counts pages whose title repeats an earlier page of this run and pagesWithDuplicateTitle counts the titles involved, because one page cannot see that problem on its own. cutByMaxPages is the tail the limit cut and maxPages the limit actually applied. deadlineCapped says the clock stopped the run and pageMarginSecs is the margin that check used. privateBlocked counts every page the address guard stopped, privateSubresourceBlocked the part that came from a loaded resource, dnsErrors the host names that did not resolve, subresourceDnsSkipped the loaded names that did not resolve at all and so blocked nothing, pagesWithTruncatedHostList the pages whose host list was cut at 25 names, subresourceHostLookups how many names the guard resolved; httpErrors, notHtml, timeouts and probeErrors count the other free rows by cause. datasetItemCount is our own count of written rows, datasetItemCountApi the same as the platform reported it, datasetItemCountNote explains a gap. The named store keeps one object per run under RUN_SUMMARY-<runId>.

# 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 = {
    "urls": [
        "https://example.com",
        "https://apify.com",
        "https://developer.mozilla.org"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("stas_k/seo-audit-api").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 = { "urls": [
        "https://example.com",
        "https://apify.com",
        "https://developer.mozilla.org",
    ] }

# Run the Actor and wait for it to finish
run = client.actor("stas_k/seo-audit-api").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 '{
  "urls": [
    "https://example.com",
    "https://apify.com",
    "https://developer.mozilla.org"
  ]
}' |
apify call stas_k/seo-audit-api --silent --output-dataset

```

## MCP server setup

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

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/BKzDQ5Q64qIBalqJF/builds/1GYRIV1DTCfV6fBBb/openapi.json
