# Redirect Chain Auditor (`phoenix2810/redirect-chain-auditor`) Actor

Audit a public URL's redirect chain in one API call. Reports hops, final status, HTTPS downgrades, temporary redirects, loops, score, and recommendations for SEO and migration QA.

- **URL**: https://apify.com/phoenix2810/redirect-chain-auditor.md
- **Developed by:** [Sanskar Jaiswal](https://apify.com/phoenix2810) (community)
- **Categories:** SEO tools, Developer tools, Open source
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

Pay per usage

This Actor is paid per platform usage. The Actor is free to use, and you only pay for the Apify platform usage, which gets cheaper the higher subscription plan you have.

Learn more: https://docs.apify.com/platform/actors/running/actors-in-store#pay-per-usage

## What's an Apify Actor?

Actors are web data automations that power AI and operations. They run on the Apify platform to scrape websites, process data, connect APIs, and automate workflows.
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.
Actors are written with capital "A".

## 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.
The best way to integrate Actors is as follows.

- **AI agents and MCP clients** — the [Apify MCP server](https://docs.apify.com/integrations/mcp.md) at `https://mcp.apify.com` (remote, streamable HTTP, OAuth on first use).
- **Agentic workflows and local Actor development** — [Agent Skills](https://apify.com/.well-known/agent-skills/index.json) with the [Apify CLI](https://docs.apify.com/cli/docs.md): `npm install -g apify-cli`, then `apify login`.
- **JavaScript/TypeScript projects** — the official [JS/TS client](https://docs.apify.com/api/client/js/docs.md): `npm install apify-client`.
- **Python projects** — the official [Python client](https://docs.apify.com/api/client/python/docs.md): `pip install apify-client`.
- **Any other language** — the [REST API](https://docs.apify.com/api/v2.md).

For usage examples, see the [API](#api) section below.

For more details, see Apify documentation as [Markdown index](https://docs.apify.com/llms.txt) and [Markdown full-text](https://docs.apify.com/llms-full.txt).

# README

## Redirect Chain Auditor

Fetches a public URL and reports its redirect chain, final destination, status codes, HTTPS downgrade risk, temporary redirects, redirect loops, and practical SEO recommendations.

### Use cases

- Site migration QA before and after URL changes.
- SEO audits for long redirect chains and temporary redirects.
- Monitoring landing pages after CMS, CDN, or domain changes.
- Developer-tool pipelines that need structured redirect diagnostics.

### Input

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `startUrl` | string | Yes | Public HTTP or HTTPS URL to audit. URLs with credentials and private network targets are rejected. |
| `maxRedirects` | integer | No | Maximum redirect hops to follow. Default: `10`. Range: `1` to `20`. |
| `timeoutSeconds` | integer | No | Request timeout per hop. Default: `10`. Range: `3` to `30`. |

### Output

Each run pushes one dataset item.

| Field | Type | Description |
| --- | --- | --- |
| `inputUrl` | string | Original URL from input. |
| `normalizedInputUrl` | string | URL after adding a default scheme when needed. |
| `finalUrl` | string | Last URL reached before completion or error. |
| `ok` | boolean | True when the final response is a non-error, non-redirect HTTP status. |
| `status` | integer or null | Final HTTP status code. |
| `checkedAt` | string | ISO timestamp for the audit. |
| `hopCount` | integer | Number of redirect hops followed. |
| `chain` | array | Ordered redirect hop objects with `url`, `status`, `location`, and `nextUrl` when present. |
| `score` | integer | Redirect health score from 0 to 100. |
| `grade` | string | Letter grade from A to F. |
| `issues` | array | Detected problems such as long chains, temporary redirects, loops, or final error status. |
| `recommendations` | array | Actionable fixes for detected issues. |
| `error` | string or null | Fetch or validation error, if any. |

### Example input

```json
{
  "startUrl": "https://example.com",
  "maxRedirects": 10,
  "timeoutSeconds": 10
}
```

### Example output

```json
{
  "inputUrl": "https://example.com/start",
  "normalizedInputUrl": "https://example.com/start",
  "finalUrl": "https://example.com/final",
  "ok": true,
  "status": 200,
  "checkedAt": "2026-07-08T00:00:00.000Z",
  "hopCount": 1,
  "chain": [
    {
      "url": "https://example.com/start",
      "status": 301,
      "location": "/final",
      "nextUrl": "https://example.com/final"
    },
    {
      "url": "https://example.com/final",
      "status": 200,
      "location": null
    }
  ],
  "score": 90,
  "grade": "A",
  "issues": ["1 redirect hop(s)"],
  "recommendations": [],
  "error": null
}
```

### Security

The actor only fetches public HTTP and HTTPS URLs. It rejects URL credentials, localhost and private IP literals, and hostnames that resolve to private IP ranges. Redirect targets are revalidated before following.

### Pricing

| Event | Suggested price |
| --- | ---: |
| Actor start | $0.005 |
| Page audited | $0.01 |

This keeps one-off checks cheap while allowing scheduled monitoring and bulk workflow usage to scale by result.

### FAQ

#### Does it crawl the whole site?

No. It audits one URL per run. That keeps the actor predictable and cheap for API use.

#### Does it use a browser?

No. Redirect checks use standard HTTP requests, which is faster and more reliable for this use case.

#### Can it audit staging or intranet URLs?

No. Private network targets are blocked for SSRF safety.

# Actor input Schema

## `startUrl` (type: `string`):

Public HTTP or HTTPS URL to audit. Credentials and private network targets are rejected.

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

Maximum redirect hops to follow before reporting a redirect loop or excessive chain.

## `timeoutSeconds` (type: `integer`):

Request timeout per hop.

## Actor input object example

```json
{
  "startUrl": "https://example.com",
  "maxRedirects": 10,
  "timeoutSeconds": 10
}
```

# Actor output Schema

## `audit` (type: `string`):

No description

# 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 = {
    "startUrl": "https://example.com"
};

// Run the Actor and wait for it to finish
const run = await client.actor("phoenix2810/redirect-chain-auditor").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 = { "startUrl": "https://example.com" }

# Run the Actor and wait for it to finish
run = client.actor("phoenix2810/redirect-chain-auditor").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print("💾 Check your data here: https://console.apify.com/storage/datasets/" + run["defaultDatasetId"])
for item in client.dataset(run["defaultDatasetId"]).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{
  "startUrl": "https://example.com"
}' |
apify call phoenix2810/redirect-chain-auditor --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "command": "npx",
            "args": [
                "mcp-remote",
                "https://mcp.apify.com/?tools=phoenix2810/redirect-chain-auditor",
                "--header",
                "Authorization: Bearer <YOUR_API_TOKEN>"
            ]
        }
    }
}

```

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/acts/bfbgUwMgYZAidOiKe/builds/QKrM29DFBdcEtI8Yt/openapi.json
