# Broken Link Checker — same-host crawl and failing links (`hermeskd/broken-links`) Actor

Crawl a site from a start URL or sitemap, obeying robots.txt and at most two requests a second. Check each link and asset once; report broken and redirected links with status, redirect chain, anchor text and source pages, plus a summary.

- **URL**: https://apify.com/hermeskd/broken-links.md
- **Developed by:** [Logan Parker](https://apify.com/hermeskd) (community)
- **Categories:** SEO tools, Developer tools, Agents
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $0.40 / 1,000 link checkeds

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

Give it a start URL or a sitemap; it crawls pages of the same site (up to your page limit, obeying robots.txt, at most two requests a second), checks every link and asset once, and returns each broken or redirected link with its status, redirect chain, anchor text and the pages it was found on, plus a summary.

Development validation produced actual successful public-input records using the production Dockerfile and SDK entrypoint on GitHub-hosted Linux. The smoke input, all three tasks and every defined benchmark passed their exact expectations. The independent review completed on 2026-10-19; its findings are tracked in the committed fix report. Platform costs, settlement, publication and daily tests remain unverified.

### Call it from an agent

Through Apify's MCP server (https://mcp.apify.com) use `call-actor`:

```json
{
  "actor": "hermeskd/broken-links",
  "input": {
    "startUrl": "https://docs.apify.com/platform/actors/publishing/monetize",
    "maxPages": 1,
    "checkExternal": false
  },
  "callOptions": {
    "maxTotalChargeUsd": 0.05,
    "timeout": 3600
  },
  "waitSecs": 30
}
```

Then call `get-dataset-items` with the returned defaultDatasetId. Dedicated tool URL: https://mcp.apify.com?tools=hermeskd/broken-links

### Input

| Field | Type | Meaning |
|---|---|---|
| `startUrl` | string | Exactly one startUrl or sitemapUrl is required. |
| `sitemapUrl` | string | Alternative sitemap entry point; same-host pages only. |
| `maxPages` | integer | Maximum successfully parsed same-host HTML pages. |
| `checkExternal` | boolean | Check external links but never crawl external pages. |
| `reportRedirects` | boolean | Return successful redirected link findings, in addition to failures. |

### Output

| Field | Meaning |
|---|---|
| `type` | Link finding or final crawl summary. |
| `url` | Checked URL, or crawl entry point on summary/error records. |
| `status` | Final HTTP status; null when no response. |
| `ok` | False for broken/error records. These are never charged. |
| `redirectChain` | Redirect destination URLs in observed order. |
| `anchorText` | First anchor text observed, capped at 500 characters. |
| `foundOn` | At most ten referring page URLs. |
| `summary` | All attempted unique checks and successful parsed page counts; linksChecked is not billable count. |
| `error` | Failure, always uncharged. |

Actual production-container record from 2026-10-18T20:25:14.282887+00:00 (code `f063187693578dd7551fa2bec552281e2f0f3e33`, smoke input, SDK local storage). The saved record is unchanged; local event logs do not prove Apify settlement.

```json
{
  "type": "summary",
  "url": "https://docs.apify.com/platform/actors/publishing/monetize",
  "ok": true,
  "summary": {
    "pagesCrawled": 1,
    "linksChecked": 53,
    "broken": 0,
    "redirected": 1
  }
}
```

The saved example above records the October 18 source and its exact code pin. The approved live page changed by October 19: both reviewed and repaired extractors find 52 same-host targets, confirmed by all five new production-container cases. The manifest retains exact checks for that observed inventory; the committed fix report records the source hashes and final validation. This does not change prices or make failed checks billable.

### Events and prices

| Event | Title | Charged when | FREE / BRONZE | SILVER | GOLD / PLATINUM / DIAMOND |
|---|---|---|---|---|---|
| `link-checked` | Link checked | One successful unique link or asset check, backed by a readable successful summary. | $0.0005 | $0.00045 | $0.0004 |
| `page-crawled` | Page crawled | One successfully fetched and parsed site page, backed by a readable successful summary. | $0.001 | $0.0009 | $0.0008 |

Platform usage is not passed through. Apify's automatic actor-start event remains $0.00005 per started GB (one GB or less counts once). The synthetic dataset-item event is absent. Charge limits stop further paying work; unprocessed inputs receive uncharged errors. Completed readable pending events are settled on abort.

Worked example: two successful unique checks and one 404 on one parsed page cost $0.002 at list ($0.001 for two checks plus $0.001 for the page), plus actor start. linksChecked is three; link-checked events are two. Duplicate checks, broken/error findings and failed/unreadable summaries add no events.

### Limits and run time

One startUrl or sitemapUrl; maxPages 1–1,000. Same-host HTML crawling only; external links may be checked but are not crawled. At most 100,000 unique checks, 10 MiB per fetched page/GET fallback, ten foundOn pages per finding. HEAD falls back to GET for 405 or 501; an ordinary bodyless successful HEAD is sufficient. Fragments and duplicate targets share one check. All HTTP requests are at most two per host per second. linksChecked counts attempts and is not the billable count. Broken findings, policy refusals, transport failures and errors are never charged. A failed/timeout or unreadable summary backs no charges, including previously completed checks.

Default run timeout is 3600 seconds. Typical cold platform time, costs and the smallest passing memory have not been measured for this new implementation. Memory probes are evidence to collect later; configured memories are specification defaults, not measured claims.

### Errors

| Code | Meaning |
|---|---|
| `login_required` | The page requires authentication or is a sign-in wall; no authentication was attempted. |
| `robots_disallowed` | robots.txt forbids fetching the URL; no request was made to it. |
| `blocked_host` | The host is on the deny-list or resolves to a private or local address; no request was made. |
| `download_failed` | The request or connection failed within its bounded deadline. |
| `http_error` | The source answered an unsuccessful HTTP status. |
| `unsupported_content_type` | An HTML audit/crawl received a non-HTML representation. |
| `too_large` | A documented response, expansion or traversal cap was exceeded. |
| `source_schema_changed` | A source or tool response no longer has the verified protocol shape. |
| `timeout` | The input did not finish within the run's time budget. |
| `invalid_input` | The run input passed the input schema but cannot be used; the message names the field. |
| `internal_error` | Unexpected failure; the message carries the error class. |
| `charge_limit_reached` | The run reached its maximum total charge; this input was not processed. |

No failure record is charged. A run fails only when all input outcomes are Actor-side failures; caller errors and a mixture of caller/Actor failures do not fail the run.

### Sources and terms

Only process content you have the right to process. URL fetches obey HermesBot robots-group selection, the shared deny-list, public-address checks on connections and redirects, honest identity, deadlines and rate limits. No caller credentials, cookies, CAPTCHA solving, residential proxies or evasion. Only same-host HTML pages are crawled. External links may be checked when requested, and are never crawled. Sign-in walls are refused without authentication. Broken and error findings are free; successful checks and parsed pages are charged only after a successful readable summary. A failed or unreadable summary backs no charges. Initial source HEAD observations were expectations. The 2026-10-18 GitHub-hosted production-container crawl produced the real records shown above, through the guarded SDK path. Responsive-image srcset candidates, picture/source srcset and video poster assets now use the same unique checks; every failed check remains free.

### Not affiliated

This Actor is not affiliated with Google, Apify, IANA, Verisign or other named protocol/source providers. Third-party names describe compatibility and source material.

### Related Hermes Actors

website-screenshot, lighthouse-audit, seo-page-audit, domain-availability, dns-and-email-auth, broken-links and sitemap-urls.

### Changelog

2026-10-17 (historical): initial implementation and fixture contracts; packaging and public production validation were incomplete on that date.

2026-10-18: all six production images, public smoke inputs, three tasks per Actor and defined benchmarks passed on GitHub-hosted Linux; exact code, records and image provenance are retained with the examples. These local SDK runs do not prove platform costs, settlement, publication, minimum memory, daily tests or payouts.

2026-10-19: independent-review repairs cover DNS privacy, malformed publisher URLs, empty sitemap failures, responsive assets and schema prefill, as applicable to this Actor. See the committed unit 4 fix report for measured verification and remaining platform NO-COVERAGE.

# Actor input Schema

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

Exactly one startUrl or sitemapUrl is required.

## `sitemapUrl` (type: `string`):

Alternative sitemap entry point; same-host pages only.

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

Maximum successfully parsed same-host HTML pages.

## `checkExternal` (type: `boolean`):

Check external links but never crawl external pages.

## `reportRedirects` (type: `boolean`):

Return successful redirected link findings, in addition to failures.

## Actor input object example

```json
{
  "startUrl": "https://docs.apify.com/platform/actors/publishing/monetize",
  "maxPages": 50,
  "checkExternal": true,
  "reportRedirects": 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 = {
    "startUrl": "https://docs.apify.com/platform/actors/publishing/monetize"
};

// Run the Actor and wait for it to finish
const run = await client.actor("hermeskd/broken-links").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://docs.apify.com/platform/actors/publishing/monetize" }

# Run the Actor and wait for it to finish
run = client.actor("hermeskd/broken-links").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://docs.apify.com/platform/actors/publishing/monetize"
}' |
apify call hermeskd/broken-links --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,hermeskd/broken-links"
        }
    }
}
```

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/pge3soDhsbxAfdZwI/builds/L75ikON6yzpRH44QI/openapi.json
