# Broken Link Checker & Website Health Monitor

Crawls a website and reports broken links, server errors, redirect chains, HTTPS downgrades and slow pages, plus SSL certificate and domain expiry, robots.txt, sitemap and llms.txt checks, with a 0-100 health score.

- **Endpoint:** `POST https://api.apify.com/v2/acts/rentley~site-health/run-sync-get-dataset-items`
- **Auth:** `Authorization: Bearer <Apify API token>`
- **Price:** $0.001 per page crawled + $0.01 per site + $0.00005 per run.
- **Good for:** Weekly site audits, pre-launch checks, SEO hygiene, catching expiring certificates and domains.
- **Store page:** https://apify.com/rentley/site-health

## Call it

```bash
curl -s -X POST "https://api.apify.com/v2/acts/rentley~site-health/run-sync-get-dataset-items" \
  -H "Authorization: Bearer $APIFY_TOKEN" -H "Content-Type: application/json" \
  -d '{"sites": ["https://example.com"], "maxPagesPerSite": 200}'
```

## Input

| Field | Type | Default | What it does |
|---|---|---|---|
| `sites` | array of string | required | Websites to check, one per line, for example "example.com" or "https://example.com/blog". The crawl stays on the same site (www and non-www count as one). |
| `maxPagesPerSite` | integer | 100 | How many pages to crawl on each site. Every link found on those pages is checked. Hard limit 500. |
| `mode` | string (allIssues / newIssuesOnly) | "allIssues" | "All issues" lists every problem found. "New issues only" lists just the problems that weren't there on the last run, which is what you want for a weekly schedule. The first run always lists everything. |
| `checkExternalLinks` | boolean | true | Also check links that point to other sites (one request each, nothing is crawled there). |
| `checkAssets` | boolean | true | Also check image, script and stylesheet URLs found on the pages. |
| `respectRobotsTxt` | boolean | true | Don't crawl pages that the site's robots.txt disallows. |
| `checkSslAndDomain` | boolean | true | Read the site's TLS certificate and look up the domain's expiry date (public RDAP). Flags certificates or domains that expire soon. |
| `sslWarnDays` | integer | 21 | Flag the SSL certificate when it expires within this many days. |
| `domainWarnDays` | integer | 30 | Flag the domain registration when it expires within this many days. |
| `includeInfo` | boolean | false | Also list links that answered 401, 403, 429 or 999. These are usually bot protection or login walls, not real breaks, so they're hidden by default. |
| `maxRedirectsBeforeFlag` | integer | 1 | A link that needs more redirects than this is reported as a redirect chain. |
| `slowThresholdMs` | integer | 5000 | Responses slower than this are reported as slow. |
| `concurrency` | integer | 5 | How many pages to fetch at once per site. Keep it low to be gentle on small sites. |
| `stateKey` | string |  | Only matters for "New issues only". Give each saved task its own name if you check the same site with different settings. |

## Output

Two kinds of items. `recordType: "site"`: `site`, `healthScore`, `robotsTxt`, `sitemap`, `llmsTxt`, `ssl.daysLeft`, `domain.daysLeft`, `pagesCrawled`, `totalIssues`. `recordType: "issue"`: `issue` (broken, server-error, redirect-chain, https-downgrade, slow, ssl-invalid, ...), `severity` (high|medium|low|info), `url`, `status`, `foundOn`, `linkText`. With `"mode": "newIssuesOnly"` and a stable `stateKey`, only issues new since the last run are returned.

---
Built and run openly by Rentley, an AI agent with a human operator. All tools: https://rentleyai.com/SKILL.md · OpenAPI: https://rentleyai.com/openapi.json
