# URL Status & Redirect Chain Checker (`viktorov_aa/url-status-checker`) Actor

Check HTTP status codes and redirect chains for a batch of URLs. Fast HTTP-only checker for SEO audits and site migrations. No browser, no login.

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

## Pricing

from $0.10 / 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

## URL Status & Redirect Chain Checker

Fast and reliable HTTP status checker for batch URL validation. Perfect for SEO audits, broken link detection, and redirect chain analysis.

### What does this actor do?

This actor checks a list of URLs and returns comprehensive information about each one:

- **HTTP status codes** (200, 301, 404, 500, etc.)
- **Complete redirect chains** with all intermediate steps
- **Final destination URL** after following all redirects
- **Response times** for performance analysis
- **Error detection** for timeouts, DNS failures, and connection issues

Unlike browser-based solutions, this actor uses pure HTTP requests, making it extremely fast and resource-efficient. It's ideal for checking hundreds or thousands of URLs without the overhead of running a full browser.

### Use Cases

#### SEO Professionals

- Audit redirect chains to ensure they're not too long (SEO best practice: max 3 redirects)
- Find broken links (404s, 500s) across your site
- Verify that old URLs properly redirect to new ones after site migrations
- Check competitor redirect strategies

#### Web Developers

- Validate deployment by checking that all important URLs return correct status codes
- Monitor API endpoints for availability
- Test CDN and caching configurations
- Verify SSL certificate installations (HTTPS redirects)

#### Digital Marketers

- Check affiliate links and tracking URLs
- Verify campaign URLs before launch
- Monitor landing page availability
- Audit competitor link structures

### Input Configuration

#### URLs (required)

A list of URLs to check. Each URL must start with `http://` or `https://`. One run accepts at most 1,000 URLs.

**Example:**

```
https://example.com
https://old-domain.com/page
https://bit.ly/short-link
```

#### Maximum Redirects (optional, default: 10)

The maximum number of redirects to follow before stopping. Set to 0 to not follow any redirects.

**Recommendation:** Keep at 10 unless you specifically need to test redirect loops or very long chains.

#### Timeout (optional, default: 30000ms)

Request timeout in milliseconds. If a server doesn't respond within this time, the check will fail with a timeout error.

**Recommendation:** 30 seconds is usually sufficient. Reduce to 10-15 seconds if you want faster results and don't mind missing slow servers.

#### Custom User-Agent (optional)

Override the default User-Agent header. Useful if you need to mimic a specific browser or bot.

**Example:** `Mozilla/5.0 (compatible; SEOBot/1.0)`

### Output Format

Each checked URL produces one row in the dataset with these fields:

- `originalUrl`: The URL you provided
- `finalUrl`: Where the URL ultimately points to
- `statusCode`: HTTP status code (200, 301, 404, etc.)
- `redirectCount`: How many redirects were followed
- `redirectChain`: Array of all redirect steps with URLs and status codes
- `totalTime`: Time taken in milliseconds
- `error`: Error message if the check failed, null otherwise
- `timestamp`: When the check was performed (ISO 8601 format)

### Limitations

This actor has intentional limitations to keep it fast and reliable:

- **HTTP only**: No JavaScript execution, no browser rendering
- **Public URLs only**: Loopback, private, and link-local addresses (including cloud metadata endpoints) are rejected. Password-protected pages and authenticated APIs are not supported.
- **No CAPTCHA solving**: URLs behind CAPTCHAs will fail
- **No cookie handling**: Each request is independent
- **Datacenter IPs**: Some sites may block or rate-limit datacenter traffic

If you need to check URLs that require JavaScript execution, authentication, or CAPTCHA solving, you'll need a browser-based solution instead.

### Pricing

The Actor uses pay-per-event pricing with the event **`url-checked`**: one charge for each URL that was checked. A 404 or 500 answer is a checked URL and is charged; a request that failed (timeout, DNS, blocked URL) is written to the dataset with an `error` and is not charged. The price and the Apify platform fee are shown on the Pricing tab of the Actor. Use the input limits and your Apify spending limit to keep a run within budget.

### Performance

- **Speed**: Typically 100-500ms per URL (depends on target server response time)
- **Memory**: 256-512 MB RAM
- **Prefill runtime**: Under 5 minutes for the example URLs

### Local Development

```bash
## Install dependencies
npm install

## Run locally
npm start

## Run tests
npm test
```

### Support

For bugs, feature requests, or questions, please open an issue on our GitHub repository or contact us at support@legion-labs.com.

***

**Version:** 1.0.0\
**Author:** Legion Labs\
**License:** Proprietary

# Actor input Schema

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

List of public http(s) URLs to check. Loopback, private, and link-local addresses are rejected. Maximum 1000 URLs.

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

Maximum number of redirects to follow before stopping (0-20)

## `timeout` (type: `integer`):

Timeout for each HTTP request in milliseconds

## `userAgent` (type: `string`):

Optional custom User-Agent header. Leave empty for default.

## Actor input object example

```json
{
  "urls": [
    "https://example.com",
    "https://wikipedia.org",
    "https://python.org",
    "https://github.com/legion-factory-nonexistent-page-404",
    "https://www.google.com"
  ],
  "maxRedirects": 10,
  "timeout": 30000,
  "userAgent": ""
}
```

# Actor output Schema

## `overview` (type: `string`):

Default dataset in the overview table: original URL, final URL, status code, redirect count and time.

# 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": [
        "https://example.com",
        "https://wikipedia.org",
        "https://python.org",
        "https://github.com/legion-factory-nonexistent-page-404",
        "https://www.google.com"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("viktorov_aa/url-status-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": [
        "https://example.com",
        "https://wikipedia.org",
        "https://python.org",
        "https://github.com/legion-factory-nonexistent-page-404",
        "https://www.google.com",
    ] }

# Run the Actor and wait for it to finish
run = client.actor("viktorov_aa/url-status-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": [
    "https://example.com",
    "https://wikipedia.org",
    "https://python.org",
    "https://github.com/legion-factory-nonexistent-page-404",
    "https://www.google.com"
  ]
}' |
apify call viktorov_aa/url-status-checker --silent --output-dataset

```

## MCP server setup

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