๐Ÿฆ– TinyRex Data Toolspractical guides for web data APIs

How to find every broken link and redirect on a website, with the pages to fix

Updated 2026-10-28 ยท Tool used: Broken Link Checker - Find 404s, Dead Links & Redirects on Apify ยท Price: about $0.50 per 1,000 unique links checked; each URL is checked once however many pages link to it

Broken links frustrate visitors and waste crawl budget, and they pile up quietly: a partner site goes offline, a product page is deleted, an image is renamed after a redesign. Free online checkers usually stop after a few hundred links or show the dead URL without telling you which page links to it.

This guide shows how to crawl one or many websites and get a ranked list of problem links: broken (4xx/5xx), unreachable (DNS, timeout, TLS) and blocked by bot protection, plus every redirect with its chain and final URL. Each row says on which pages the link appears and with what anchor text, so you know exactly what to edit.

Open Broken Link Checker on Apify โ†’

Steps

  1. Put one or more homepages in startUrls and set maxPagesPerSite for how deep the crawl goes.
  2. Choose whether to check external links and assets (checkExternalLinks, checkAssets) and set maxLinksToCheck as a cost cap.
  3. Export the dataset as CSV, sort by foundOnCount and fix the links used on the most pages first; the SUMMARY record has per-site totals.

Example input

{
  "startUrls": [
    "https://quotes.toscrape.com"
  ],
  "maxPagesPerSite": 50,
  "maxLinksToCheck": 500
}

Example output (one item, shortened)

{
  "site": "https://crawlee.dev/",
  "url": "https://github.com/apify/crawlee-python/tree/master/templates",
  "status": "broken",
  "statusCode": 404,
  "finalUrl": "https://github.com/apify/crawlee-python/tree/master/templates",
  "redirectChain": [],
  "redirectCount": 0,
  "linkType": "link",
  "isInternal": false,
  "nofollow": false,
  "anchorText": "ready-made templates",
  "foundOn": [
    "https://crawlee.dev/blog/launching-crawlee-python",
    "https://www.crawlee.dev/blog/launching-crawlee-python"
  ],
  "foundOnCount": 2,
  "error": null,
  "checkedAt": "2026-10-13T07:26:19.132Z"
}

Every run's dataset can be downloaded as JSON, CSV, Excel, XML or HTML from the Apify Console, or via https://api.apify.com/v2/datasets/<datasetId>/items?format=csv.

Run it from code

Python

from apify_client import ApifyClient  # pip install apify-client

client = ApifyClient("<YOUR_APIFY_TOKEN>")
run_input = {
  "startUrls": [
    "https://quotes.toscrape.com"
  ],
  "maxPagesPerSite": 50,
  "maxLinksToCheck": 500
}
run = client.actor("tinyrex/broken-link-checker").call(run_input=run_input)
for item in client.dataset(run["defaultDatasetId"]).iterate_items():
    print(item)

JavaScript / Node.js

import { ApifyClient } from 'apify-client'; // npm i apify-client

const client = new ApifyClient({ token: process.env.APIFY_TOKEN });
const run = await client.actor('tinyrex/broken-link-checker').call({
  "startUrls": [
    "https://quotes.toscrape.com"
  ],
  "maxPagesPerSite": 50,
  "maxLinksToCheck": 500
});
const { items } = await client.dataset(run.defaultDatasetId).listItems();
console.log(items);

curl (no SDK)

# Runs the actor and returns the results directly (CSV here; use format=json for JSON)
curl -X POST "https://api.apify.com/v2/acts/tinyrex~broken-link-checker/run-sync-get-dataset-items?format=csv" \
  -H "Authorization: Bearer $APIFY_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"startUrls": ["https://quotes.toscrape.com"], "maxPagesPerSite": 50, "maxLinksToCheck": 500}' > results.csv

Get your API token in Apify Console โ†’ Settings โ†’ API & Integrations. The free Apify plan includes monthly credit that is enough to try this.

Use it from an AI agent (MCP)

The Apify MCP server exposes this actor as a tool for Claude, Cursor, VS Code, n8n and other MCP clients. Add this to your client's MCP config (or use the OAuth flow at mcp.apify.com instead of a token):

{
  "mcpServers": {
    "apify": {
      "url": "https://mcp.apify.com?tools=tinyrex/broken-link-checker",
      "headers": {
        "Authorization": "Bearer <YOUR_APIFY_TOKEN>"
      }
    }
  }
}

Then ask in plain language, e.g. "Broken link checker for this list and give me a table".

Use cases

Pricing

Pay per result: about $0.50 per 1,000 unique links checked; each URL is checked once however many pages link to it. You can cap the cost of every run in the run options.

FAQ

How do I find all broken links on my website?

Enter the homepage and run it. The actor crawls internal pages, collects every link and asset and checks each unique URL once. Rows with status broken or error are the ones to fix.

Why are LinkedIn or some other links marked blocked?

Sites with bot protection answer 401, 403, 429 or 999 to automated requests even when the page exists. Those links are reported as blocked, separate from truly broken ones, so you can check them by hand.

Does it report redirects?

Yes. By default every redirect is listed with its full redirectChain, redirectCount and finalUrl. Set reportMode to problems if you do not need them.

What is the difference to the sitemap broken link check?

The sitemap check tests only the URLs listed in your sitemaps. This actor crawls the pages and tests the links inside them, including images, scripts and external links.

Try it on Apify โ†’

Related guides

More guides