# Bulk URL Status & Redirect Checker: 301, 302, Chains (`joesimo/redirect-checker`) Actor

Check thousands of URLs for HTTP status codes, full redirect chains, final destination, loops and 302 vs 301. Validate a redirect map after a site migration: paste old and new URLs and get a match column. Fast HTTP, no login.

- **URL**: https://apify.com/joesimo/redirect-checker.md
- **Developed by:** [Joe Simo](https://apify.com/joesimo) (community)
- **Categories:** SEO tools, Developer tools, Automation
- **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 urls

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 Checker

Check a list of URLs and get the HTTP status code, every redirect hop, the final URL and a plain verdict for each one. Paste an old-to-new redirect map after a site migration and the Actor tells you which old URLs land on the right page, which ones land somewhere else, and which ones are broken.

Fast plain HTTP (HEAD requests, GET only as a fallback), no browser, no login, no proxy.

### What you get for each URL

| Field | Example |
|---|---|
| `url` | `http://github.com/` |
| `verdict` | `ok`, `redirect`, `mismatch`, `broken`, `blocked` or `error` |
| `statusCode` | First response, for example `301` |
| `finalStatusCode` | Status of the last hop, for example `200` |
| `finalUrl` | `https://github.com/` |
| `redirectCount` | Number of hops, for example `1` |
| `redirectChain` | Each hop with its URL, status code and where it pointed |
| `expectedUrl` | The destination you gave in a redirect map, or null |
| `matchesExpected` | `true`, `false` or null when no destination was given |
| `issues` | `redirect_chain`, `temporary_redirect`, `https_downgrade`, `final_url_not_https`, `destination_mismatch`, `redirect_loop`, `too_many_redirects`, `not_found`, `server_error`, `client_error`, `timeout`, `network_error` |
| `responseTimeMs` | Total time for all hops |
| `contentType`, `error`, `checkedAt` | Content type of the final response, error text, check time |

The run summary in the `OUTPUT` record counts URLs per verdict.

### Common uses

- **Site migration QA**: check every old URL from your redirect plan against its new URL. Rows with `verdict` `mismatch` or `broken` are the ones to fix.
- **SEO redirect audit**: find chains of 2 or more hops, 302 or 307 redirects that should be 301 or 308, and http pages that never move to https.
- **Bulk status check**: confirm a list of landing pages, affiliate links or backlink targets still answer 200.
- **Monitoring**: schedule the Actor daily and set Output to "Only URLs with an issue" so the dataset only lists problems.

### Input

One line per URL. For a redirect map, put the old URL and the expected new URL on the same line, separated by a comma, a tab, a space or `->`:

```
http://old.example.com/pricing, https://example.com/plans
http://old.example.com/blog/post-1 -> /articles/post-1
https://example.com/contact
```

- A destination that starts with `/` is read relative to the old URL.
- A header row that starts with `source`, `from`, `old` or `url` is skipped, so you can paste two CSV columns straight from a spreadsheet.
- Bare domains get `https://`. Set "Scheme for bare domains" to `http` to test that http redirects to https.
- "Ignore trailing slash" (on by default) treats `/page` and `/page/` as the same destination. "Ignore query string" drops `?utm_...` style parameters before comparing.

Example API input:

```json
{
  "urls": [
    "http://old.example.com/pricing, https://example.com/plans",
    "https://example.com/contact"
  ],
  "outputMode": "issues"
}
```

With an empty input the Actor checks 20 well-known URLs as a demo.

### Verdicts

| Verdict | Meaning |
|---|---|
| `ok` | 2xx with no redirect |
| `redirect` | Redirected and ended on a 2xx page |
| `mismatch` | Ended on a working page, but not the expected destination |
| `broken` | Final status 404, 410, other 4xx or 5xx |
| `blocked` | 401, 403, 429 or 999: the site refuses automated checks or needs a login. Not counted as broken. |
| `error` | Timeout, DNS or connection failure, redirect loop or too many hops |

### Pricing

Pay per event: **$0.0005 per URL checked** ($0.50 per 1,000 URLs). Each line of your input is one URL checked, whatever the number of hops. Invalid lines are skipped and free. Set a maximum cost per run in the run options and the Actor stops cleanly when it is reached.

### How it checks

- One HEAD request per hop. If HEAD fails or answers 4xx or 5xx, the Actor retries that hop with GET and discards the body, because some servers do not support HEAD.
- Redirects are followed by hand (up to 10 hops by default, 30 at most) so every hop is recorded. A URL seen twice in one chain is a loop.
- Requests to the same host are spaced 150 ms apart, a 429 or 503 is retried once after the Retry-After delay, and the User-Agent names this Actor.
- Private and local addresses (localhost, 10.x, 192.168.x and similar) are refused.

### Limits

- Redirects done in JavaScript or with a meta refresh tag are not followed; only HTTP 3xx redirects are.
- Some sites answer bots differently from browsers. Those usually show up as `blocked`.
- HEAD and GET can redirect differently on a few servers. The Actor reports what HEAD returned unless HEAD failed.

### FAQ

**Can I use it as a bulk HTTP status checker?** Yes. Paste up to 100,000 URLs, one per line, and each row gets `statusCode` (the first response) and `finalStatusCode` (the last hop), plus a `verdict`. Set Output to "Only URLs with an issue" to keep only redirects, errors and mismatches in the dataset. Each URL costs $0.0005 ($0.50 per 1,000), whatever the number of hops.

**How do I see the full redirect chain of a URL?** `redirectChain` lists every hop with its URL, status code and the URL it pointed to, and `redirectCount` gives the number of hops. A URL with 2 or more hops gets the `redirect_chain` issue. The Actor follows up to 10 hops by default (30 at most); a URL that comes back to an earlier hop is reported as `redirect_loop`.

**Can I get the final URL after redirects for a list of links?** Yes. `finalUrl` is where each link ends after all HTTP 3xx redirects, with `finalStatusCode` for that page. This works for tracking links, short links and old URLs that redirect with an HTTP status. Redirects done in JavaScript or with a meta refresh tag are not followed.

**How do I find broken redirects after a site migration?** Paste your redirect map with the old URL and the expected new URL on each line. Rows with `verdict` `mismatch` land on a working page that is not the expected one (issue `destination_mismatch`), and rows with `broken` end on a 404, 410, other 4xx or 5xx page. Loops and timeouts show up as `error`.

**Does it tell a 301 redirect from a 302?** Yes. Each hop in `redirectChain` has its own status code, and a URL gets the `temporary_redirect` issue when any hop is a 302, 303 or 307 instead of a permanent 301 or 308. `https_downgrade` and `final_url_not_https` flag chains that leave https or never reach it.

**Are pages that block bots counted as broken?** No. A final 401, 403, 429 or 999 gets the `blocked` verdict, because the site refuses automated checks or needs a login. Those rows are not marked broken.

### Related Actors

- [Broken Link Checker](https://apify.com/joesimo/broken-link-checker) crawls a whole site and checks every link it finds.
- [Sitemap Extractor](https://apify.com/joesimo/sitemap-extractor) lists every URL in a site's sitemaps, which you can paste here.
- [SEO Audit](https://apify.com/joesimo/seo-audit) checks titles, meta tags and structured data page by page.

# Actor input Schema

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

One URL per line. To validate a redirect map, put the old URL and the expected destination on one line, separated by a comma, tab, space or ->, for example: http://old.example.com/a, https://example.com/b. A destination that starts with / is read relative to the old URL. A CSV header row (source, ...) is skipped. Empty input runs a 20-URL demo.

## `maxUrls` (type: `integer`):

Stop after this many URLs (each one is charged once).

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

Follow at most this many hops. More hops are reported as too_many_redirects.

## `ignoreTrailingSlash` (type: `boolean`):

Treat /page and /page/ as the same destination in the redirect map check.

## `ignoreQuery` (type: `boolean`):

Compare destinations without ?query parameters (useful when tracking parameters are added).

## `outputMode` (type: `string`):

Every URL is checked and charged either way; Only issues keeps the dataset short.

## `defaultScheme` (type: `string`):

Used when a line has no scheme, such as example.com/page. Choose http to test that http redirects to https.

## `concurrency` (type: `integer`):

URLs checked at the same time. A 150 ms gap per host keeps load on any one site low.

## `timeoutSecs` (type: `integer`):

A request slower than this is reported as timeout.

## Actor input object example

```json
{
  "urls": [
    "http://apify.com",
    "http://github.com",
    "http://wikipedia.org",
    "http://example.com",
    "http://www.python.org",
    "http://nodejs.org",
    "http://www.mozilla.org",
    "http://developer.mozilla.org",
    "http://crawlee.dev",
    "http://docs.apify.com",
    "http://www.w3.org",
    "http://npmjs.com",
    "http://www.debian.org",
    "http://www.gnu.org",
    "http://httpbin.org/status/404",
    "https://github.com/apify/crawlee/tree/master",
    "http://www.apache.org",
    "http://golang.org",
    "http://rust-lang.org",
    "http://www.php.net"
  ],
  "maxUrls": 20,
  "maxRedirects": 10,
  "ignoreTrailingSlash": true,
  "ignoreQuery": false,
  "outputMode": "all",
  "defaultScheme": "https",
  "concurrency": 10,
  "timeoutSecs": 20
}
```

# Actor output Schema

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

One row per URL with verdict, first and final status, final URL, redirect chain, expected URL match and issues.

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

JSON summary: URLs checked, counts per verdict, skipped invalid lines and stop reason.

# 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://apify.com",
        "http://github.com",
        "http://wikipedia.org",
        "http://example.com",
        "http://www.python.org",
        "http://nodejs.org",
        "http://www.mozilla.org",
        "http://developer.mozilla.org",
        "http://crawlee.dev",
        "http://docs.apify.com",
        "http://www.w3.org",
        "http://npmjs.com",
        "http://www.debian.org",
        "http://www.gnu.org",
        "http://httpbin.org/status/404",
        "https://github.com/apify/crawlee/tree/master",
        "http://www.apache.org",
        "http://golang.org",
        "http://rust-lang.org",
        "http://www.php.net"
    ],
    "maxUrls": 20
};

// Run the Actor and wait for it to finish
const run = await client.actor("joesimo/redirect-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 = {
    "urls": [
        "http://apify.com",
        "http://github.com",
        "http://wikipedia.org",
        "http://example.com",
        "http://www.python.org",
        "http://nodejs.org",
        "http://www.mozilla.org",
        "http://developer.mozilla.org",
        "http://crawlee.dev",
        "http://docs.apify.com",
        "http://www.w3.org",
        "http://npmjs.com",
        "http://www.debian.org",
        "http://www.gnu.org",
        "http://httpbin.org/status/404",
        "https://github.com/apify/crawlee/tree/master",
        "http://www.apache.org",
        "http://golang.org",
        "http://rust-lang.org",
        "http://www.php.net",
    ],
    "maxUrls": 20,
}

# Run the Actor and wait for it to finish
run = client.actor("joesimo/redirect-checker").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://apify.com",
    "http://github.com",
    "http://wikipedia.org",
    "http://example.com",
    "http://www.python.org",
    "http://nodejs.org",
    "http://www.mozilla.org",
    "http://developer.mozilla.org",
    "http://crawlee.dev",
    "http://docs.apify.com",
    "http://www.w3.org",
    "http://npmjs.com",
    "http://www.debian.org",
    "http://www.gnu.org",
    "http://httpbin.org/status/404",
    "https://github.com/apify/crawlee/tree/master",
    "http://www.apache.org",
    "http://golang.org",
    "http://rust-lang.org",
    "http://www.php.net"
  ],
  "maxUrls": 20
}' |
apify call joesimo/redirect-checker --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,joesimo/redirect-checker"
        }
    }
}
```

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/xuDJLNhxWmOirxDwV/builds/v9SuGMHgP5ba9fzg1/openapi.json
