# Redirect Chain (`web.redirects`)

Follow a URL hop by hop (up to 10) and return each status code and Location, the final URL, loops and whether HTTP upgrades to HTTPS.

- **Route:** `POST /v1/run/web.redirects`
- **Price:** $0.0005 per request ($0.50 per 1,000) · `cost_usd` on every response
- **Source:** GetAllAPIs network checks (`netcheck`) · failover: no
- **Measured latency:** p50 47 ms · p95 47 ms · p99 47 ms (1 calls, 30d)
- **Heavy response:** no

## Input

| Field | Type | Required | Default | Notes |
|---|---|---|---|---|
| `url` | string | yes |  | Public http(s) URL |

## Output (`output` in the run envelope)

| Field | Meaning |
|---|---|
| `hops` | Each request with status, Location and time. |
| `final_url` | Where the chain ends. |
| `redirect_count` | Number of redirects. |
| `loop_detected` | True when a URL repeats. |
| `https_upgrade` | True when an http:// URL ends on https://. |
| `verdict` | Plain-words summary. |

## Example

```bash
curl -s -X POST https://getallapis.com/v1/run/web.redirects \
  -H "Authorization: Bearer $GETALLAPIS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"url":"http://github.com"}'
```

```python
from getallapis_client import Client
client = Client()  # reads GETALLAPIS_API_KEY
result = client.run('web.redirects', {'url': 'http://github.com'})
print(result['cost_usd'], result['output'])
```

```bash
getallapis run web.redirects '{"url":"http://github.com"}'
```

Quote first (free, validates input): `POST /v1/quote/web.redirects` with the same body.
