# URL Redirect Checker & Unshortener — Redirect Chains, Final URL (`northbell/url-redirect-checker`) Actor

Expand short links (bit.ly, t.co, tinyurl) and check any URL's redirect chain: every hop with its status code (301, 302, meta refresh), the final URL and final status, loops and broken links. Bulk, and shows which links changed since the last run.

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

## Pricing

from $1.20 / 1,000 link checkeds

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.
Since this Actor supports Apify Store discounts, the price gets lower the higher subscription plan you have.

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

## URL Redirect Checker & Unshortener — Redirect Chains, Final URL

**Paste links, get where they really go:** each link comes back with its **final URL, final status code and every redirect hop** (301, 302, 307, 308 and HTML meta refresh), plus loops, too many redirects and broken links. Expand short links (bit.ly, t.co, tinyurl, lnkd.in …) in bulk, or check that your redirects after a site move still land on the right page.

**Try it now. The input is already filled in.** Press **Start**: three links checked in a few seconds, for about $0.015.

| `inputUrl` | `finalUrl` | `finalStatus` | `redirects` | `redirectTypes` |
| --- | --- | --- | --- | --- |
| http://wikipedia.org/ | https://www.wikipedia.org/ | 200 | 2 | 301 |
| http://github.com/ | https://github.com/ | 200 | 1 | 301 |
| https://t.co/abc | https://www.google.com/ | 200 | 1 | 301 |

Call it from your app with the Apify API (run-sync) to expand one link at a time before you store or show it. Or put your links on a daily schedule: every row also says whether the final page or status changed since the last run, and with *Only links whose result changed* unchanged links are skipped and free.

### What you get

| Field | What it is |
|---|---|
| `inputUrl`, `finalUrl`, `finalStatus`, `ok` | the link you gave, where it ends, the status code there, and `true` when that is a 2xx |
| `redirects`, `redirectTypes`, `chain` | how many hops, which kinds (`301`, `302`, `meta-refresh` …), and every hop with its URL, status and target |
| `inputDomain`, `finalDomain`, `domainChanged`, `isShortener` | whether the link leaves its domain, and whether it is a known short-link domain |
| `httpsUpgrade`, `httpsDowngrade` | `http` → `https` on the way, or the other way round (a security problem) |
| `error` | loops, more redirects than your maximum, DNS failures, timeouts, refused connections |
| `previousFinalUrl`, `previousFinalStatus`, `changedSinceLastRun` | what the same link returned last run (`null` on the first run) |
| `timeMs` | how long the whole chain took |

### Use it for

- **Unshortening**: see where bit.ly, t.co and other short links lead before you click or publish them
- **Site moves and SEO**: check that old URLs 301 to the right new page in one hop, and find chains, loops and 404s
- **Affiliate and campaign links**: schedule daily with *Only links whose result changed* and get only the links whose landing page or status moved
- **Link lists**: clean a sheet of links to their final URLs

### Input

```json
{ "urls": ["bit.ly/xxxx", "https://example.com/old-page"], "maxRedirects": 10, "onlyChanged": true }
```

Up to 10,000 links per run. Links on different sites are checked five at a time; the same site is asked at most once a second. Only the first 64 KB of a page is read, to find a meta refresh; nothing else on the page is kept. Links that point to private network addresses (localhost, 10.x, 192.168.x …) are not opened.

### Pricing

**$1.50 per 1,000 links**, plus $0.01 per run. Broken links are results and count; links to private addresses and unchanged links skipped by *Only links whose result changed* are free. The $0.01 run-start fee is charged together with the first result, so a run that returns nothing costs nothing. If we ever change that, we say so here at least 14 days before.

**Anonymous usage count:** each finished run leaves one record in our own Apify account, so we can see whether people come back: a one-way hash of your Apify account ID (it cannot be turned back into the ID), the date, and how many results were charged. Never your input, your results or your name. Records are deleted after 90 days.

To see what a site is built with, see [Tech Stack Detector](https://apify.com/northbell/tech-stack-detector); for who owns a domain, [WHOIS Domain Lookup](https://apify.com/northbell/whois-domain-lookup).

### For AI agents

`{"urls": ["https://bit.ly/xxxx"]}` returns the final URL, final status code and every redirect hop of that short link. Rows have `type`: `url` or `error`.

# Actor input Schema

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

Short links (bit.ly, t.co, tinyurl …) or any web links, up to 10,000 per run. A link without http:// is opened as http://.

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

Stop following a link after this many hops (it comes back with an error saying so).

## `followMetaRefresh` (type: `boolean`):

Some short links answer 200 with a page that redirects by <meta http-equiv="refresh">. On: follow it like a redirect.

## `onlyChanged` (type: `boolean`):

From the second run on, return only links whose final page or final status code changed (unchanged links are free). Good for watching affiliate and campaign links.

## Actor input object example

```json
{
  "urls": [
    "http://wikipedia.org",
    "http://github.com",
    "https://t.co/abc"
  ],
  "maxRedirects": 10,
  "followMetaRefresh": true,
  "onlyChanged": false
}
```

# Actor output Schema

## `urls` (type: `string`):

Each link with its final URL, final status code and every redirect hop.

# 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://wikipedia.org",
        "http://github.com",
        "https://t.co/abc"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("northbell/url-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://wikipedia.org",
        "http://github.com",
        "https://t.co/abc",
    ] }

# Run the Actor and wait for it to finish
run = client.actor("northbell/url-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://wikipedia.org",
    "http://github.com",
    "https://t.co/abc"
  ]
}' |
apify call northbell/url-redirect-checker --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,northbell/url-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/tqfrr2Ob4sJzVrepa/builds/hrwvgb7HOWsHfnihk/openapi.json
