# Broken Link & Asset Checker (`x2ppi/website-broken-link-asset-checker`) Actor

Website release QA: checks public pages for broken links, images, scripts, and stylesheets with repair actions.

- **URL**: https://apify.com/x2ppi/website-broken-link-asset-checker.md
- **Developed by:** [Yota](https://apify.com/x2ppi) (community)
- **Categories:** SEO tools, Developer tools, Automation
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $24.00 / 1,000 completed page audits

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/platform/actors/running/actors-in-store#pay-per-event

## What's an Apify Actor?

Actors are web data automations that power AI and operations. They run on the Apify platform to scrape websites, process data, connect APIs, and automate workflows.
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.
Actors are written with capital "A".

## 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.
The best way to integrate Actors is as follows.

- **AI agents and MCP clients** — the [Apify MCP server](https://docs.apify.com/integrations/mcp.md) at `https://mcp.apify.com` (remote, streamable HTTP, OAuth on first use).
- **Agentic workflows and local Actor development** — [Agent Skills](https://apify.com/.well-known/agent-skills/index.json) with the [Apify CLI](https://docs.apify.com/cli/docs.md): `npm install -g apify-cli`, then `apify login`.
- **JavaScript/TypeScript projects** — the official [JS/TS client](https://docs.apify.com/api/client/js/docs.md): `npm install apify-client`.
- **Python projects** — the official [Python client](https://docs.apify.com/api/client/python/docs.md): `pip install apify-client`.
- **Any other language** — the [REST API](https://docs.apify.com/api/v2.md).

For usage examples, see the [API](#api) section below.

For more details, see Apify documentation as [Markdown index](https://docs.apify.com/llms.txt) and [Markdown full-text](https://docs.apify.com/llms-full.txt).

# README

## Broken Link & Asset Checker

Check public HTML pages for broken links, images, scripts, and stylesheets before a content publish or website release. Each Dataset record gives the source page status, broken-target evidence, a pass/needs-attention verdict, and a concrete next action.

### Best for

- Release QA for landing pages, documentation, and campaign pages
- Content migrations where old assets or internal links may have been removed
- Scheduled checks of a small, known set of critical public pages

### Start with the ready-made release check

Use the public [Check Website Links & Assets Before Release](https://apify.com/x2ppi/website-broken-link-asset-checker/examples/check-release-page-links-and-assets) task when you want a prefilled, bounded check before a launch. It checks one public page, keeps external-target checks off, and caps the run at 10 discovered targets. Duplicate the task, replace the page URL, and run it from the Apify Console.

### Input

```json
{
  "startUrls": [{ "url": "https://example.com/" }],
  "includeExternalLinks": false,
  "maxTargetsPerPage": 50,
  "requestTimeoutSecs": 15
}
```

By default, the Actor checks only same-host targets. Turn on `includeExternalLinks` when your release QA should also test outgoing links. Set a lower target cap for a fast smoke test.

### Output

- `verdict: "pass"`: all checked targets returned a successful or redirect HTTP response.
- `verdict: "needs-attention"`: `brokenTargets` identifies each target URL, kind, status or request error, and a repair action.
- `verdict: "source-unreachable"`: the source page could not be checked. The diagnostic is stored, but it is not billed.

### Pricing

- From $0.03 per completed source-page audit (Free-tier price; eligible higher tiers receive a progressive Store discount)
- A page is charged only after its reachable audit result is written to the default Dataset.
- Source-page access failures are stored as uncharged diagnostics.

For example, checking 100 reachable pages costs up to $3.00 at the Free-tier price. Use the maximum charge setting in Apify to cap a run before it starts.

### Automate it

Run the Actor from a deployment script, CI job, or any Apify integration. Keep the token outside source control and pass it as an environment variable:

```bash
curl -X POST "https://api.apify.com/v2/acts/x2ppi~website-broken-link-asset-checker/runs?token=$APIFY_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"startUrls":[{"url":"https://www.example.com/release-page"}],"includeExternalLinks":false,"maxTargetsPerPage":50}'
```

For recurring checks, save the input as an Apify task and attach a schedule or webhook in the Console. Treat `needs-attention` results as a release gate: fix each listed target or document why it is intentionally unavailable.

### Safety and boundaries

The Actor performs bounded public HTTP checks only: it rejects local and non-public network destinations, validates redirect destinations again, follows at most five redirects, reads at most 2 MiB for each source page, and checks at most 100 discovered targets per page. It does not authenticate, bypass access controls, use a proxy, or confirm SEO rankings, accessibility compliance, or full-site crawl coverage.

# Actor input Schema

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

Public HTML pages whose links, images, scripts, and stylesheets should be checked. Maximum 100 unique pages.

## `includeExternalLinks` (type: `boolean`):

When off, only same-host links and assets are checked. Turn on for a release-wide outgoing-link check.

## `maxTargetsPerPage` (type: `integer`):

Caps checked discovered targets for predictable run time.

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

Stops an individual page or target request after this number of seconds.

## Actor input object example

```json
{
  "startUrls": [
    {
      "url": "https://example.com/"
    }
  ],
  "includeExternalLinks": false,
  "maxTargetsPerPage": 50,
  "requestTimeoutSecs": 15
}
```

# Actor output Schema

## `pageAuditResults` (type: `string`):

One stored result per completed source-page audit, including broken links, asset evidence, verdict, and repair actions.

# 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/"
        }
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("x2ppi/website-broken-link-asset-checker").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/" }] }

# Run the Actor and wait for it to finish
run = client.actor("x2ppi/website-broken-link-asset-checker").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print("💾 Check your data here: https://console.apify.com/storage/datasets/" + run["defaultDatasetId"])
for item in client.dataset(run["defaultDatasetId"]).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/"
    }
  ]
}' |
apify call x2ppi/website-broken-link-asset-checker --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "command": "npx",
            "args": [
                "mcp-remote",
                "https://mcp.apify.com/?tools=x2ppi/website-broken-link-asset-checker",
                "--header",
                "Authorization: Bearer <YOUR_API_TOKEN>"
            ]
        }
    }
}

```

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/7yzY1gy2Ye8capLXE/builds/tAhg3MIf96teVOvSi/openapi.json
