# Bulk URL Status & Redirect Chain Checker: 301, 404, 5xx (`mossfetch/bulk-url-status-redirects`) Actor

Check the HTTP status of many URLs and trace each redirect chain hop by hop. Returns final URL, status, hop count, timing, canonical and x-robots-tag, and flags loops and long chains. $0.50 per 1,000 URLs; failed fetches are free.

- **URL**: https://apify.com/mossfetch/bulk-url-status-redirects.md
- **Developed by:** [Mossfetch](https://apify.com/mossfetch) (community)
- **Categories:** SEO tools, Developer tools
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

$0.50 / 1,000 url checkeds

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.

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

## Bulk URL Status & Redirect Chain Checker: 301, 404, 5xx

Redirect checker and bulk HTTP status tool: find broken links (404, 5xx), redirect chains (301, 302) and loops after a migration or in an SEO audit. Check a list of URLs and get one row each: final status, every redirect hop with code and timing, final URL, `content-type`, canonical and `x-robots-tag`. Built for redirect maps after a site migration. No login, no API key.

### Who it's for

- SEO teams and agencies checking a redirect map after a site migration.
- Developers and content teams hunting broken links (404) and server errors (5xx).
- Anyone who needs to know which URLs redirect, where they end up and how long the chain is.

### What you get per URL

`inputUrl`, `finalUrl`, `finalStatus`, `ok`, `redirectCount`, `redirectChain` (hop, url, status, timeMs, location), `totalTimeMs`, `contentType`, `canonical`, `canonicalMatchesFinal`, `xRobotsTag`, `flags`, `error`.

**Flags:** `redirect_loop`, `long_chain` (more than 3 redirects), `too_many_redirects`, `mixed_redirect_types` (301/308 mixed with 302/307), `temporary_redirect`, `https_to_http`, `client_error`, `server_error`, `network_error`, `canonical_differs`, `noindex_header`, `blocked_by_robots`.

### Input

| Field | Default |
|---|---|
| `urls` | required (empty runs a free 3-URL demo), one per line; missing scheme means https |
| `extractCanonical` | on (reads up to 96 KB of 200 HTML pages, then discards it) |
| `keepQueryStrings` | off |
| `respectRobotsTxt` | on |
| `maxRedirects` | 10 |
| `maxItems` | none |
| `requestTimeoutSecs` | 15 |

### Pricing

Pay per event: **$0.50 per 1,000 URLs checked** (100 URLs cost $0.05). URLs with no HTTP answer (DNS or connection failure) and URLs blocked by robots.txt are not charged. Set a spending limit on the run and the actor stops when it is reached.

### Fetch limits (read this)

- One HEAD request per hop (GET if HEAD fails or is refused). With `extractCanonical` on, one extra GET per 200 HTML page, reading at most 96 KB. No page content is stored.
- No crawling: only the URLs you supply and their redirect targets.
- Identifying User-Agent `IncomeLabBot/1.0`. At most 5 requests in flight per host (25 in total).
- `robots.txt` Disallow is respected by default, also for redirect targets.
- Redirects are followed up to `maxRedirects` (max 20); loops are detected and reported.
- Localhost and private-network addresses are refused.
- Query strings are stripped from output by default (the request still uses them).
- No JavaScript rendering: redirects done in JavaScript or meta refresh are not followed. A site can still block our IP; you get the status it returns, or a `network_error`.

### Sample output

One real row from a run of the prefilled input (a 4-redirect chain):

```json
{
  "inputUrl": "https://httpbin.org/redirect/4",
  "finalUrl": "https://httpbin.org/get",
  "finalStatus": 200,
  "ok": true,
  "redirectCount": 4,
  "redirectChain": [
    {
      "hop": 1,
      "url": "https://httpbin.org/redirect/4",
      "status": 302,
      "timeMs": 17,
      "location": "https://httpbin.org/relative-redirect/3"
    },
    {
      "hop": 2,
      "url": "https://httpbin.org/relative-redirect/3",
      "status": 302,
      "timeMs": 15,
      "location": "https://httpbin.org/relative-redirect/2"
    },
    {
      "hop": 3,
      "url": "https://httpbin.org/relative-redirect/2",
      "status": 302,
      "timeMs": 15,
      "location": "https://httpbin.org/relative-redirect/1"
    },
    {
      "hop": 4,
      "url": "https://httpbin.org/relative-redirect/1",
      "status": 302,
      "timeMs": 11,
      "location": "https://httpbin.org/get"
    },
    {
      "hop": 5,
      "url": "https://httpbin.org/get",
      "status": 200,
      "timeMs": 10
    }
  ],
  "totalTimeMs": 68,
  "contentType": "application/json",
  "canonical": null,
  "canonicalMatchesFinal": null,
  "xRobotsTag": null,
  "flags": [
    "long_chain",
    "temporary_redirect"
  ],
  "error": null
}
```

### FAQ

**Are URLs blocked by robots.txt charged?** No. They are returned with the flag `blocked_by_robots` and are free, like URLs with no HTTP answer.

**Why is `canonical` empty?** The canonical tag is only read on 200 HTML pages, in the first 96 KB, and when `extractCanonical` is on. Redirect, error and non-HTML responses have none.

**Does it crawl?** No. It only checks the URLs you list and their redirect targets.

### Use it from code (API)

```bash
curl -X POST "https://api.apify.com/v2/acts/mossfetch~bulk-url-status-redirects/run-sync-get-dataset-items?token=$APIFY_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"urls":["http://github.com","https://nodejs.org/does-not-exist"]}'
```

Or with the JavaScript client: `await new ApifyClient({ token }).actor('mossfetch/bulk-url-status-redirects').call(input)`, then read `defaultDatasetId`.

### Use in Make, n8n or Zapier

Run this Actor from Make, n8n or Zapier with an Apify account: add the Apify "Run Actor" step and select or enter the Actor `mossfetch/bulk-url-status-redirects` (Actor ID `d8OGAKbEpaj7yoD3a`). Pass the input as JSON, then read the dataset in the next step. Nothing else to install.

# Actor input Schema

## `urls` (type: `array`):

URLs to check, one per line. A missing scheme is treated as https://. Duplicates are checked once.

## `extractCanonical` (type: `boolean`):

For 200 HTML pages, read the first 96 KB to find the rel=canonical link (also checks the Link header). The page content is never stored. Turn off for HEAD-only checks.

## `keepQueryStrings` (type: `boolean`):

Output URLs without ?query by default (queries can contain personal data). The request itself always uses the full URL.

## `respectRobotsTxt` (type: `boolean`):

Do not request URLs that robots.txt disallows for our user agent. They are returned with flag blocked_by_robots and are not charged.

## `maxRedirects` (type: `integer`):

Stop following a redirect chain after this many hops. The row is flagged when the limit is hit.

## `maxItems` (type: `integer`):

Hard cap on URLs checked. Leave empty for no cap (the run's spending limit still applies). Example: 1000.

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

How long to wait for each HTTP response before giving up.

## Actor input object example

```json
{
  "urls": [
    "http://github.com",
    "https://httpbin.org/redirect/4",
    "https://nodejs.org/does-not-exist"
  ],
  "extractCanonical": true,
  "keepQueryStrings": false,
  "respectRobotsTxt": true,
  "maxRedirects": 10,
  "requestTimeoutSecs": 15
}
```

# Actor output Schema

## `results` (type: `string`):

One row per URL with the full redirect chain.

## `runSummary` (type: `string`):

Counts of OK, redirected, 4xx, 5xx, loops and errors.

# 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 = {
    "urls": [
        "http://github.com",
        "https://httpbin.org/redirect/4",
        "https://nodejs.org/does-not-exist"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("mossfetch/bulk-url-status-redirects").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 = { "urls": [
        "http://github.com",
        "https://httpbin.org/redirect/4",
        "https://nodejs.org/does-not-exist",
    ] }

# Run the Actor and wait for it to finish
run = client.actor("mossfetch/bulk-url-status-redirects").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 '{
  "urls": [
    "http://github.com",
    "https://httpbin.org/redirect/4",
    "https://nodejs.org/does-not-exist"
  ]
}' |
apify call mossfetch/bulk-url-status-redirects --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,mossfetch/bulk-url-status-redirects"
        }
    }
}
```

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/d8OGAKbEpaj7yoD3a/builds/gAHaWtWR2tv3uaX4r/openapi.json
