# Website Redirect & Health Auditor (`winning_moonstone/website-redirect-health-auditor`) Actor

Bulk-check public URLs for HTTP status, redirect chains, response time, canonical/robots signals, HTTPS downgrade, and basic security headers.

- **URL**: https://apify.com/winning\_moonstone/website-redirect-health-auditor.md
- **Developed by:** [月 明](https://apify.com/winning_moonstone) (community)
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

$2.00 / 1,000 url auditeds

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

## Website Redirect & Health Auditor

Bulk-check public URLs after a site migration, deployment, CMS change, domain move, or content release.

This Actor focuses on URL-level technical health rather than broad SEO scoring. Each saved row is one auditable URL result with evidence that can be exported to CSV/JSON/Excel or consumed by CI and monitoring workflows.

### Checks

- Final HTTP status and standard status text
- Full redirect chain, including each hop and destination
- HTTPS-to-HTTP downgrade detection
- End-to-end response time
- Canonical URL and meta robots on HTML pages
- Basic response security headers: HSTS, CSP, X-Content-Type-Options, X-Frame-Options, Referrer-Policy
- robots.txt permission when enabled
- Machine-readable findings with severity, code, and concrete action
- Clear distinction between healthy, redirect, broken, and warning results

### Safe by default

Only public HTTP(S) URLs on ports 80/443 are allowed. Hostnames are resolved before every request and redirect; localhost, private, link-local, reserved and other non-global addresses are rejected. Redirects are capped at five and every destination is revalidated. HTML reads are capped at 2 MB.

No cookies, logins, private pages, credentials, browser automation, CAPTCHA bypass, or private-network access are supported.

### Example

```json
{
  "urls": [
    "https://example.com/",
    "http://example.com/"
  ],
  "maxUrls": 2,
  "timeoutSeconds": 20,
  "checkPageSignals": true,
  "respectRobotsTxt": false
}
```

Use `respectRobotsTxt: true` for recurring audits of sites where robots rules should govern automated checks.

### Output

Important fields include `inputUrl`, `finalUrl`, `statusCode`, `resultType`, `severity`, `responseTimeMs`, `redirectChain`, `canonicalUrl`, `metaRobots`, `securityHeaders`, `findings`, and error details.

A broken URL is still a successful audit result: it is exactly the condition the Actor is meant to detect.

### Pricing

The release price is **$0.002 per audited URL ($2 per 1,000 URL results)**. Pay-per-event budget limits are honored before additional results are saved. Check the live Pricing tab because store pricing can change over time.

### Good use cases

- Post-deployment smoke checks
- Domain and URL migrations
- Bulk redirect validation
- Scheduled uptime/content health checks
- QA pipelines that need structured evidence rather than a screenshot
- Agencies validating client URL lists before handoff

### Limitations

This is not a browser renderer or full Core Web Vitals suite. JavaScript-only canonical/meta changes may not appear. Network blocking, rate limiting, robots restrictions, or TLS errors are reported rather than bypassed.

# Actor input Schema

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

Up to 200 public HTTP(S) URLs.

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

Hard cap for one run.

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

Maximum time allowed for one URL request, including redirects and response download.

## `checkPageSignals` (type: `boolean`):

For HTML pages, inspect canonical, meta robots, and selected security headers.

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

When enabled, skip URLs disallowed for the Actor user agent.

## Actor input object example

```json
{
  "urls": [
    "https://example.com/",
    "http://example.com/"
  ],
  "maxUrls": 50,
  "timeoutSeconds": 20,
  "checkPageSignals": true,
  "respectRobotsTxt": true
}
```

# Actor output Schema

## `summary` (type: `string`):

No description

## `dataset` (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 = {};

// Run the Actor and wait for it to finish
const run = await client.actor("winning_moonstone/website-redirect-health-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 = {}

# Run the Actor and wait for it to finish
run = client.actor("winning_moonstone/website-redirect-health-auditor").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 '{}' |
apify call winning_moonstone/website-redirect-health-auditor --silent --output-dataset

```

## MCP server setup

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

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/Pnk0zsWXucadkYzAK/builds/iSs0iXwujaxjTpfWA/openapi.json
