# Find broken links on a website (crawl + source page)

**Use case:** 

Crawls up to 25 pages of one site and checks every link, image, script and stylesheet it finds. Each broken link comes with the page it is on and its anchor text. Copy it and put your own site in Websites to crawl.

## Input

```json
{
  "startUrls": [
    "https://books.toscrape.com/"
  ],
  "maxPages": 25,
  "maxUrlsPerSitemap": 200,
  "scanSitemapPages": false,
  "maxUrls": 400,
  "checkExternalLinks": true,
  "checkResources": true,
  "includeSubdomains": false,
  "onlyBroken": false,
  "treatRestrictedAsBroken": false,
  "maxConcurrency": 10,
  "timeoutSecs": 15
}
```

## Output

```json
{
  "url": {
    "label": "Url",
    "format": "link"
  },
  "broken": {
    "label": "Broken",
    "format": "boolean"
  },
  "result": {
    "label": "Result",
    "format": "text"
  },
  "statusCode": {
    "label": "Status",
    "format": "number"
  },
  "finalStatusCode": {
    "label": "Final status",
    "format": "number"
  },
  "finalUrl": {
    "label": "Final URL",
    "format": "link"
  },
  "redirectCount": {
    "label": "Redirects",
    "format": "number"
  },
  "responseTimeMs": {
    "label": "Response ms",
    "format": "number"
  },
  "contentType": {
    "label": "Content type",
    "format": "text"
  },
  "linkType": {
    "label": "Link type",
    "format": "text"
  },
  "sourcePage": {
    "label": "Found on",
    "format": "link"
  },
  "anchorText": {
    "label": "Anchor text",
    "format": "text"
  },
  "foundOnCount": {
    "label": "Pages linking",
    "format": "number"
  },
  "error": {
    "label": "Error",
    "format": "text"
  },
  "checkedAt": {
    "label": "Checked at",
    "format": "date"
  }
}
```

## How it works

### 1. Sign up on Apify or log in

The Broken Link Checker & Bulk HTTP Status Code Checker Actor is ready to run with the inputs already set for "Find broken links on a website (crawl + source page)". [Sign up or log in](https://console.apify.com/create-task-from-example/Fb5ZAoAV2W5YWoaNG) and you'll land in Apify Console with a copy of this exact task.

### 2. Start the "Find broken links on a website (crawl + source page)" task

The Broken Link Checker & Bulk HTTP Status Code Checker Actor will start running based on the input automatically. You can also change all the input fields, like websites to crawl for broken links, max pages to crawl, and more, to match your specific use case.

### 3. Receive the "Find broken links on a website (crawl + source page)" output

Monitor the progress in real time. You will be notified as soon as your dataset is complete and ready for review. Each result includes data such as url, broken, result, and more.

### 4. Integrate into your workflow

The final output is delivered in JSON, CSV, or Excel format, ready to be plugged into your workflow. You can also [run the "Find broken links on a website (crawl + source page)" task via API](https://apify.com/wellbuilt_seahare/broken-link-checker.md).

## FAQ

### How do I check my own site?

Copy the task, replace the start URL with your home page, and raise Max pages to crawl if your site is bigger. Links to other sites are checked but never crawled.

### Can I get only the broken links?

Yes. Turn on Only output broken URLs. Every URL is still checked, the table just shows the broken ones with their source page.

## About this Actor

This example demonstrates how to use [Broken Link Checker & Bulk HTTP Status Code Checker](https://apify.com/wellbuilt_seahare/broken-link-checker.md) with a specific input configuration. Visit the [Actor detail page](https://apify.com/wellbuilt_seahare/broken-link-checker.md) to learn more, explore other use cases, and run it yourself.


## How to integrate an Actor?

This Task's input is already configured above. Use it as-is rather than inventing a new one.

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 full API examples (JavaScript, Python, CLI, MCP, OpenAPI), see this Task's Actor page: https://apify.com/wellbuilt_seahare/broken-link-checker.md

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`).
